From 8024b466e9ea665dc3c338ae1f707b79c7db5576 Mon Sep 17 00:00:00 2001 From: Sky Young Date: Mon, 28 Oct 2019 13:01:59 -0600 Subject: [PATCH 1/3] Calculate the extra floData size to add to the Buffer when initializing --- lib/primitives/tx.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index b6606736..6e0349e8 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -719,7 +719,16 @@ class TX { } } - const size = 156 + prev.getVarSize(); + // Calculate the extra floData size to add to the Buffer when initializing + let extraFloDataSize = 0 + if (this.version >= 2 && includeFloData){ + let bufferLength = this.floData.length; + + extraFloDataSize += encoding.sizeVarint(bufferLength); + extraFloDataSize += bufferLength + } + + const size = 156 + prev.getVarSize() + extraFloDataSize; const bw = bio.pool(size); bw.writeU32(this.version); From 30b84f6c63af24d13cd19fca8c2be78396093e66 Mon Sep 17 00:00:00 2001 From: Sky Young Date: Mon, 28 Oct 2019 13:02:19 -0600 Subject: [PATCH 2/3] Add new start/test scripts --- .gitignore | 2 +- package.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2c34f35a..74884b31 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ coverage/ yarn.lock webpack.*.js .DS_Store -tmp \ No newline at end of file +tmp* diff --git a/package.json b/package.json index f1cb99e2..61203c44 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,9 @@ "test-browser": "NODE_BACKEND=js bmocha --reporter spec test/*.js", "test-file": "bmocha --reporter spec", "test-file-browser": "NODE_BACKEND=js bmocha --reporter spec", - "test-ci": "nyc -a -n 'lib/**/*.js' --reporter=lcov --reporter=text npm run test" + "test-ci": "nyc -a -n 'lib/**/*.js' --reporter=lcov --reporter=text npm run test", + "dev": "./bin/fcoin --prefix=\"${PWD}/tmp\" --network=testnet", + "livenet": "./bin/fcoin --prefix=\"${PWD}/tmp\"" }, "browser": { "./lib/hd/nfkd": "./lib/hd/nfkd-compat.js", From bd8dc9140e0b6e491e57837ad720b0ddf69eb803 Mon Sep 17 00:00:00 2001 From: Sky Young Date: Mon, 28 Oct 2019 13:02:42 -0600 Subject: [PATCH 3/3] Bump version to v1.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61203c44..ce8260f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fcoin", - "version": "1.1.1", + "version": "1.1.2", "description": "FLO bike-shed", "license": "MIT", "repository": "git://github.com/oipwg/fcoin.git",