From b7a430574f8de186fefeaf1a5ee8ca252e26f54b Mon Sep 17 00:00:00 2001 From: "random.zebra" Date: Fri, 3 Jan 2020 12:45:40 +0100 Subject: [PATCH] PIVX (+testnet): Bump backend 3.1.1 -> 4.0.0 (#340) * PIVX: bump to 4.0.0 * PIVX: remove AccCheckpoint in block version 7 ref https://github.com/PIVX-Project/PIVX/pull/1022 * PIVX: Test block v7 in pivxparser_test --- bchain/coins/pivx/pivxparser.go | 4 ++-- bchain/coins/pivx/pivxparser_test.go | 8 ++++++++ bchain/coins/pivx/testdata/block_dump.1384217 | 1 + configs/coins/pivx.json | 6 +++--- configs/coins/pivx_testnet.json | 6 +++--- 5 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 bchain/coins/pivx/testdata/block_dump.1384217 diff --git a/bchain/coins/pivx/pivxparser.go b/bchain/coins/pivx/pivxparser.go index a854d247..f951c2e1 100644 --- a/bchain/coins/pivx/pivxparser.go +++ b/bchain/coins/pivx/pivxparser.go @@ -98,8 +98,8 @@ func (p *PivXParser) ParseBlock(b []byte) (*bchain.Block, error) { return nil, errors.Annotatef(err, "Deserialize") } - if h.Version > 3 { - // Skip past AccumulatorCheckpoint which was added in pivx block version 4 + if h.Version > 3 && h.Version < 7 { + // Skip past AccumulatorCheckpoint (block version 4, 5 and 6) r.Seek(32, io.SeekCurrent) } diff --git a/bchain/coins/pivx/pivxparser_test.go b/bchain/coins/pivx/pivxparser_test.go index 810b1e69..ccec3fcf 100644 --- a/bchain/coins/pivx/pivxparser_test.go +++ b/bchain/coins/pivx/pivxparser_test.go @@ -414,6 +414,14 @@ var testParseBlockTxs = map[int]testBlock{ "baab318237b55f2dbb1ede2c65f7da9bf2c51c0e9a63903b3376f559fe999960", }, }, + 1384217: { + size: 430, + time: 1577435460, + txs: []string{ + "9c64e40fb27da7c7f826076d0f073968ce36188e827f5a7b2924974369bf9433", + "0c5b5b1b9c491a5a7ec9caab204e14f72383460b887c5342d296ae0a7451c09e", + }, + }, } func helperLoadBlock(t *testing.T, height int) []byte { diff --git a/bchain/coins/pivx/testdata/block_dump.1384217 b/bchain/coins/pivx/testdata/block_dump.1384217 new file mode 100644 index 00000000..4fe0de59 --- /dev/null +++ b/bchain/coins/pivx/testdata/block_dump.1384217 @@ -0,0 +1 @@ +070000001f2ff47c56d8649a8901b22d65c19f73033e3cd1b2c28fd3e62f1aea53e39ea67ebf7cf103af62f05fcf8ef42c9149b520a2271e479a248aa1fddf72b70d750644c1055ed830391b000000000201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0703191f1502a206ffffffff010000000000000000000000000001000000011586257a85a8e9eba7b07bca8afec8084651c2dba2fe46ce02a622236b0822d001000000484730440220696ea3fd8b822f9f7d7abc92f9f1bfece2302db1d3195acd4d583829ec1c33be022077314512cb83a1f813572bae6c97869e92457635c4cd140b9cdead1112ac8c4e01ffffffff03000000000000000000001c59791b00000023210202b9346fdc655b1a2ccc517ce53058ec358f6509f1b24fadefbc052a9635fcccac00a3e111000000001976a9140aa851a9b4ff7f2166019e439a52b323e8c985a988ac00000000473045022100bf0c3deeb982927e4c74e3a3cfdbb4100a630d8d7d6b5969f3c434ecd9e2ff5b02203103857038500452a006efe0126a6ec0855b4219e3e0d4dc3c6fa754d308b9e0 diff --git a/configs/coins/pivx.json b/configs/coins/pivx.json index f057ed8b..96d1531f 100644 --- a/configs/coins/pivx.json +++ b/configs/coins/pivx.json @@ -22,10 +22,10 @@ "package_name": "backend-pivx", "package_revision": "satoshilabs-1", "system_user": "pivx", - "version": "3.1.1", - "binary_url": "https://github.com/PIVX-Project/PIVX/releases/download/v3.1.1/pivx-3.1.1-x86_64-linux-gnu.tar.gz", + "version": "4.0.0", + "binary_url": "https://github.com/PIVX-Project/PIVX/releases/download/v4.0.0/pivx-4.0.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "aac5b13beb9ff96b0ce62d2258d54166c756c8336672a67c7aae6b73a76b0c03", + "verification_source": "6cb1f608ec0e106ea6bbb455ec8b85c7cad05ca52ab43011d3db80557816b79e", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/pivx-qt" diff --git a/configs/coins/pivx_testnet.json b/configs/coins/pivx_testnet.json index 845c2a62..325700d2 100644 --- a/configs/coins/pivx_testnet.json +++ b/configs/coins/pivx_testnet.json @@ -22,10 +22,10 @@ "package_name": "backend-pivx", "package_revision": "satoshilabs-1", "system_user": "pivx", - "version": "3.1.1", - "binary_url": "https://github.com/PIVX-Project/PIVX/releases/download/v3.1.1/pivx-3.1.1-x86_64-linux-gnu.tar.gz", + "version": "4.0.0", + "binary_url": "https://github.com/PIVX-Project/PIVX/releases/download/v4.0.0/pivx-4.0.0-x86_64-linux-gnu.tar.gz", "verification_type": "sha256", - "verification_source": "aac5b13beb9ff96b0ce62d2258d54166c756c8336672a67c7aae6b73a76b0c03", + "verification_source": "6cb1f608ec0e106ea6bbb455ec8b85c7cad05ca52ab43011d3db80557816b79e", "extract_command": "tar -C backend --strip 1 -xf", "exclude_files": [ "bin/pivx-qt"