From 2bb16cb9c029ba3da9a2b9ead936f2c58116aac6 Mon Sep 17 00:00:00 2001 From: Oleksandr Iozhytsia Date: Mon, 28 Sep 2020 17:21:56 +0300 Subject: [PATCH 1/2] ScTransactionCommitment: sidechain ids order fixes to use little endian notation. Tests updated. --- qa/sc_backward_transfer.py | 1 + qa/test_data_generators/mc_blocks_data.py | 76 +++++ qa/test_data_generators/mc_txs_data.py | 105 ++++++ sdk/pom.xml | 16 +- .../block/MainchainBlockReference.scala | 6 +- .../block/SidechainsCommitmentTree.scala | 20 +- sdk/src/test/resources/mcblock530290_testnet3 | 1 - sdk/src/test/resources/mctx_v-4_multiple_ft | 2 +- sdk/src/test/resources/mctx_v-4_sc_creation | 2 +- sdk/src/test/resources/mctx_v-4_single_ft | 2 +- .../test/resources/mctx_v-4_without_sc_data | 1 + .../mc_block_create_3_sidechains | 1 - .../new_mc_blocks/mc_block_empty_sidechains | 2 +- .../mc_block_forward_transfer_2_sidechains | 1 - ...block_forward_transfer_3_backward_transfer | 1 - ...ock_forward_transfer_3_backward_transfer_2 | 1 - .../new_mc_blocks/mc_block_with_3_sidechains | 1 + .../mc_block_with_backward_transfer | 1 + .../block/MainchainBlockReferenceTest.scala | 323 +++++------------- .../block/MainchainTransactionTest.scala | 93 ++--- .../websocket/WebSocketChannelImplTest.scala | 14 +- 21 files changed, 360 insertions(+), 310 deletions(-) create mode 100644 qa/test_data_generators/mc_blocks_data.py create mode 100644 qa/test_data_generators/mc_txs_data.py delete mode 100644 sdk/src/test/resources/mcblock530290_testnet3 create mode 100644 sdk/src/test/resources/mctx_v-4_without_sc_data delete mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_create_3_sidechains delete mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_2_sidechains delete mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer delete mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2 create mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_with_3_sidechains create mode 100644 sdk/src/test/resources/new_mc_blocks/mc_block_with_backward_transfer diff --git a/qa/sc_backward_transfer.py b/qa/sc_backward_transfer.py index 36d032effa..fefdacc9a9 100644 --- a/qa/sc_backward_transfer.py +++ b/qa/sc_backward_transfer.py @@ -129,6 +129,7 @@ def run_test(self): assert_equal(1, len(mc_node.getblock(we1_2_mcblock_hash)["tx"]), "MC block expected to contain 1 transaction.") assert_equal(1, len(mc_node.getblock(we1_2_mcblock_hash)["cert"]), "MC block expected to contain 1 Certificate.") assert_equal(we0_certHash, mc_node.getblock(we1_2_mcblock_hash)["cert"][0], "MC block expected to contain certificate.") + print("MC block with withdrawal certificate for epoch 0 = {0}\n".format(str(mc_node.getblock(we1_2_mcblock_hash, False)))) # Generate SC block and verify that certificate is synced back scblock_id4 = generate_next_blocks(sc_node, "first node", 1)[0] diff --git a/qa/test_data_generators/mc_blocks_data.py b/qa/test_data_generators/mc_blocks_data.py new file mode 100644 index 0000000000..68aa92a11e --- /dev/null +++ b/qa/test_data_generators/mc_blocks_data.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python2 +import json + +from SidechainTestFramework.sc_test_framework import SidechainTestFramework +from test_framework.util import assert_equal, assert_true, start_nodes, forward_transfer_to_sidechain +from SidechainTestFramework.scutil import create_sidechain, \ + check_mainchain_block_reference_info, check_wallet_balance, generate_next_blocks +from SidechainTestFramework.sc_boostrap_info import SCCreationInfo, Account + +""" +Generate MC Blocks data for Unit tests + +Configuration: 1 MC node + +Test: + - generate MC Block without sidechains + - generate MC Block with 3 sidechains mentioned +""" + + +class McTxsData(SidechainTestFramework): + def setup_nodes(self): + return start_nodes(1, self.options.tmpdir) + + def sc_setup_chain(self): + pass + + def sc_setup_nodes(self): + pass + + def sc_setup_network(self, split=False): + pass + + def run_test(self): + mc_node = self.nodes[0] + mc_node.generate(200) + + + # Generate MC Block without sidechains. + block_id = mc_node.generate(1)[0] + block_hex = mc_node.getblock(block_id, False) + block_json = mc_node.getblock(block_id) + + print("MC Block without SC data: \nHash = {0}\nHex = {1}\nJson = {2}\n" + .format(str(block_id), str(block_hex), str(block_json))) + + + # Generate MC block with 3 sidechains mentioned. + sc_creation_info = SCCreationInfo(mc_node, 100, 1000) + boot_info = create_sidechain(sc_creation_info) + sidechain_id_1 = str(boot_info.sidechain_id) + + boot_info = create_sidechain(sc_creation_info) + sidechain_id_2 = str(boot_info.sidechain_id) + + boot_info = create_sidechain(sc_creation_info) + sidechain_id_3 = str(boot_info.sidechain_id) + + sc_address = "000000000000000000000000000000000000000000000000000000000000add1" + # Send 3 FTs to different sidechains + mc_node.sc_send(sc_address, 1, sidechain_id_1) # 1 Zen + mc_node.sc_send(sc_address, 2, sidechain_id_2) # 2 Zen + mc_node.sc_send(sc_address, 3, sidechain_id_3) # 3 Zen + # Generate block + block_id = mc_node.generate(1)[0] + block_hex = mc_node.getblock(block_id, False) + block_json = mc_node.getblock(block_id) + # Note: we sort only 2 last characters, so almost equal to the sort of the little-endian bytes + sidechain_ids = [sidechain_id_1, sidechain_id_2, sidechain_id_3] + sorted_sidechain_ids = sorted(sidechain_ids, key = lambda x: x[-2:]) + print("MC Block with multiple SCs mentioned: \nHash = {0}\nHex = {1}\nJson = {2}\nSidechains = {3}\n" + .format(str(block_id), str(block_hex), str(block_json), sorted_sidechain_ids)) + + +if __name__ == "__main__": + McTxsData().main() diff --git a/qa/test_data_generators/mc_txs_data.py b/qa/test_data_generators/mc_txs_data.py new file mode 100644 index 0000000000..d408792340 --- /dev/null +++ b/qa/test_data_generators/mc_txs_data.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python2 +import json + +from SidechainTestFramework.sc_test_framework import SidechainTestFramework +from test_framework.util import assert_equal, assert_true, start_nodes, forward_transfer_to_sidechain +from SidechainTestFramework.scutil import create_sidechain, \ + check_mainchain_block_reference_info, check_wallet_balance, generate_next_blocks +from SidechainTestFramework.sc_boostrap_info import SCCreationInfo, Account + +""" +Generate MC transactions for Unit tests + +Configuration: 1 MC node + +Test: + - generate MC Tx with version -4 with no SC data + - generate MC Tx with version -4 with single SidechainCreation output + - generate MC Tx with version -4 with single ForwardTransfer output + - generate MC Tx with version -4 with multiple ForwardTransfer outputs +""" + + +class McTxsData(SidechainTestFramework): + def setup_nodes(self): + return start_nodes(1, self.options.tmpdir) + + def sc_setup_chain(self): + pass + + def sc_setup_nodes(self): + pass + + def sc_setup_network(self, split=False): + pass + + def run_test(self): + mc_node = self.nodes[0] + mc_node.generate(200) + + + # Generate Tx with version -4 with no SC related outputs + mc_address = mc_node.getnewaddress() + tx_id = mc_node.sendtoaddress(mc_address, 10) + tx_hex = mc_node.getrawtransaction(tx_id) + + print("MC Transaction with version -4 without SC data: \nHash = {0}\nSize = {1}\nHex = {2}\n" + .format(str(tx_id), len(tx_hex)/2, str(tx_hex))) + + + # Generate Tx with version -4 with single SidechainCreation output + # Use the same amount and withdrawal epoch length as for unit test + creation_amount = 50 + withdrawal_epoch_length = 1000 + + sc_creation_info = SCCreationInfo(mc_node, creation_amount, withdrawal_epoch_length) + boot_info = create_sidechain(sc_creation_info) + + sidechain_id = boot_info.sidechain_id + sc_creation_tx_id = mc_node.getblock(mc_node.getbestblockhash())["tx"][-1] + sc_creation_tx_hex = mc_node.getrawtransaction(sc_creation_tx_id) + + print("MC Transaction with version -4 with single SidechainCreation output: \nHash = {0}\nSize = {1}\nHex = {2}" + "\nsidechain_id = {3}\ncreation_amount = {4}, withdrawal_epoch_length = {5}\n" + .format(str(sc_creation_tx_id), len(sc_creation_tx_hex) / 2, str(sc_creation_tx_hex), + sidechain_id, creation_amount, withdrawal_epoch_length)) + + + # Generate Tx with version -4 with single ForwardTransfer output + forward_transfer_amount = 10 + ft_tx_id = mc_node.sc_send(boot_info.genesis_account.publicKey, forward_transfer_amount, sidechain_id) + ft_tx_hex = mc_node.getrawtransaction(ft_tx_id) + print("MC Transaction with version -4 with single ForwardTransfer output: \nHash = {0}\nSize = {1}\nHex = {2}" + "\nsidechain_id = {3}\nforward_transfer_amount = {4}, public_key = {5}\n" + .format(str(ft_tx_id), len(ft_tx_hex) / 2, str(ft_tx_hex), + sidechain_id, forward_transfer_amount, boot_info.genesis_account.publicKey)) + + + # Generate Tx with version -4 with multiple ForwardTransfer outputs + send_many_params = [ + { + "scid": sidechain_id, + "amount": 10, + "address": "000000000000000000000000000000000000000000000000000000000000add1" + }, + { + "scid": sidechain_id, + "amount": 11, + "address": "000000000000000000000000000000000000000000000000000000000000add2" + }, + { + "scid": sidechain_id, + "amount": 12, + "address": "000000000000000000000000000000000000000000000000000000000000add3" + } + ] + multiple_ft_tx_id = mc_node.sc_sendmany(send_many_params) + multiple_ft_tx_hex = mc_node.getrawtransaction(multiple_ft_tx_id) + print("MC Transaction with version -4 with multiple ForwardTransfer outputs: \nHash = {0}\nSize = {1}\n" + "Hex = {2}\nForward Transfers: = {3}\n" + .format(str(multiple_ft_tx_id), len(multiple_ft_tx_hex) / 2, str(multiple_ft_tx_hex), + json.dumps(send_many_params, indent=4))) + + +if __name__ == "__main__": + McTxsData().main() diff --git a/sdk/pom.xml b/sdk/pom.xml index 1141771eed..78d6845a91 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -249,8 +249,6 @@ sidechainblock_hex sidechainblockheader_hex ommer_hex - - mcblock530290_testnet3 mcblock473173_mainnet mcblock473174_mainnet mcblock473175_mainnet @@ -288,18 +286,18 @@ mctx_v2 mctx_v-3 - + + mctx_v-4_without_sc_data + mctx_v-4_single_ft - + mctx_v-4_multiple_ft - + mctx_v-4_sc_creation sc_node_holder_fixter_settings.conf new_mc_blocks/mc_block_empty_sidechains - new_mc_blocks/mc_block_create_3_sidechains - new_mc_blocks/mc_block_forward_transfer_2_sidechains - new_mc_blocks/mc_block_forward_transfer_3_backward_transfer - new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2 + new_mc_blocks/mc_block_with_3_sidechains + new_mc_blocks/mc_block_with_backward_transfer backward_transfer_certificate_empty backward_transfer_certificate_non_empty diff --git a/sdk/src/main/scala/com/horizen/block/MainchainBlockReference.scala b/sdk/src/main/scala/com/horizen/block/MainchainBlockReference.scala index b597c8a684..a849bebd87 100644 --- a/sdk/src/main/scala/com/horizen/block/MainchainBlockReference.scala +++ b/sdk/src/main/scala/com/horizen/block/MainchainBlockReference.scala @@ -121,7 +121,8 @@ case class MainchainBlockReference( data.proofOfNoData._1 match { case Some(leftNeighbourProof) => - if (new ByteArrayWrapper(leftNeighbourProof.sidechainId) >= sidechainId) + // Compare in little-endian like in MC + if (new ByteArrayWrapper(BytesUtils.reverseBytes(leftNeighbourProof.sidechainId)) >= new ByteArrayWrapper(BytesUtils.reverseBytes(sidechainId.data))) throw new InconsistentMainchainBlockReferenceDataException(s"MainchainBlockReferenceData ${header.hashHex} left neighbour sidechain id is after current sidechain id") val merkleRoot = leftNeighbourProof.merklePath.apply(SidechainCommitmentEntry.getSidechainCommitmentEntryHash(leftNeighbourProof)) if (!util.Arrays.equals(header.hashScTxsCommitment, merkleRoot)) @@ -131,7 +132,8 @@ case class MainchainBlockReference( data.proofOfNoData._2 match { case Some(rightNeighbourProof) => - if (new ByteArrayWrapper(rightNeighbourProof.sidechainId) <= sidechainId) + // Compare in little-endian like in MC + if (new ByteArrayWrapper(BytesUtils.reverseBytes(rightNeighbourProof.sidechainId)) <= new ByteArrayWrapper(BytesUtils.reverseBytes(sidechainId.data))) throw new InconsistentMainchainBlockReferenceDataException(s"MainchainBlockReferenceData ${header.hashHex} right neighbour sidechain id is before current sidechain id") val merkleRoot = rightNeighbourProof.merklePath.apply(SidechainCommitmentEntry.getSidechainCommitmentEntryHash(rightNeighbourProof)) if (!util.Arrays.equals(header.hashScTxsCommitment, merkleRoot)) diff --git a/sdk/src/main/scala/com/horizen/block/SidechainsCommitmentTree.scala b/sdk/src/main/scala/com/horizen/block/SidechainsCommitmentTree.scala index 870cab2890..353b60aaa5 100644 --- a/sdk/src/main/scala/com/horizen/block/SidechainsCommitmentTree.scala +++ b/sdk/src/main/scala/com/horizen/block/SidechainsCommitmentTree.scala @@ -1,6 +1,6 @@ package com.horizen.block -import com.horizen.utils.{ByteArrayWrapper, MerklePath, MerkleTree} +import com.horizen.utils.{ByteArrayWrapper, BytesUtils, MerklePath, MerkleTree} import scala.collection.JavaConverters._ import scala.collection.mutable @@ -38,9 +38,7 @@ class SidechainsCommitmentTree } private[block] def getMerkleTree: MerkleTree = { - val merkleTreeLeaves = sidechainsHashMap.toSeq.sortWith(_._1 < _._1) - .map(pair => getSidechainCommitmentEntryHash(pair._1)) - + val merkleTreeLeaves = getOrderedSidechainIds().map(id => getSidechainCommitmentEntryHash(id)) MerkleTree.createMerkleTree(merkleTreeLeaves.asJava) } @@ -61,9 +59,10 @@ class SidechainsCommitmentTree def getNeighbourSidechainCommitmentEntryProofs(sidechainId: ByteArrayWrapper): (Option[SidechainCommitmentEntryProof], Option[SidechainCommitmentEntryProof]) = { // Collect and sort sidechain Ids - val sidechainsIds: Seq[ByteArrayWrapper] = sidechainsHashMap.keys.toSeq.sortWith(_ < _) + val sidechainsIds: Seq[ByteArrayWrapper] = getOrderedSidechainIds() + val littleEndianSidechainId = new ByteArrayWrapper(BytesUtils.reverseBytes(sidechainId.data)) - val leftNeighbourIndex: Int = sidechainsIds.lastIndexWhere(_ < sidechainId) + val leftNeighbourIndex: Int = sidechainsIds.lastIndexWhere(id => new ByteArrayWrapper(BytesUtils.reverseBytes(id.data)) < littleEndianSidechainId) val leftNeighbourProofOption = if(leftNeighbourIndex >= 0) { val leftNeighbourSidechainId: Array[Byte] = sidechainsIds(leftNeighbourIndex).data Some(getSidechainCommitmentEntryProof(leftNeighbourSidechainId, leftNeighbourIndex)) @@ -71,7 +70,7 @@ class SidechainsCommitmentTree None } - val rightNeighbourIndex: Int = sidechainsIds.indexWhere(_ > sidechainId, from = leftNeighbourIndex) + val rightNeighbourIndex: Int = sidechainsIds.indexWhere(id => new ByteArrayWrapper(BytesUtils.reverseBytes(id.data)) > littleEndianSidechainId, from = leftNeighbourIndex) val rightNeighbourProofOption = if(rightNeighbourIndex >= 0 ) { val rightNeighbourSidechainId: Array[Byte] = sidechainsIds(rightNeighbourIndex).data Some(getSidechainCommitmentEntryProof(rightNeighbourSidechainId, rightNeighbourIndex)) @@ -87,4 +86,11 @@ class SidechainsCommitmentTree val entry = sidechainsHashMap(new ByteArrayWrapper(sidechainId)) SidechainCommitmentEntryProof(sidechainId, entry.getTxsHash, entry.getWCertHash, merkleTree.getMerklePathForLeaf(leafIndex)) } + + // Sidechain ids are represented in a little-endian and ordered lexicographically same as in the MC. + // Note: MC data in the SC represented as a big-endian. + private def getOrderedSidechainIds(): Seq[ByteArrayWrapper] = { + val littleEndianOrderedIds = sidechainsHashMap.map(entry => new ByteArrayWrapper(BytesUtils.reverseBytes(entry._1.data))).toSeq.sortWith(_ < _) + littleEndianOrderedIds.map(id => new ByteArrayWrapper(BytesUtils.reverseBytes(id.data))) + } } \ No newline at end of file diff --git a/sdk/src/test/resources/mcblock530290_testnet3 b/sdk/src/test/resources/mcblock530290_testnet3 deleted file mode 100644 index 963cce9990..0000000000 --- a/sdk/src/test/resources/mcblock530290_testnet3 +++ /dev/null @@ -1 +0,0 @@ -000000204fe18e126c6adaae7d99d1f45047b4c0d52ed530f5e5a1962132f57f98206d0065d0f10a86a8384d4e2682ecf424d89abefc6d2cffc9d61db0eb152fde6ebc68000000000000000000000000000000000000000000000000000000000000000086fcb95d5d7b6c1f1200c1497b8772982268adad554ce544b4e41e0231293021678a2346fdce0000fd40050138777ebc5e12edbc5de0a5e09e367d53373471e3062173d81a44ff50614852a8ca9dfb3d470cb86aed08ef832f76c45c224520610ba4a0f02e4170366ec11ed48b6d848befa8ef6141ee031bb05caf53f5965e035843e2d41abdc7855881167e9d5abd7f7f7a623417c322b9e6313dfdfcbd71fd014e838b6f6cddd7261830345187cd05733010619bd5306df57e158c74eb2bc676fe791c556592f8f4273843e7356051ec15a40435cdf838c3e61ffb1cb2f6f9efae368ae536afd52f836a5e54111b55a192b34cc0b51d91a4183de1b6564a65a4aae5dbf7c3f8a8624be5ba86aeac99699168bc2e0e2ada5df9e23fa7ddec5e051eccf5be1c560fcb7fd5a2f09017cef988a8e751089240bcffb7111d4aa353fba1dd0d917352334451735dd5307098e629a6deaf7ba34d4b7676d2bc94faf136532cd90acc39776fb17c13313150b64922dceca812e83f97902b035f6af3b60e4e85583df30e37a1995901b712009227a19dfb0df557d7e607b87a9dcbafe645a97d559907bc8bd8fcda019ce87871401fdc75fab3e41a7b131f6d04832497daaf6f86472a3b5d6dea0189b4b27006237323a213cb9d9c467160a8782bb1a7a2d157b32cddbd4be6125c46a01fe5169cc2f44b46565c5c2710dd7d72b262caff1c8b034b564db176aa0e7abe1835388ed2ac24ebeb2b1fa4dbd8d160fd793b73cfb807e9a1732153fb98abca9265fe4298171ddf99a08d3117fe1e199567314c08848380a4319eddd2d92cda2e683b72bf148fbb03d7e406ca6ad3c99b9d7b620e45d725e37c2c683f9504b5a39f6020560c64192877094640fce0dfa009dff4b1ffbc5823cad2f3da586d26448a58309d906dd0e93323f5afa30256545469fe1429d32d9812abb95c03f271f3349d00effd87cce81bd21464635c43b3846e0211394ed100a5807e311801d06b8cfc81ac9b5bc486d9316754cdf2cd94378f0c0807349e4f57d2d34cf1cd43237e54b8e8eaa3c930a5abf333def9811555662f3b3c00ee1fb9b7fcbf524c25f8c55b981761de77244a606a6b06ca1e13f014a1377b17e68453d309a27ad43fac7ec3cbd724e8186f8ccdd6a0bd4f4e911221df78c35d34c9f9107626465cfdcea41d2d75c6ba667d79f752b2593dd1cc31c0f30dc06b63a3e428d44f88adb3d9d38fb4710e01e4ace774e7af67dcd5b74741c95efa054255c6e7073967df4b75144fd7e6856b2afa6cde0a4773079806d1bbf6af1f396725451a3ac6dfbd8ac5e17a93d5225161bc4cb01c23a63b07a113edf8ba0d2c59ba280ff2d318d29a32aefa5aa282f56f9be591179cb3fd1886cc161e898aa79095c99d25dc1a128a619b029d1d6d59b6941e3eaffafa238ff47e820d6392187c4945e0059970b5e243f3c8e70253ca21535aae1fff7304598e8e01d1639f2c6c84f0262dffeaa6a376f9a9118d3d6af8470ee9cce3127bb5d021b5ab0c7f9e45063821a4a117bc1f7552b7296d5739add4162f274f4011c70160f542fbd56bc4363149f0ea88361b852d06c183d4cc1612fdd3805146c8dca12161bad539a525273d7815ae84a3c8dee7782cf8093ee49659327a165f6b11b4d62e93a51f337e4b6840c74723dfb8d439f6f57ec031158dcfab65222ae4fbf15af910fdb0051b52715d59798333523355a3a9773d6a4050af2205856ee8268e971109cd98480f4950dac834be319b15c82ca051c821e4d6b0d710edcbc32a334d3e8b734522dba24793339f56323558fc2c702e3c71b414300fb6c9cf3e643317342aa1ff77b7690185445c40fd22d0e1ef95cdf44f866ad37e33b8ec22e9223882e10fc096b39ddba78ce024d77ae5e959ee3b51dcba3919912456fe8ec780d0b15755caebdb2280987c9b250101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff06037217080101ffffffff048017b42c000000001976a91477be94404071ab5f80e1bdf0a3a8d7242dff53b388ac80b2e60e0000000017a9148d3468b6686ac59caf9ad94e547a737b09fa102787405973070000000017a914fc1d7f04db5e2c05b051e0decc85effe6bc539d587405973070000000017a9148b85fc1e171a4c7994c088b91d5a75dff9e56cad8700000000 \ No newline at end of file diff --git a/sdk/src/test/resources/mctx_v-4_multiple_ft b/sdk/src/test/resources/mctx_v-4_multiple_ft index 424147f29f..ea44a510a7 100644 --- a/sdk/src/test/resources/mctx_v-4_multiple_ft +++ b/sdk/src/test/resources/mctx_v-4_multiple_ft @@ -1 +1 @@ -fcffffff017e4fc1d0f781faca0caab592bbfd2aa2521f8859430d28363deeda354be9fb9d000000006a47304402206df03ecfc0162d2b1cc6b24250261246044518ae8eaf9ecd86556152ebe0f7dc022035a7438e08baabd34091e5b8ba75d84ae993eab5bba702eed2a3c46ed442dd760121037bcf3a2af0d4ed8511d011d344e94423ab32003c41aead4ed78ee29004608b2bfeffffff01967d510f000000003c76a9142dc57444de0009b875539813fd25390ea31d815888ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b40000034023050600000000d1ad000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000080460a0c00000000d2ad0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000c0690f1200000000d3ad0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000d6000000 \ No newline at end of file +fcffffff03ec848bff3114f76f6fcb506b27c67007cf42253f3c72de11c8ac4e5e4eceb578000000006a47304402207bf8de4ea2ecc7659feb2b0429651f38a6964488a626ff2410d71b02d0ad67400220512a0abf7a0459049bcddb91f20acb134d6f72d0afb6cb52030a8a7186d5334d012102e20e48bfb7ccbb7457527bad22eefb8dab5c4edc6f1c527b28a793f3a75ff179fefffffffebee708420b8c88905f946991f8ec7e615b11666fd38bdb817fbe4f0a139977000000006a473044022001ec90bc0c42b813044e826f691ed7e66ec5a88c34d80e541b86ac04faa6099c02201f793d93eedfed9cb9bc4323168f0a2f2b73056feae5548924759acb1c7afcf2012102e20e48bfb7ccbb7457527bad22eefb8dab5c4edc6f1c527b28a793f3a75ff179feffffff2bc4d97c319508b4ffdd6c3c13b5f73a30fab1d3825c89ea59f93fefa7d25961000000006b4830450221008cc53aedb3a92c5f760ba49e4a0fabea0431a7a84ee064229476e639c4830bba02203ec00c278922e2a1c0fce492099b39644571760ed2e73bbfed0f48fe0ddbc0c8012102e20e48bfb7ccbb7457527bad22eefb8dab5c4edc6f1c527b28a793f3a75ff179feffffff01fd213705000000003c76a914fb7cd4d3a0ae8ed58b1db6a11c99731e87a429cd88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000300ca9a3b00000000d1ad0000000000000000000000000000000000000000000000000000000000001a9728fb6baec1427a71ae9c51b24dc7396d4b59dc599426d293c0e34bf0eb7a00ab904100000000d2ad0000000000000000000000000000000000000000000000000000000000001a9728fb6baec1427a71ae9c51b24dc7396d4b59dc599426d293c0e34bf0eb7a008c864700000000d3ad0000000000000000000000000000000000000000000000000000000000001a9728fb6baec1427a71ae9c51b24dc7396d4b59dc599426d293c0e34bf0eb7ad2000000 \ No newline at end of file diff --git a/sdk/src/test/resources/mctx_v-4_sc_creation b/sdk/src/test/resources/mctx_v-4_sc_creation index 6a5cdacd73..fbc4048cc9 100644 --- a/sdk/src/test/resources/mctx_v-4_sc_creation +++ b/sdk/src/test/resources/mctx_v-4_sc_creation @@ -1 +1 @@ -fcffffff05816a2634b83a9bafb4e6137a6ec6ea1a0204293b66458320e7cb57e00572d179000000006b483045022100fcf0338641d1878576b98b999855a561555c0c50e794862d8adb266d6d4f7d3802205aa94d4442c518866485f2ca1aed5f9348ea7384a37a5382de1beea747092de00121028968fd6132015d7dd42ee7f4336ecfe3978cdd46576e6e4f7b285f485567620dfeffffff358102551727ff5f01353eaad92cfbf624e9f3c7bbb764721118781610c956bb000000006a473044022057b23602b23ebea28f81ad3693ecd31a350fc508bbfce04a6a49f0075e07d02702203644b0cfc940fdabe76e9d6424a1c1a95dd7e2ae9067c77a4868c4789fa26e8b0121028968fd6132015d7dd42ee7f4336ecfe3978cdd46576e6e4f7b285f485567620dfeffffff934f03980174e97d2abf81c690fbf53d5017d44680be86e694ad801e46fdc376000000006a473044022077280d0ccfc0d288aa7b070dd4accee0b66f6439600f9ba17ed80ab14bfafa2702203f690c026fd4c8c11b89029c31280238b09f1c42fa8ddbab7da49f1eac076d200121028968fd6132015d7dd42ee7f4336ecfe3978cdd46576e6e4f7b285f485567620dfeffffffa6fce71c578feec23c74d51c853ac88ddbe8b6629bd3e6336744d0b9789a0111000000006b483045022100b0c1702572dd9aafbcee8c2d9c1351bff809a83fd25fdf8af971ac092b7af6e102204591257d025615b78ff71c58f2e21e59f02c41f036eb5013c00b7523b14e2c290121028968fd6132015d7dd42ee7f4336ecfe3978cdd46576e6e4f7b285f485567620dfeffffff67f72781b8ad5a8e6169c35e2961c0f7c00137da36f533f36194ce45158b2039000000006a47304402201b46d6df5973578a25fa03d5bafe03af2258feb5e65b257691cc032ce0a31768022006d63eb991e5d08ae2f5d255c7252797ca2ed03124b6163ba020b4c56e5e15530121028968fd6132015d7dd42ee7f4336ecfe3978cdd46576e6e4f7b285f485567620dfeffffff013f70d21a000000003c76a914baafdd4a23b5e85695f83be907f1a0445a6fd18b88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4010100000000000000000000000000000000000000000000000000000000000000e803000000f2052a01000000ddea6ff950e5efff4da66306155bcc1219bf2a3776804458c4fc166cd75f46a4c13c158597376bccf305f7a363f7ba2b04e91e393eaedaa95a5e6284cd3607b58014a631e9e955dbdb2352a5b679e2d1269abeb59f81ef815d93280d8b46630b625f64e7c83e366c2bbd483ed0134322168ae8a6e1e0dd3d7f99ea038fe3df00003c29f7bdb83189a56e3ede091575f278b00d2754a842e0df517b8067304eada8b4bd31b3a51b4aa5365ebd35496102e8fb131684cb539d795f3b2624f84e0d82dc810075618c7b8259280ce14d8b03681ecc01fc69bb7bf0985b98140d0601000000bf000000 \ No newline at end of file +fcffffff05a35049affc1ee3c135f2ece26e61a6b7ee93fd5b3c733475a9784f1f4b2547e8000000006a4730440220340ce06896aa84249bcf835f1a1370281dca81fccf4f75a42b2e4b3394b2b788022061ea48d993832f3b67cdee883f068a99364631e1ba96389e101032ef5f991534012103acc70aaa9cba8e589a642782c4de28eabe288e6b990b8d79bc4e900f54a050e0feffffffef75eb4773678aa90c01ed45076e8ff04311ebe4caf4f8c73b20bdee381271c7000000006b483045022100e9e673fb6ba89f5fdb5d206a9a3976616ec4240e7bb284f6a9ad59692fafb2930220560064316df9bb9f719adecf11f6f225f8fc8639a515007684c9556ace076cc5012103acc70aaa9cba8e589a642782c4de28eabe288e6b990b8d79bc4e900f54a050e0feffffffe54ed34a41368aaabeb2f3547fd2da2c6fc18d42c85ef648b5df2ddefed8d78b000000006a47304402203a32eb4f6f096a66e0a771afd21eb1b5528fad13be60ded61f19b1d1b85ab1930220170ba0200dde2a672c7ed2657c5ef7fc3cbc52d0b1958454b631f6721a0a1a6c012103acc70aaa9cba8e589a642782c4de28eabe288e6b990b8d79bc4e900f54a050e0feffffff758fea615dfe808fa33ab25c0dc885bb0b2914df93c354b147baef0346da6ce3000000006a473044022048604f5b043679c561ff89277df67af17ba155a50cc127c575771a8c6542c7930220187642c82e892b178f3b9a08daf787391d8107a2bfa867c4d2ac49a6ecc0ddc9012103acc70aaa9cba8e589a642782c4de28eabe288e6b990b8d79bc4e900f54a050e0feffffff213c8e759235df39da08725e81fc7aa70ab9053dfa22c48d7f48a9efa33cda9c000000006a47304402205070162b2902dab908995b8e13fa7be272f56885f9bbaff16e8daeb7c8cb9fe602201bc4f3ac480e2caae7330e0cd827b5c7b5193ebce0712d4eb4fcdcdb0c858ba6012103acc70aaa9cba8e589a642782c4de28eabe288e6b990b8d79bc4e900f54a050e0feffffff01f669d21a000000003c76a9141b6bb366650784773d590e49c3abf152066a1d8a88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b401e803000000f2052a01000000acb24b2f08e8e56fe1784f1600879c697c7cd90846e076724b090fd72206b1a5c12df6c69c3b5d7636512eea9241ebaf0138179ed2b4a3a9d3e06c24d99d5c04712ff31a8cd55bd4b347c39081143031087b28d4c46f31e07eda35256699697e94fcdc95c99855231a0bc499d5e760de37a682a728e34e5ab07a8fdac4b2120100e3eb23a3a2222cc636896601b94697cda1cf6e4df9dfe74db44c90f7d15d1b722f93dd6c754e3bddf80baa2961503ec64c4b3979e558fe3293f88d3031cfd079b325a6db009ca77088aaa55f237e517b4579d2bacf99fade605eab96f63601000060c0a9b0d53114dce82e976a0dea36fbd2991ea52a01a454572ddfdbc7e7f949dbb95f0a759164dd80a317e401b55990f7696189a8247353821052801ea4efc95d86b86664c5455046c4874845035b44dd100f2d6fdd60334e57c58739ad2301005e7b462cc84ae0faaa5884bd5c4a5a5edf13db210599aeeb4d273c0f5f32967b7071ce2b4d490b9f08f6ce66a8405735c79197cd6773d1c5aeb2a38da1c102df07b05879c77198e5aafa7feed25d4137e86b3d98d9edd9547a460f1615b10000ee9570fbffedd44170477b37500a0a1cb3f94b6361f10f8a68c4075fbc17542d7174b3d95e12ddb8aea5d6b6c53c1df6c8f60010cd2e69902ba5e89e86747569463a23254730fc8d2aabf39648a505df9dcce461443b181ef3eda46074070000550836db2c97820971db6b1421e348d946ed4d3f255295abea46556615e3123de33ec56f784f70302901a4bc10c79c6a8b1e32477aeff9fba75876592981b678fc5a2703ac0b3055e567a6cb1ebab578fc4f9121fd968680250696cb85790000078fcfb60bdfc79aa1e377cb120480538e0236156f23129a88824ca5a1d77e371e5e98a16e6f32087c91aa02a4f5e00e412e515c3b678f6535141203c6886c637b626a2ada4062d037503359a680979091c68941a307db6e4ed8bc49d21b00002f0e6f88fb69309873fdefb015569e5511fb5399295204876543d065d177bf36ab79183a7c5e504b50691bc5b4ed0293324cfe2555d3fc8e39485822a90a91afcd4ef79ec3aefbd4cbe25cbccd802d8334ce1dce238c3f7505330a14615500001f89fbe1922ab3aa31a28fd29e19673714a7e48050dee59859d68345bb7bee7d5e888d8b798a58d7c650f9138304c05a92b668294c6114185ccb2c67ce0bbbb7e1dcbb6d76f5cacd7c9732a33b21d69bd7a28c9cca68b5735d50413862bc0100308bb0dd0bd53f3d1134966702dd3c7cc8b58b270a6996a646493250b0d5f3978d0c971f8fa7a0c958f3efe2fa5269244973fafb701c2eb66dd25901f93d677ab6c538c1ed11f115e52d3f2c7087ea40c3e8cd089376baa38842e9429b5f0000d19a8d874d791f952f13d3c8ecd92e44009c09815e5ae6a8e5def7ea52fe3de4accfb5ba2aa401fbcec14b069cd0dc0f66ab025b45ef9831a26acf58673db7487043654e7980fcb2b6c1bd7593a4dfff810436f653e309121c7ccf2df70b010000732254ec6df184be360cd9ed383ed7c8c236d7761cfc0ce4e7f0cac5a06f4edab9cfc75a7dc1449c0e18ed9564c974c2e1b6847c637f74e5d391cbc80fc6e672ffd66b5ce4fb73bda8359ab8a0ea1e855df1e07d82f93c935c7e1a9a55c5000065efdbb7c3e82291a482b2f24cbd46f4dd02c370cf6dcfe8fb3c00b8b004b5ad51369b1f1b134a824d1f16d72ca6a27ba2d6190150329139cf2c6d9e5a14722f8d39b96b882c1f60a7b230e929819e2abe1cd9d7f3e8c726b1a94d20c8010100732c396eca6ffa1bf851cef449f2f087edd93e4f641b4bd93a482d9f129e675aedb688993d4e2cee824d2803301364ba10fbb66895927adb53bad8aefe8a1caab6f4ccb45883e414a1223ac7f90a89087cd752dfa0c7b3e19bbae000edd5000028d1d23c627d1252d2a2a20a246af2280f50e3fde667873aadd9893ba6833118358398e7428e717128f764714a8d52b090c1f554f58e25ea815338d7bc7326c949567e74f2f2ab3c88f5075fea75594608b8937c9059a42d712ffbd1bd980100000000000250c1a474689e375a309446e5cdd3a0c26cecdcff5c7b8cdc0728868983f1a35a49e3a1bae6f969c3d47356c08d3d169d2c0a2be908d82cd35f41a23d8c2924a9f790ab3a00d53061d440a176670d6a32de2ecd19cf8a9774729c09a6ea4d0100d8838bf55d95521291da12294b302c66042eda0dc2acc79360a1fdd8c9a366fa790c52bf926c2d96b5ba88a3a443487c5235f7c476f350c2101cfbe3bd0361dd291ebc5e42c097a158704b71006886a3662ca6db7d816b4ad12444835d89000000795ce2b34aef921ccb3d9b9695f5d3fe0a03743c955cfcf01f8a1815a7c8b03de85fe15201d4b4b6f401cb334a6988ea5bde8986a468c47c3c6a5ae96a3160ff15e06699ea82bd40c0d5547fe1be77af7817861bbfcca3f4232f05a9cec800006c216565cee4d57b32d2d70bb3cb8d4a967c0eb5d7137b2ec58466f3d4d3b5375e4baa823bcc29c6ad877d9708cd5dc1c31fa3883a80710431110c4aa22e97b67fa639f54e86cfab87187011270139df7873bed12f6fb8cd9ab48f38933801000000d1000000 \ No newline at end of file diff --git a/sdk/src/test/resources/mctx_v-4_single_ft b/sdk/src/test/resources/mctx_v-4_single_ft index 6adb1a73f4..3750faa5df 100644 --- a/sdk/src/test/resources/mctx_v-4_single_ft +++ b/sdk/src/test/resources/mctx_v-4_single_ft @@ -1 +1 @@ -fcffffff016e304c92c70db1d7f73871bc14ff1d21e21806b38df93331a04630e5cde0b759000000006a4730440220799b225fd75b17555e53f681ddcbee5a31449ff8840bad50c7e537062aeaf8b60220535475111102ae7a1fbabca5b4972954f4c6d041e4109f17b888f6e3dfe9fe20012102224d7ea9e6a56d4b27aef8d2834a5abc4fe132533b96f28d697d4b2e8a08a206feffffff015224db33000000003c76a9148e9349a3894e93cac99a4f3df194b9cdad2a5c4f88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000001404b4c0000000000d5ad0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000d3000000 \ No newline at end of file +fcffffff02757e76457e9315bf55f9893f97ba12524782e971ddc2bf68ae096b62a359cdee000000006a473044022046437a900b57c52543d2e25d131f8cd992e2f246d784e4ed12f118e34662ad1d0220216aff9617bdcd10eed2adf3920113f5f6f1991479964742a0171f2ff8bcc9520121020c28882e49c3a9d23645c25f9c90e5748cde032e7901424ff6a6eb209cf1ec74feffffffc96cfd3eb8cffb12c190dde8cdd2763b5bb378b8dd2927c404d5ed2572844d65000000006a47304402207a53cd735d5638a8cb68c0ecebc0d2ecd9636e78bfc7799b9730c884259f261402207b02a3cf77340a162c8f7d32214f4ec421a695a9ae3735ef72c8e7591d9d4b700121021166e7489c566975da98735f715bb12d0641591929930fdd9ef3332cebc223f0feffffff0147171e01000000003c76a914555675cf90873f0c0b86475bb913d0f479e27a5c88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100ca9a3b00000000acb24b2f08e8e56fe1784f1600879c697c7cd90846e076724b090fd72206b1a555e9b90784f29442f56becee35db1968d9429532e5f3a76cfc2baabeb8c8be16d2000000 \ No newline at end of file diff --git a/sdk/src/test/resources/mctx_v-4_without_sc_data b/sdk/src/test/resources/mctx_v-4_without_sc_data new file mode 100644 index 0000000000..b553123da9 --- /dev/null +++ b/sdk/src/test/resources/mctx_v-4_without_sc_data @@ -0,0 +1 @@ +01000000017c1302871b666aab1d61b1d95fc24383ec3951bc1800abc6415052cf0b4292f9000000006a47304402202892d5f114c414c2dbde97fbfda1891fc5be3b827e614344748b76167959337102205c25f5f127719bc14db9180f39f59795c50aa0e7ffc88e1e3db4fabfb54156ad0121039696aee897a6dc90625d065df9e17b2ad32fc34db302fb93c1739bcfe273d1f0feffffff0248729108000000003c76a914f05eaca48bb32610dc9f41e5b8eece3f2b72433988ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400ca9a3b000000003c76a914c20a9821da8f1f8e6dfb6f16bb4df3e8337aabba88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4be000000 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_create_3_sidechains b/sdk/src/test/resources/new_mc_blocks/mc_block_create_3_sidechains deleted file mode 100644 index bc128093a2..0000000000 --- a/sdk/src/test/resources/new_mc_blocks/mc_block_create_3_sidechains +++ /dev/null @@ -1 +0,0 @@ -03000000d3ccd76bfa7f8be005248e4a2aea498843a3b83b14eaace1bba182c7c84f5309c930703b4f5b7ba4fe3ab926425ba0a438aed09175f4f3406f34304df3c4eefc51d6e5298186c6752cffc8c881f07ef38551e147cea932e18cbb1eae3036ae93c8b9d05e030f0f2021002377a20f4aea8dd0c249c856c79003c76066b6775178beaec733573b0000240b089d7a61f456331c28f98e30a8fc86f3e7155a0ecc019304aec72f58101925afb701a10401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502dd000101ffffffff04591db42c000000001976a9145f24310d945df55989c746dc6b2c632fa0edc97c88ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000fcffffff0104cab27467e8a79b8d12d23e2e11c7fc3e31a01900a39e15c89c33250828321e000000006a47304402202773ad3b454caea1fdc7af266c70d6afa6f204c0098b514d9c0517f3ee30002f022012508be3483116b3cdba3365fe779a874904b80c2fedf368f0bef7f88a725809012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff010ddff505000000003c76a914e5d76678c49d0d759c87817bd0f84d12113a798188ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b401ebbeadde000000000000000000000000000000000000000000000000000000000500000000ca9a3b000000006692769b15d740102160a0c460dea3118a19482e7fe3f21c7f13fd674717970cc182df8883a9fa520d6e5649792daa373e9f3e8a1332fc20abd6ddba4efe98fd6de47a19e90ea4ee2b90aba4c881e6db333e7ad557a0aa96f7f422c528985ace026978dd06c58af2b04ea68129d4cd5a5e63567491164cc761c124e7565e3d0100d8544e1f8da44e967800e8ba0f455df1e3d6b64720b0ae9946105746e79dd55c183fa07e9a941952729bac35ef3e034ffc4c0ef0562533c3330c408fca43bfb34d2d7add0517d03ad3e19dff1971f6c00c6d6d83ff3984ad141a0eb423b901000000d2000000fcffffff01fc015866bccf0690d8e77213e3d86169748cfb4f9234511744c7fa1905243eb3000000006b48304502210080a599c712c935df6906993bddb36ddc5bc17142e9902c448e42cd8729c5c9a802200f47bb6b81d41807b6ddd209ebfed5d84526435f5940172832c00cc3876ec552012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff010ddff505000000003c76a914a81c58a8ff1965554a1222d292cf5908034ca46488ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b401efbeadde000000000000000000000000000000000000000000000000000000000500000000ca9a3b000000007f00c4d6400790d99422609ea5f63560d2315c1a163b6050cc747eaeb56fb3e9c1387e7a6dcd7eff696c1bc68a0df319577357844bde984faddaca2c1cab53567001ea853d97825d9ecd4c109d56252c40aeb0f28af408756fcc516e6f5c50943ce58afcca78d0dd5068e33ef99ab090ae1ac4bb7dd50a06e51e051fb5adfa000031d76d64676aeb51a3ef6ce8767ae45ed09fbf38bbed8a12827d05c121ab74ddad3db26acd318870e7f57bc1b0e93a93690d950933be742da015ac84b5c9667360de807911ea3da2f8611f7846587d61053bade6ca8ee3ae1b96056da10700000000d2000000fcffffff011a25283cf96c361375490b560431f574d7db4e3abbf316b3a9ad56c5e374ae15000000006b483045022100830829bb1ad3a89fd8f4febdfdd8f02d7e2996da4e3660a14d732a609388c88b02205b39350ef8fc16c01169383c50b14143f576111577130ee8346e12822eeef715012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff010ddff505000000003c76a914f98f75126780e14e603777504f6eade479d3deb988ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b401edbeadde000000000000000000000000000000000000000000000000000000000500000000ca9a3b000000004e8ac0f370c6ce0da26288888524c4a992294d38f3276d19fd444c7f4e7258c9c1949e517eadb00987599b0867a298769ebee634d747c80ecad58252cc52ac72360002bf09bac19db49974b533a3eb7191a2f963c95c33cc2b57b64c7f71cc9633a4ae4ab3dbb7b40c0aaecb75a8bfd87f725a608ee6ba1d6c18430328806c0100b4314914f519ef5ce927acd8267ad64f7e7efeab176f159c419c63318fbd6d929e393d630746d20a037fbb4c896e567f18adaa7c58b230eeee51fe53fa030405ac4f74f040e2e54939e7b1434e0c7757fff1d9a1a1bbc7d61831bd2e0ab800000000d200000000 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_empty_sidechains b/sdk/src/test/resources/new_mc_blocks/mc_block_empty_sidechains index 2df4427cab..6929b4ace9 100644 --- a/sdk/src/test/resources/new_mc_blocks/mc_block_empty_sidechains +++ b/sdk/src/test/resources/new_mc_blocks/mc_block_empty_sidechains @@ -1 +1 @@ -030000006e8207bfb4e36fd0676cacbd6126e6c164c8cea5c434a30fe6bfaaf97dcdd702209183d64bd5092bdec3590c02d0e482b5096b3dcd7c473398e2941db1bfda7700000000000000000000000000000000000000000000000000000000000000000206765e020f0f200700f18e5abb1e71063559e10cf69d53e2adc988a8360974ca111db5c6a2000024042d47e4912bb47969197bdb74644e2dcde9117b9a3852d1b5254f53ce5f5b88efa363c20101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502e1000101ffffffff048017b42c000000001976a91460a75e5396eba2f81f2217da14a80f5268de629e88ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f5870000000000 \ No newline at end of file +00000020b8b9ac217156273e93cb5ec3d458d49657bffc638a5ae4f248f7bfd696023d01cbb35db1619eb01e17c2d604f80558a8e0f9fb734174492af9c9ccb4b1d00e4900000000000000000000000000000000000000000000000000000000000000006bd2715f040f0f2019004ee7b5fc49eda0caf0568fd9e5ec28992031842dbf919fe608a80b47000024057b0cc6d4737df7c405fbf0dcd09d2259461020c6b122a47aa39e46abdbbfa57772b58a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502c9000101ffffffff048017b42c000000001976a914a2f94b1481f32c248e2bdf234084b759b08b1ef088ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_2_sidechains b/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_2_sidechains deleted file mode 100644 index 8b0fcdfeee..0000000000 --- a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_2_sidechains +++ /dev/null @@ -1 +0,0 @@ -03000000a22a284c75e255066ddd63742cff5b47acb84f4acaef6674f20bc0ab05fde50c4af25ef8ab191df3e30798bbb9d741400e860a4ba82f7b0f0aea336d3856abfef1f23f4d1345102af2dc0367ce499af5a0be07f638e47f93c7df55d88b81af1c2dbbd05e020f0f200e00e7855129a495c6f1034f498cc1825142d9a7fe6c3b12c1ce1b762a6d000024034e5b30442ac51ede71f0619719249b33f51bf610ff48ef6b19e95df6e1fd48543b15ac0301000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502de000101ffffffff04011bb42c000000001976a9149241155cd62c7bb978d6742ce94206c69234ba0588ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000fcffffff01a14d7bc56f130b85308496b771542f28446b941dc6def69f16e387afa6545281000000006b4830450221009bd4c40e3249abe1777fafb8ae68b6f4df6750ae5c670a1c9ab775a9e21b67d8022072a3cd9c0522c27b13f454904c366ae2589bad569b349c2d8af88796a632a676012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff01d3dff505000000003c76a91404fbd38b705e11be86e40d0c28c09edcce81bf8b88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100ca9a3b000000007f00c4d6400790d99422609ea5f63560d2315c1a163b6050cc747eaeb56fb3e9efbeadde00000000000000000000000000000000000000000000000000000000d3000000fcffffff03244de1b92f4ecdfd5639a344d8d835a0faeb3eeeb7e9447d6ee3dad58f090850000000006a47304402200c6da46c849c99e935aba6960c4fb96a09c30c9b23bfaee9ac6dabe670fd995e0220252770e99bb2ac875de12aa81958174d6e501eb229da280b07b2bb88089071fe012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff52d52707ebec5737015cdc9b0c7dd99f105e66f81160e89d0d122707000f5db0000000006b483045022100883a764c5aa39632fe7e653b7d15aee3ff256a83b315a2690ca0d388ba157bb80220308d862dfc35163a4e13598edba976af1bd085b3d4a5bba05fceb710d3255e31012103a5c3d0545ecdcbaeef14e743d83276ee4c77985bf27b458072d063fc1479eef2feffffff4f7a6752154b95574b6708b00892e8d7fce66a8e90a74ffa8cae78a6aa340523000000006a473044022011cfa3c2158758cae5148443edb96958e8b8e0db89965e1cdbec20fc61b2830902206456bc989e954c3cde1780d617523c4a47ef822e01cd77f97938ed32bcba7ffd012102027cc1b30449a0f515a1788e1f481f04965d30d900d8b85e64ddab993ba9f90efeffffff0186627804000000003c76a9145f24310d945df55989c746dc6b2c632fa0edc97c88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100ca9a3b000000006692769b15d740102160a0c460dea3118a19482e7fe3f21c7f13fd674717970cebbeadde00000000000000000000000000000000000000000000000000000000d300000000 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer b/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer deleted file mode 100644 index 54f225a2de..0000000000 --- a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer +++ /dev/null @@ -1 +0,0 @@ -03000000452222f32027576b03dd1e06802f09125953e1933f6b80af38259da75474c60593c90b719bc1792d6ec15681a2d06df885e9334e236c4fd5ccb262c84ee0f60d864f6f4a72d6138edb0a6ec7c32019e9df5b9c870651b85965081ec1772374bbcf8b7c5e020f0f2026005803d9286c06d98928dbdf0b07369af42edbc82228e118c11cfda27500002424f94e3a93e3333ba32bcf2b55e45d7d87cc25c81fd542c1c137934c3034bec7e6eb63df0201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502e2000101ffffffff04d619b42c000000001976a914bdf4a26b4f990d6e4706fbe307fe26a847f2cfc288ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000fcffffff032c8b813ff3d7cf1182aae2199081b60885cc6a7f67f7e4a568327ae054c44bf8000000006b483045022100d1ff993d7738a287e0c5807abee812c2d1add9513f42f98a26fd57fb05dbb4d5022056ff791ce6a2f35c3d6e09f1e9ad998e07eb7d6246dd7761da3ecc2daf094877012103428d8f6476f767f53d42aaff2d5037f738981b6a0d74642baa4426f476056c32feffffff8d46132c0452890c18ec9428fcbcfe46a3b46a8464ee9c67eb5d3120951e5bac000000006b483045022100871d5cff817549556ce25d867ae05d79ffa972ca0f2c45d1879169010929da30022055d49d20dedc7b76e0b9351db4adebfe93593cbfb9edc85bb1d031aa1a9718330121030dc7cfa4bcc78990dec0571c83fb0d7e4f36800476c5c7008d2360eb460ae637feffffff4f9e951294f42ff388fcc313c24fef5e0c1a57bd48122128d6c9497c6d260fc3000000006a47304402206fff96c5227355df2f706abd1e8ae042ce5085e4f3aadd2a20e1810832ede97502203dba6e0f926aee702819f769eb7fd46fbc1bafc93f09d1c923e2ea99e710a47a012103cc462cf20f61b74f877d6fbe4b026bb722b4aeb1d7354bd801358eed2def107bfeffffff012fe8fa02000000003c76a914f76f0c24cd615523f57569c0a9c310c9193771f788ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400000100ca9a3b000000004e8ac0f370c6ce0da26288888524c4a992294d38f3276d19fd444c7f4e7258c9edbeadde00000000000000000000000000000000000000000000000000000000d700000003fcffffffebbeadde0000000000000000000000000000000000000000000000000000000000000000452222f32027576b03dd1e06802f09125953e1933f6b80af38259da75474c6058055c82000000000e803000000000000018055c820000000003c76a914231d3f2d72969f54ffc10edf9be989698dcb5a5f88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400918f2b2035498ba7227ee3cbbe121580e7325b3fe293421f5da27fbc456a67f5fcffffffedbeadde0000000000000000000000000000000000000000000000000000000000000000452222f32027576b03dd1e06802f09125953e1933f6b80af38259da75474c6058055c82000000000e803000000000000018055c820000000003c76a914231d3f2d72969f54ffc10edf9be989698dcb5a5f88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400f357a478588db1639e56dbad60ca9358e61c2d4308b97224f438894e11cfcc38fcffffffefbeadde0000000000000000000000000000000000000000000000000000000000000000452222f32027576b03dd1e06802f09125953e1933f6b80af38259da75474c6058055c82000000000e803000000000000018055c820000000003c76a914231d3f2d72969f54ffc10edf9be989698dcb5a5f88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400c6172124334c900914a79b0532efad11e65467fe83d2f7de2874b5d40ee03875 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2 b/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2 deleted file mode 100644 index a9d342f452..0000000000 --- a/sdk/src/test/resources/new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2 +++ /dev/null @@ -1 +0,0 @@ -030000009ebbdd9bb810945aac47472c3f06336e9d8e33ba6abfc467f491902abc37110daa7f1e64a02dedd40a46706bdf870f060450cffd0c7ab01ddd05ce8bb7250b024b6980794250a217f6fd41b993689ac94a7c446524bb06b94667f5ae73052c326d78855e020f0f203b00c73bbe0848b77312163480471d1dc0de9e53bc3141b2ef694a3c1e03000024035f067d858ae1a76015c80a95d4fded8d9c088b82d044848f0dae1c550faf629d4a95e20201000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502e2000101ffffffff04d419b42c000000001976a914e50b26b3e3b28a2e80807fa510a42b75d514656488ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000fcffffff032b3519c820b54b7a40c2e91716b9fe8e85394ed5bbc568b5cbd303a9e2c641d1000000006a473044022022a1f2b7ab2bf925ad6cac746b532c0b3be41712a9e61beba57bf9c1470ac14302203172f06ec0de375d6f9c1975d61eb189c346038728ec6e8f0958ab6add0d5fa1012103afe2deb99b9a2ef3703cfd01940eca17abcb850c9c2afe5d728fd9334b9f7a84feffffff193ad135f2fae214230e750049fa9d4c4efdf43efc97099a4322ae34b8c7f50d000000006b483045022100d865cc8d6c3c11ed10eaf8ef6877b0c23ba4be4a3beb42c92fe2c41781a3f506022055a607d4e5eb2493d130471a8eb281c034dc472f1edb4c01fe9c3f5176ba506d012103afe2deb99b9a2ef3703cfd01940eca17abcb850c9c2afe5d728fd9334b9f7a84feffffff19d63728586726efd759b7c08f728a1670fb9262e42bae90a100bff58220e3dd000000006a4730440220412e1103d3013a50983fc15d10fa308ced4182d2518356bbc81aa86b93f1fea702204cc6250cfcdff4b468be820c6b2baf8ffa316476859f331a8b60644ce0764b3601210203de529c658ef727a7cd662e2ebf1eec63d13139deb69566ed474e5aa5150028feffffff0133e8fa02000000003c76a914d3a1345d50392f837e6c084a8b785b68db0c723588ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400000100ca9a3b000000007f00c4d6400790d99422609ea5f63560d2315c1a163b6050cc747eaeb56fb3e9efbeadde00000000000000000000000000000000000000000000000000000000d700000003fcffffffedbeadde00000000000000000000000000000000000000000000000000000000000000009ebbdd9bb810945aac47472c3f06336e9d8e33ba6abfc467f491902abc37110d8055c82000000000e80300000000000000018055c820000000003bfc120ac45d8b9f78bd62fb56e4cf922bbb2507563e19656f4220b258feb4223b63a53e731815c74b3ef7f46b648d71f2221874fcffffffebbeadde00000000000000000000000000000000000000000000000000000000000000009ebbdd9bb810945aac47472c3f06336e9d8e33ba6abfc467f491902abc37110d8055c82000000000e80300000000000000018055c820000000003bfc120ac45d8b9f78bd62fb56e4cf922bbb25073cc8260669f1316eb07134b39547aacaa235686dce35bd90544937f98c66e7b1fcffffffefbeadde00000000000000000000000000000000000000000000000000000000000000009ebbdd9bb810945aac47472c3f06336e9d8e33ba6abfc467f491902abc37110d8055c82000000000e80300000000000000018055c820000000003bfc120ac45d8b9f78bd62fb56e4cf922bbb2507523d5dcd395eb717a56f3dcba77af9fb235a9f34bf214131f228d984cd32ea42 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_with_3_sidechains b/sdk/src/test/resources/new_mc_blocks/mc_block_with_3_sidechains new file mode 100644 index 0000000000..61906e53ab --- /dev/null +++ b/sdk/src/test/resources/new_mc_blocks/mc_block_with_3_sidechains @@ -0,0 +1 @@ +030000001c2094d6a06b53d287e318964110c3579575d3892df82084dcc28edbbaeebc05bbb9e8f8048008b59687c4397cbf03fd41f0b3ad355eafbdc9e00585661b4dd12d46fd3d1b94efba26a8d62ee0a73eae1c5b72eff3daf627ca8646beba0beea4bae0715f020f0f207b00cbbca06c3abc198e2fe367f76b6755dbabb9ada8b5ed1286c5f9022000002403452997c3bb30f39904608455065c4e03a21e909b52c2829d597e241c5ab6068ed1b3b20401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502df000101ffffffff04071bb42c000000001976a914a3d4bef11cf5bab7518da2f1efe0082b7999880688ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f58700000000fcffffff0122eea1f9ecbbbd070413abee9217cbbf8c7e874d5f889577c962325513912c88000000006b483045022100d343d311583ed602c2a0e249427334b79f8d83d251fa8be5c6f2cce73b87280602202ae9da2d2b68defacffed7bdc43dc8b9af12d6241cc96c940cbc1ac1ba04cb9e012102d164204db1c67f8d9d130b636c3b170098530de7d7f8f42130fcb1760e8e7a35feffffff0193cc4522000000003c76a91419675d8d811b02f717c68c426706b2a26079185e88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100a3e11100000000d1ad000000000000000000000000000000000000000000000000000000000000bb80276e60b3a77f88f6c7914c7bf12a5b06f1bc8320f57922430a5024a3829bb4000000fcffffff01a6c62f47617fb97a94a203ec99eed5241fde27d1cbd3851e4dbff19380a0ecee000000006b483045022100ccf0238a1f41406a02cffe3db3ebb3b53222b509605182ea357a6754682ecfb10220544e33f2b594ed4aa6059786c24c577a6f7d77c9cf52f79de6fd0729f6ffc55c012102d164204db1c67f8d9d130b636c3b170098530de7d7f8f42130fcb1760e8e7a35feffffff01938e312e000000003c76a91410a15a5d55ea6f83a1b7d777c284c7f76a288cc688ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100e1f50500000000d1ad00000000000000000000000000000000000000000000000000000000000005413a22f1a8de6d9f884cfd90bacb1bf04047a9ad3692e2ae40de0e576e057fd4000000fcffffff01ac07ebbe3a23b90867cccd2a4460b109be448aa08265bea0ff4c667733e60c11000000006b483045022100f957fef5ad1e88fecfec8bc21caa259f7f2ecdea3a4b550e54d13623f1cde6f10220583820283ff2774d1514e82bae0ada9cfeb1120f97518cd143bbac7841c60c9d012102d164204db1c67f8d9d130b636c3b170098530de7d7f8f42130fcb1760e8e7a35feffffff0193ad3b28000000003c76a914be88d3bf4f9f9116cad7f15e879d8d4b26cec82888ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b4000100c2eb0b00000000d1ad000000000000000000000000000000000000000000000000000000000000f98e33ffcf77eba9cdc06f7ce93e92b32b5561e9b0ff70fc66d1737536ad3905d400000000 \ No newline at end of file diff --git a/sdk/src/test/resources/new_mc_blocks/mc_block_with_backward_transfer b/sdk/src/test/resources/new_mc_blocks/mc_block_with_backward_transfer new file mode 100644 index 0000000000..a0ffdcacd3 --- /dev/null +++ b/sdk/src/test/resources/new_mc_blocks/mc_block_with_backward_transfer @@ -0,0 +1 @@ +030000005540df1fdfb8da6c942122a991a0f79a1fc2647e6d1b312533127ef40350a5063bd097602d4ae8e3990dc4a6cb19da60e1dc4491a6995c72b6011a09d4fe1de0db004140fa56d6ce88697c1514ac887eb8ef897fc4e4078ba34d3c939e63d69010ed715f020f0f203100a441113237d39f5c9c1ca863a019ff646d861b70e674e3b0530f590100002407a459d3223a37039b1dbda19d55b34dd1a3343d5c3103a75140df7156a25747be0283a70101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502e7000101ffffffff04681bb42c000000001976a914e77586da587fb149c0d80942bfd7946b021baf4e88ac80b2e60e0000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f587405973070000000017a914b6863b182a52745bf6d5fb190139a2aa876c08f5870000000001fbffffff8f7ac9277900b19896bd5945a0b47a8f0d0ad9b0dbac74ee20640777a2876752000000000700000000000000b74cfb39fd62327b326943c433efb85c3113be3104423b8d92bdbb27d9ca3d03212eb12bc52b8f1a211c655df611709511db6a4c68b774b54d14715d6bcf2b8dfbbc95ab8fb7a1ee97542387681657ea06e98c010ad523abf2bc8435a010742eab205c9b7ea449757b454a17bbcb659d9e5d436f29334910690059d0b5380000d6d597345d48102e41c49255112e0a580226a9aff474e6ffcf4839100653591c25590dec35c4dcb114ef9cbb6f2d7bb10baf756337fe201bfaa99577546518b31afd15fd45ceedfe4182cb6cfadd6a9b2f3bd56f2ff945725f9d147317050100004ceb5436baeb5af0409f54b3cc8a3ef9444b847d65c6ece3820ece799bf1d61c88af6ed83dccb6354ec9f283b0d8eef2391bc4a77365b0ef6c6fe49ec61d597cef88df5d7eb090397fc48811b6e76ab8818c6acb09dbe49c28642b3b98f300007761095fbe86785b9dd4bdf86aebbf071745c62b990a79f2b8780bf03961a4970cf42de5ec7f0b67780b65156f75d325d3d3b892766c7b381e0f41cbb6dc6f7f40ec521853377e76a082eaddbfc3511bf33b27bf4f0842dad1a4eab0fd220100da06a4b6df2cf8ae41fd3ff941caa520508fabe178c7762115f7d2eb8024a0ff1406091270b6c91c1ed33f2b5eaf938f80007d81f6c68a5512e8133947b3c8fdb8ffdd327d7dfcfd5fb86493d7683d77f1c8ed2b3a771b0f5b4500f9e497000015a03a565cdd287440c46ea83c19d35a809700389a89f1c2549aa92dd81f578d77b601624a02f3f96847be502059ff542f09904fb1c67ae8f76fb70268d86c78b23f821b98a900be00cbd6783a9a9cd747fce2947a143dc6ddad47cef84501000017a8d7fa8de7c4065af090ff1ecc8713d60099be03439b9a5b9bf196332efefc5fb5111f87622e0d1c4a131d8b4775c6ff3dca26803f5deeb0b49fc252a9cce604140dad85d5438afabc5455492bbc71e17f6fb0b5623b9bf68a36d6bd1d01007d797a8e56c675714d242b7da5c48385f1324d84f02abd8ca11a35c6c89de573c4b5e7ae264db70cbc4784fb103843280c198beecd50c88ad86c4076ec2a06749f3a0b364d96648be6d0e5220f741dbeed79c5b68905717ca6679a76285001000001bbfeb9130b5c95086f00d9b5a9a0b7f00c931457dbadf72dd7663db03b42173f000000006b4830450221009c7f7dc3e0beb17d41a5afe1357289b708e05168867f64744e730042fa68ecb302202af31abdf769186d35735877f8686128a8b96aae238cfdd76007e60a91c0fcea012102b50235353364d443ca94341ff49d94ba32058410d5572865e855fcdf3ae22547ffffffff017f677d01000000003c76a914e77586da587fb149c0d80942bfd7946b021baf4e88ac20bb1acf2c1fc1228967a611c7db30632098f0c641855180b5fe23793b72eea50d00b400 \ No newline at end of file diff --git a/sdk/src/test/scala/com/horizen/block/MainchainBlockReferenceTest.scala b/sdk/src/test/scala/com/horizen/block/MainchainBlockReferenceTest.scala index 7b15b3a5d7..3a5ae196ae 100644 --- a/sdk/src/test/scala/com/horizen/block/MainchainBlockReferenceTest.scala +++ b/sdk/src/test/scala/com/horizen/block/MainchainBlockReferenceTest.scala @@ -104,47 +104,9 @@ class MainchainBlockReferenceTest extends JUnitSuite { } } - @Test - @Ignore //Will be fixed and enabled again in future - def blockWithSCSupportParsingOnTestnet3(): Unit = { - val scIdHex = "1111111111111111111111111111111111111111111111111111111111111111" - val scId = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex)) - val params = TestNetParams(scId.data) - - // Test 1: Block #530292 on testnet3 (with sc support) - val mcBlockHex = Source.fromResource("mcblock530290_testnet3").getLines().next() - val mcBlockBytes = BytesUtils.fromHexString(mcBlockHex) - val mcblockTry = MainchainBlockReference.create(mcBlockBytes, params) - - assertTrue("Block expected to be parsed", mcblockTry.isSuccess) - val mcblock = mcblockTry.get - - assertEquals("Block Hash is different.", "002061121ddac5438c6de656d046e80d3a044d06bac87c2501afc69eaff6fafa", mcblock.header.hashHex) - assertEquals("Block version = 536870912 expected.", 536870912, mcblock.header.version) - assertEquals("Hash of previous block is different.", "006d20987ff5322196a1e5f530d52ed5c0b44750f4d1997daeda6a6c128ee14f", BytesUtils.toHexString(mcblock.header.hashPrevBlock)) - assertEquals("Merkle root hash is different.", "68bc6ede2f15ebb01dd6c9ff2c6dfcbe9ad824f4ec82264e4d38a8860af1d065", BytesUtils.toHexString(mcblock.header.hashMerkleRoot)) - assertEquals("ScTxCommitment hash is different.", "0000000000000000000000000000000000000000000000000000000000000000", BytesUtils.toHexString(mcblock.header.hashScTxsCommitment)) - assertEquals("Block creation time is different", 1572469894, mcblock.header.time) - assertEquals("Block PoW bits is different.", "1f6c7b5d", BytesUtils.toHexString(Ints.toByteArray(mcblock.header.bits))) - assertEquals("Block nonce is different.", "0000cefd46238a6721302931021ee4b444e54c55adad68229872877b49c10012", BytesUtils.toHexString(mcblock.header.nonce)) - assertEquals("Block equihash solution length is wrong.", params.EquihashSolutionLength, mcblock.header.solution.length) - mcblock.semanticValidity(params) match { - case Success(_) => - case Failure(e) => jFail(s"Block expected to be semantically valid, instead: ${e.getMessage}") - } - - - assertFalse("New Block occurred without SC mentioned inside, MProof expected to be undefined.", - mcblock.data.mProof.isDefined) - assertFalse("New Block occurred without SC mentioned inside, MC2SCAggTx expected to be undefined.", - mcblock.data.sidechainRelatedAggregatedTransaction.isDefined) - assertFalse("New Block occurred without SC mentioned inside, Certificate expected to be undefined.", - mcblock.data.withdrawalEpochCertificate.isDefined) - } - @Test def blockWithoutSidechains(): Unit = { - val scIdHex = "00000000000000000000000000000000000000000000000000000000deadbeef" + val scIdHex = "0000000000000000000000000000000000000000000000000000000000000000" val scId = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex)) val params = RegTestParams(scId.data) @@ -163,28 +125,28 @@ class MainchainBlockReferenceTest extends JUnitSuite { assertTrue("Block must not contain proof for left neighbour.", mcblock.data.proofOfNoData._1.isEmpty) assertTrue("Block must not contain proof for right neighbour.", mcblock.data.proofOfNoData._2.isEmpty) - assertEquals("Block Hash is different.", "08c776943ee8b41e9b27bdcfcdfb508b36cd6bc04338e07e45310814c4cb7013", mcblock.header.hashHex) - assertEquals("Block version = 3 expected.", 3, mcblock.header.version) - assertEquals("Hash of previous block is different.", "02d7cd7df9aabfe60fa334c4a5cec864c1e62661bdac6c67d06fe3b4bf07826e", BytesUtils.toHexString(mcblock.header.hashPrevBlock)) - assertEquals("Merkle root hash is different.", "77dabfb11d94e29833477ccd3d6b09b582e4d0020c59c3de2b09d54bd6839120", BytesUtils.toHexString(mcblock.header.hashMerkleRoot)) + assertEquals("Block Hash is different.", "036af1a575b50d4c4fa97e23bc9be952846dbf1e10379c3a825624a5448904c6", mcblock.header.hashHex) + assertEquals("Block version = 3 expected.", 536870912, mcblock.header.version) + assertEquals("Hash of previous block is different.", "013d0296d6bff748f2e45a8a63fcbf5796d458d4c35ecb933e27567121acb9b8", BytesUtils.toHexString(mcblock.header.hashPrevBlock)) + assertEquals("Merkle root hash is different.", "490ed0b1b4ccc9f92a49744173fbf9e0a85805f804d6c2171eb09e61b15db3cb", BytesUtils.toHexString(mcblock.header.hashMerkleRoot)) assertEquals("SCMap Merkle root hash is different.", "0000000000000000000000000000000000000000000000000000000000000000", BytesUtils.toHexString(mcblock.header.hashScTxsCommitment)) - assertEquals("Block creation time is different", 1584793090, mcblock.header.time) - assertEquals("Block PoW bits is different.", "200f0f02", BytesUtils.toHexString(Ints.toByteArray(mcblock.header.bits))) - assertEquals("Block nonce is different.", "0000a2c6b51d11ca740936a888c9ade2539df60ce1593506711ebb5a8ef10007", BytesUtils.toHexString(mcblock.header.nonce)) + assertEquals("Block creation time is different", 1601294955, mcblock.header.time) + assertEquals("Block PoW bits is different.", "200f0f04", BytesUtils.toHexString(Ints.toByteArray(mcblock.header.bits))) + assertEquals("Block nonce is different.", "0000470ba808e69f91bf2d8431209928ece5d98f56f0caa0ed49fcb5e74e0019", BytesUtils.toHexString(mcblock.header.nonce)) assertEquals("Block equihash solution length is wrong.", params.EquihashSolutionLength, mcblock.header.solution.length) assertTrue("Block expected to be semantically valid", mcblock.semanticValidity(params).isSuccess) } - // fix test and uncomment @Test - @Ignore - def blockCreate3Sidechains(): Unit = { - // Test: parse MC block with tx version -4 with creation of 3 sidechains. - val mcBlockHex = Source.fromResource("new_mc_blocks/mc_block_create_3_sidechains").getLines().next() + def blockWith3Sidechains(): Unit = { + // Test: parse MC block with tx version -4 with 3 sidechains. + val mcBlockHex = Source.fromResource("new_mc_blocks/mc_block_with_3_sidechains").getLines().next() val mcBlockBytes = BytesUtils.fromHexString(mcBlockHex) - //Check for sidechain 1 - val scIdHex1 = "00000000000000000000000000000000000000000000000000000000deadbeeb" + + // Test 1: Check for the leftmost sidechain mentioned in the block. + // We expect to get a MainchainBlockReference with AggTx and proof of presence. + val scIdHex1 = "7f056e570ede40aee29236ada94740f01bcbba90fd4c889f6ddea8f1223a4105" val scId1 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex1)) val params1 = RegTestParams(scId1.data) @@ -202,26 +164,10 @@ class MainchainBlockReferenceTest extends JUnitSuite { assertTrue("Block must not contain proof for left neighbour.", mcblock1.data.proofOfNoData._1.isEmpty) assertTrue("Block must not contain proof for right neighbour.", mcblock1.data.proofOfNoData._2.isEmpty) - //Check sidechain creation transaction. - val aggTx1 = mcblock1.data.sidechainRelatedAggregatedTransaction.get - val outputs1 = aggTx1.mc2scTransactionsOutputs() - assertEquals("MC2SCAggTx unlockers size is different", 0, aggTx1.unlockers().size()) - assertEquals("MC2SCAggTx outputs size is different", 1,outputs1.size()) - - assertTrue("Output type must be SidechainCreation.", outputs1.get(0).isInstanceOf[SidechainCreation]) - - assertEquals("Block Hash is different.", "0ce5fd05abc00bf27466efca4a4fb8ac475bff2c7463dd6d0655e2754c282aa2", mcblock1.header.hashHex) - assertEquals("Block version = 3 expected.", 3, mcblock1.header.version) - assertEquals("Hash of previous block is different.", "09534fc8c782a1bbe1acea143bb8a3438849ea2a4a8e2405e08b7ffa6bd7ccd3", BytesUtils.toHexString(mcblock1.header.hashPrevBlock)) - assertEquals("Merkle root hash is different.", "fceec4f34d30346f40f3f47591d0ae38a4a05b4226b93afea47b5b4f3b7030c9", BytesUtils.toHexString(mcblock1.header.hashMerkleRoot)) - assertEquals("SCMap Merkle root hash is different.", "93ae3630ae1ebb8ce132a9ce47e15185f37ef081c8c8ff2c75c6868129e5d651", BytesUtils.toHexString(mcblock1.header.hashScTxsCommitment)) - assertEquals("Block creation time is different", 1590737352, mcblock1.header.time) - assertEquals("Block PoW bits is different.", "200f0f03", BytesUtils.toHexString(Ints.toByteArray(mcblock1.header.bits))) - assertEquals("Block nonce is different.", "00003b5733c7aebe785177b66660c70390c756c849c2d08dea4a0fa277230021", BytesUtils.toHexString(mcblock1.header.nonce)) - assertEquals("Block equihash solution length is wrong.", params1.EquihashSolutionLength, mcblock1.header.solution.length) - - //Check for sidechain 2 - val scIdHex2 = "00000000000000000000000000000000000000000000000000000000deadbeed" + + // Test 2: Check for the sidechain in the middle, that is mentioned in the block. + // We expect to get a MainchainBlockReference with AggTx and proof of presence. + val scIdHex2 = "9b82a324500a432279f52083bcf1065b2af17b4c91c7f6887fa7b3606e2780bb" val scId2 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex2)) val params2 = RegTestParams(scId2.data) @@ -239,14 +185,10 @@ class MainchainBlockReferenceTest extends JUnitSuite { assertTrue("Block must not contain proof for left neighbour.", mcblock2.data.proofOfNoData._1.isEmpty) assertTrue("Block must not contain proof for right neighbour.", mcblock2.data.proofOfNoData._2.isEmpty) - //Check sidechain creation transaction. - val aggTx2 = mcblock2.data.sidechainRelatedAggregatedTransaction.get - val outputs2 = aggTx2.mc2scTransactionsOutputs() - assertEquals("MC2SCAggTx unlockers size is different", 0, aggTx2.unlockers().size()) - assertEquals("MC2SCAggTx outputs size is different", 1,outputs2.size()) - //Check for sidechain 3 - val scIdHex3 = "00000000000000000000000000000000000000000000000000000000deadbeef" + // Test 3: Check for the rightmost sidechain mentioned in the block. + // We expect to get a MainchainBlockReference with AggTx and proof of presence. + val scIdHex3 = "0539ad367573d166fc70ffb0e961552bb3923ee97c6fc0cda9eb77cfff338ef9" val scId3 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex3)) val params3 = RegTestParams(scId3.data) @@ -264,108 +206,97 @@ class MainchainBlockReferenceTest extends JUnitSuite { assertTrue("Block must not contain proof for left neighbour.", mcblock3.data.proofOfNoData._1.isEmpty) assertTrue("Block must not contain proof for right neighbour.", mcblock3.data.proofOfNoData._2.isEmpty) - //Check sidechain creation transaction. - val aggTx3 = mcblock3.data.sidechainRelatedAggregatedTransaction.get - val outputs3 = aggTx3.mc2scTransactionsOutputs() - assertEquals("MC2SCAggTx unlockers size is different", 0, aggTx3.unlockers().size()) - assertEquals("MC2SCAggTx outputs size is different", 1,outputs3.size()) - } - - // to do: fix test and uncomment - @Ignore - @Test - def blockForwardTransfer2Sidechains(): Unit = { - // Test: parse MC block with tx version -4 with forward transfers to two sidechains and no operation for one sidechain. - val mcBlockHex = Source.fromResource("new_mc_blocks/mc_block_forward_transfer_2_sidechains").getLines().next() - val mcBlockBytes = BytesUtils.fromHexString(mcBlockHex) + // Test 4: Check for the sidechain that is not mentioned in the block and has a leftmost neighbour. + // We expect to get a MainchainBlockReference with only right neighbour proof of no data. + val scIdHex4 = "0000000000000000000000000000000000000000000000000000000000000000" + val scId4 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex4)) + val params4 = RegTestParams(scId4.data) - //Check for sidechain 1 - val scIdHex1 = "00000000000000000000000000000000000000000000000000000000deadbeeb" - val scId1 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex1)) + val mcblockTry4 = MainchainBlockReference.create(mcBlockBytes, params4) - val params1 = RegTestParams(scId1.data) + assertTrue("Block expected to be parsed", mcblockTry4.isSuccess) + val mcblock4 = mcblockTry4.get - val mcblockTry1 = MainchainBlockReference.create(mcBlockBytes, params1) + assertTrue("Block expected to be semantically valid", mcblock4.semanticValidity(params4).isSuccess) - assertTrue("Block expected to be parsed", mcblockTry1.isSuccess) - val mcblock1 = mcblockTry1.get + assertTrue("Block must not contain transaction.", mcblock4.data.sidechainRelatedAggregatedTransaction.isEmpty) + assertTrue("Block must not contain certificate.", mcblock4.data.withdrawalEpochCertificate.isEmpty) + assertTrue("Block must not contain proof.", mcblock4.data.mProof.isEmpty) + assertTrue("Block must not contain proof for left neighbour.", mcblock4.data.proofOfNoData._1.isEmpty) + assertTrue("Block must contain proof for right neighbour.", mcblock4.data.proofOfNoData._2.isDefined) - assertTrue("Block expected to be semantically valid", mcblock1.semanticValidity(params1).isSuccess) - assertEquals("Block Hash is different.", "015ad63f2d374defa22ad4c485504b303f051ec44f48f10bc7574bbe2874e9b4", mcblock1.header.hashHex) - assertEquals("Block version = 3 expected.", 3, mcblock1.header.version) - assertEquals("Hash of previous block is different.", "0ce5fd05abc00bf27466efca4a4fb8ac475bff2c7463dd6d0655e2754c282aa2", BytesUtils.toHexString(mcblock1.header.hashPrevBlock)) - assertEquals("Merkle root hash is different.", "feab56386d33ea0a0f7b2fa84b0a860e4041d7b9bb9807e3f31d19abf85ef24a", BytesUtils.toHexString(mcblock1.header.hashMerkleRoot)) - assertEquals("SCMap Merkle root hash is different.", "1caf818bd855dfc7937fe438f607bea0f59a49ce6703dcf22a1045134d3ff2f1", BytesUtils.toHexString(mcblock1.header.hashScTxsCommitment)) - assertEquals("Block creation time is different", 1590737709, mcblock1.header.time) - assertEquals("Block PoW bits is different.", "200f0f02", BytesUtils.toHexString(Ints.toByteArray(mcblock1.header.bits))) - assertEquals("Block nonce is different.", "00006d2a761bcec1123b6cfea7d9425182c18c494f03f1c695a4295185e7000e", BytesUtils.toHexString(mcblock1.header.nonce)) - assertEquals("Block equihash solution length is wrong.", params1.EquihashSolutionLength, mcblock1.header.solution.length) + // Test 5: Check for the sidechain that is not mentioned in the block and has a rightmost neighbour. + // We expect to get a MainchainBlockReference with only left neighbour proof of no data. + val scIdHex5 = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + val scId5 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex5)) + val params5 = RegTestParams(scId5.data) - assertTrue("Block must contain transaction.", mcblock1.data.sidechainRelatedAggregatedTransaction.isDefined) - assertTrue("Block must not contain certificate.", mcblock1.data.withdrawalEpochCertificate.isEmpty) - assertTrue("Block must contain proof.", mcblock1.data.mProof.isDefined) - assertTrue("Block must not contain proof for left neighbour.", mcblock1.data.proofOfNoData._1.isEmpty) - assertTrue("Block must not contain proof for right neighbour.", mcblock1.data.proofOfNoData._2.isEmpty) + val mcblockTry5 = MainchainBlockReference.create(mcBlockBytes, params5) - //Check forward transfer transaction. - val aggTx1 = mcblock1.data.sidechainRelatedAggregatedTransaction.get - val outputs1 = aggTx1.mc2scTransactionsOutputs() - assertEquals("MC2SCAggTx unlockers size is different", 0, aggTx1.unlockers().size()) - assertEquals("MC2SCAggTx outputs size is different", 1,outputs1.size()) + assertTrue("Block expected to be parsed", mcblockTry5.isSuccess) + val mcblock5 = mcblockTry5.get - assertTrue("Output type must be SidechainCreation.", outputs1.get(0).isInstanceOf[ForwardTransfer]) + assertTrue("Block expected to be semantically valid", mcblock5.semanticValidity(params5).isSuccess) - //Check for sidechain 2 - val scIdHex2 = "00000000000000000000000000000000000000000000000000000000deadbeed" - val scId2 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex2)) + assertTrue("Block must not contain transaction.", mcblock5.data.sidechainRelatedAggregatedTransaction.isEmpty) + assertTrue("Block must not contain certificate.", mcblock5.data.withdrawalEpochCertificate.isEmpty) + assertTrue("Block must not contain proof.", mcblock5.data.mProof.isEmpty) + assertTrue("Block must contain proof for left neighbour.", mcblock5.data.proofOfNoData._1.isDefined) + assertTrue("Block must not contain proof for right neighbour.", mcblock5.data.proofOfNoData._2.isEmpty) - val params2 = RegTestParams(scId2.data) - val mcblockTry2 = MainchainBlockReference.create(mcBlockBytes, params2) + // Test 6: Check for the sidechain that is not mentioned in the block and has a both left and right neighbours. + // We expect to get a MainchainBlockReference with left and right neighbour proofs of no data. + // Take the value near to scIdHex2. Quite enough condition to have id, where, scIdHex1 < id < scIdHex2 + val scIdHex6 = "0000" + scIdHex2.substring(4) + val scId6 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex6)) + val params6 = RegTestParams(scId6.data) - assertTrue("Block expected to be parsed", mcblockTry2.isSuccess) - val mcblock2 = mcblockTry2.get + val mcblockTry6 = MainchainBlockReference.create(mcBlockBytes, params6) - assertTrue("Block expected to be semantically valid", mcblock2.semanticValidity(params2).isSuccess) + assertTrue("Block expected to be parsed", mcblockTry6.isSuccess) + val mcblock6 = mcblockTry6.get - assertTrue("Block must not contain transaction.", mcblock2.data.sidechainRelatedAggregatedTransaction.isEmpty) - assertTrue("Block must not contain certificate.", mcblock2.data.withdrawalEpochCertificate.isEmpty) - assertTrue("Block must not contain proof.", mcblock2.data.mProof.isEmpty) - assertTrue("Block must contain proof for left neighbour.", mcblock2.data.proofOfNoData._1.isDefined) - assertTrue("Block must contain proof for right neighbour.", mcblock2.data.proofOfNoData._2.isDefined) + assertTrue("Block expected to be semantically valid", mcblock6.semanticValidity(params6).isSuccess) - //Check for sidechain 3 - val scIdHex3 = "00000000000000000000000000000000000000000000000000000000deadbeef" - val scId3 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex3)) + assertTrue("Block must not contain transaction.", mcblock6.data.sidechainRelatedAggregatedTransaction.isEmpty) + assertTrue("Block must not contain certificate.", mcblock6.data.withdrawalEpochCertificate.isEmpty) + assertTrue("Block must not contain proof.", mcblock6.data.mProof.isEmpty) + assertTrue("Block must contain proof for left neighbour.", mcblock6.data.proofOfNoData._1.isDefined) + assertTrue("Block must contain proof for right neighbour.", mcblock6.data.proofOfNoData._2.isDefined) - val params3 = RegTestParams(scId3.data) - val mcblockTry3 = MainchainBlockReference.create(mcBlockBytes, params3) + // Test 7: Check for the sidechain that is not mentioned in the block and has a both left and right neighbours. + // We expect to get a MainchainBlockReference with left and right neighbour proofs of no data. + // Take the value near to scIdHex1. Quite enough condition to have id, where, scIdHex1 < id < scIdHex2 + val scIdHex7 = "ffff" + scIdHex1.substring(4) + val scId7 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex7)) + val params7 = RegTestParams(scId7.data) - assertTrue("Block expected to be parsed", mcblockTry3.isSuccess) - val mcblock3 = mcblockTry3.get + val mcblockTry7 = MainchainBlockReference.create(mcBlockBytes, params7) - assertTrue("Block expected to be semantically valid", mcblock3.semanticValidity(params3).isSuccess) + assertTrue("Block expected to be parsed", mcblockTry7.isSuccess) + val mcblock7 = mcblockTry7.get - assertTrue("Block must contain transaction.", mcblock3.data.sidechainRelatedAggregatedTransaction.isDefined) - assertTrue("Block must not contain certificate.", mcblock3.data.withdrawalEpochCertificate.isEmpty) - assertTrue("Block must contain proof.", mcblock3.data.mProof.isDefined) - assertTrue("Block must not contain proof for left neighbour.", mcblock3.data.proofOfNoData._1.isEmpty) - assertTrue("Block must not contain proof for right neighbour.", mcblock3.data.proofOfNoData._2.isEmpty) + assertTrue("Block expected to be semantically valid", mcblock7.semanticValidity(params6).isSuccess) + assertTrue("Block must not contain transaction.", mcblock7.data.sidechainRelatedAggregatedTransaction.isEmpty) + assertTrue("Block must not contain certificate.", mcblock7.data.withdrawalEpochCertificate.isEmpty) + assertTrue("Block must not contain proof.", mcblock7.data.mProof.isEmpty) + assertTrue("Block must contain proof for left neighbour.", mcblock7.data.proofOfNoData._1.isDefined) + assertTrue("Block must contain proof for right neighbour.", mcblock7.data.proofOfNoData._2.isDefined) } - @Ignore @Test - def blockBackwardTransfer3Sidechains(): Unit = { - // Test: parse MC block with tx version -4 with backward transfers to from 3 sidechains and forward transfer to 1 sidechain. - val mcBlockHex = Source.fromResource("new_mc_blocks/mc_block_forward_transfer_3_backward_transfer_2").getLines().next() + def blockWithBackwardTransfer(): Unit = { + // Test: parse MC block with tx version -4 with backward transfer. + val mcBlockHex = Source.fromResource("new_mc_blocks/mc_block_with_backward_transfer").getLines().next() val mcBlockBytes = BytesUtils.fromHexString(mcBlockHex) //Check for sidechain 1 - val scIdHex1 = "00000000000000000000000000000000000000000000000000000000deadbeeb" + val scIdHex1 = "526787a277076420ee74acdbb0d90a0d8f7ab4a04559bd9698b1007927c97a8f" val scId1 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex1)) val params1 = RegTestParams(scId1.data) @@ -377,96 +308,10 @@ class MainchainBlockReferenceTest extends JUnitSuite { assertTrue("Block expected to be semantically valid", mcblock1.semanticValidity(params1).isSuccess) - assertEquals("Block Hash is different.", "052245ab070530d3fe1d8a0a2d046a44e6832aa8e18b27abe06ba050b86e15f5", mcblock1.header.hashHex) - assertEquals("Block version = 3 expected.", 3, mcblock1.header.version) - assertEquals("Hash of previous block is different.", "0d1137bc2a9091f467c4bf6aba338e9d6e33063f2c4747ac5a9410b89bddbb9e", BytesUtils.toHexString(mcblock1.header.hashPrevBlock)) - assertEquals("Merkle root hash is different.", "020b25b78bce05dd1db07a0cfdcf5004060f87df6b70460ad4ed2da0641e7faa", BytesUtils.toHexString(mcblock1.header.hashMerkleRoot)) - assertEquals("SCMap Merkle root hash is different.", "322c0573aef56746b906bb2465447c4ac99a6893b941fdf617a250427980694b", BytesUtils.toHexString(mcblock1.header.hashScTxsCommitment)) - assertEquals("Block creation time is different", 1585805421, mcblock1.header.time) - assertEquals("Block PoW bits is different.", "200f0f02", BytesUtils.toHexString(Ints.toByteArray(mcblock1.header.bits))) - assertEquals("Block nonce is different.", "0000031e3c4a69efb24131bc539edec01d1d478034161273b74808be3bc7003b", BytesUtils.toHexString(mcblock1.header.nonce)) - assertEquals("Block equihash solution length is wrong.", params1.EquihashSolutionLength, mcblock1.header.solution.length) - assertTrue("Block must not contain transaction.", mcblock1.data.sidechainRelatedAggregatedTransaction.isEmpty) assertTrue("Block must contain certificate.", mcblock1.data.withdrawalEpochCertificate.isDefined) assertTrue("Block must contain proof.", mcblock1.data.mProof.isDefined) assertTrue("Block must not contain proof for left neighbour.", mcblock1.data.proofOfNoData._1.isEmpty) assertTrue("Block must not contain proof for right neighbour.", mcblock1.data.proofOfNoData._2.isEmpty) - - //Check for sidechain 2 - val scIdHex2 = "00000000000000000000000000000000000000000000000000000000deadbeed" - val scId2 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex2)) - - val params2 = RegTestParams(scId2.data) - - val mcblockTry2 = MainchainBlockReference.create(mcBlockBytes, params2) - - assertTrue("Block expected to be parsed", mcblockTry2.isSuccess) - val mcblock2 = mcblockTry2.get - - assertTrue("Block expected to be semantically valid", mcblock1.semanticValidity(params1).isSuccess) - - assertTrue("Block must not contain transaction.", mcblock2.data.sidechainRelatedAggregatedTransaction.isEmpty) - assertTrue("Block must contain certificate.", mcblock2.data.withdrawalEpochCertificate.isDefined) - assertTrue("Block must contain proof.", mcblock2.data.mProof.isDefined) - assertTrue("Block must not contain proof for left neighbour.", mcblock2.data.proofOfNoData._1.isEmpty) - assertTrue("Block must not contain proof for right neighbour.", mcblock2.data.proofOfNoData._2.isEmpty) - - //Check for sidechain 3 - val scIdHex3 = "00000000000000000000000000000000000000000000000000000000deadbeef" - val scId3 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex3)) - - val params3 = RegTestParams(scId3.data) - - val mcblockTry3 = MainchainBlockReference.create(mcBlockBytes, params3) - - assertTrue("Block expected to be parsed", mcblockTry3.isSuccess) - val mcblock3 = mcblockTry3.get - - assertTrue("Block expected to be semantically valid", mcblock3.semanticValidity(params3).isSuccess) - - assertTrue("Block must contain transaction.", mcblock3.data.sidechainRelatedAggregatedTransaction.isDefined) - assertTrue("Block must contain certificate.", mcblock3.data.withdrawalEpochCertificate.isDefined) - assertTrue("Block must contain proof.", mcblock3.data.mProof.isDefined) - assertTrue("Block must not contain proof for left neighbour.", mcblock3.data.proofOfNoData._1.isEmpty) - assertTrue("Block must not contain proof for right neighbour.", mcblock3.data.proofOfNoData._2.isEmpty) - - //Check for non-existing sidechain, leftmost - val scIdHex4 = "00000000000000000000000000000000000000000000000000000000deadbeea" - val scId4 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex4)) - - val params4 = RegTestParams(scId4.data) - - val mcblockTry4 = MainchainBlockReference.create(mcBlockBytes, params4) - - assertTrue("Block expected to be parsed", mcblockTry4.isSuccess) - val mcblock4 = mcblockTry4.get - - assertTrue("Block expected to be semantically valid", mcblock4.semanticValidity(params4).isSuccess) - - assertTrue("Block must not contain transaction.", mcblock4.data.sidechainRelatedAggregatedTransaction.isEmpty) - assertTrue("Block must not contain certificate.", mcblock4.data.withdrawalEpochCertificate.isEmpty) - assertTrue("Block must not contain proof.", mcblock4.data.mProof.isEmpty) - assertTrue("Block must not contain proof for left neighbour.", mcblock4.data.proofOfNoData._1.isEmpty) - assertTrue("Block must contain proof for right neighbour.", mcblock4.data.proofOfNoData._2.isDefined) - - //Check for non-existing sidechain, rightmost - val scIdHex5 = "00000000000000000000000000000000000000000000000000000000deadbeff" - val scId5 = new ByteArrayWrapper(BytesUtils.fromHexString(scIdHex5)) - - val params5 = RegTestParams(scId5.data) - - val mcblockTry5 = MainchainBlockReference.create(mcBlockBytes, params5) - - assertTrue("Block expected to be parsed", mcblockTry5.isSuccess) - val mcblock5 = mcblockTry5.get - - assertTrue("Block expected to be semantically valid", mcblock5.semanticValidity(params5).isSuccess) - - assertTrue("Block must not contain transaction.", mcblock5.data.sidechainRelatedAggregatedTransaction.isEmpty) - assertTrue("Block must not contain certificate.", mcblock5.data.withdrawalEpochCertificate.isEmpty) - assertTrue("Block must not contain proof.", mcblock5.data.mProof.isEmpty) - assertTrue("Block must contain proof for left neighbour.", mcblock5.data.proofOfNoData._1.isDefined) - assertTrue("Block must not contain proof for right neighbour.", mcblock5.data.proofOfNoData._2.isEmpty) } } \ No newline at end of file diff --git a/sdk/src/test/scala/com/horizen/block/MainchainTransactionTest.scala b/sdk/src/test/scala/com/horizen/block/MainchainTransactionTest.scala index a174b0829f..f8b5a277af 100644 --- a/sdk/src/test/scala/com/horizen/block/MainchainTransactionTest.scala +++ b/sdk/src/test/scala/com/horizen/block/MainchainTransactionTest.scala @@ -11,7 +11,7 @@ import scala.io.Source class MainchainTransactionTest extends JUnitSuite { @Test - def MainchainTransactionTest_tx_v1_coinbase(): Unit = { + def tx_v1_coinbase(): Unit = { val hex : String = Source.fromResource("mctx_v1_coinbase").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) @@ -22,7 +22,7 @@ class MainchainTransactionTest extends JUnitSuite { } @Test - def MainchainTransactionTest_tx_v1(): Unit = { + def tx_v1(): Unit = { val hex : String = Source.fromResource("mctx_v1").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) @@ -33,7 +33,7 @@ class MainchainTransactionTest extends JUnitSuite { } @Test - def MainchainTransactionTest_tx_v2(): Unit = { + def tx_v2(): Unit = { val hex : String = Source.fromResource("mctx_v2").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) @@ -44,7 +44,7 @@ class MainchainTransactionTest extends JUnitSuite { } @Test - def MainchainTransactionTest_tx_vminus3(): Unit = { + def tx_vminus3(): Unit = { val hex : String = Source.fromResource("mctx_v-3").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) @@ -54,114 +54,129 @@ class MainchainTransactionTest extends JUnitSuite { assertEquals("Tx Size is different.", 1953, tx.size) } - // Fix test @Test - @Ignore + def tx_vminus4_without_sc_data(): Unit = { + val hex : String = Source.fromResource("mctx_v-4_without_sc_data").getLines().next() + val bytes: Array[Byte] = BytesUtils.fromHexString(hex) + + val tx: MainchainTransaction = MainchainTransaction.create(bytes, 0).get + + assertEquals("Tx Hash is different.", "b20a27bf54eb7bded0d4680994a89ab4e7001ceaef4b66b7bbdcbe76346d01fb", tx.hashHex) + assertEquals("Tx Size is different.", 295, tx.size) + } + + @Test def tx_vminus4_single_ft(): Unit = { val hex : String = Source.fromResource("mctx_v-4_single_ft").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) val tx: MainchainTransaction = MainchainTransaction.create(bytes, 0).get - val sidechainIdHex: String = "0000000000000000000000000000000000000000000000000000000000000001" + val sidechainIdHex: String = "16bec8b8beaa2bfc6ca7f3e5329542d96819db35eeec6bf54294f28407b9e955" val sidechainId: ByteArrayWrapper = new ByteArrayWrapper(BytesUtils.fromHexString(sidechainIdHex)) + val expectedTxHash: String = "6e89c8e44ac1d43f33e95308704f4703436fb218a7e750b9c3c10e375cef7555" + val expectedTxSize: Int = 447 + val expectedAmount: Long = 1000000000L // 10 Zen + val expectedPublicKey: String = "a5b10622d70f094b7276e04608d97c7c699c8700164f78e16fe5e8082f4bb2ac" - assertEquals("Tx Hash is different.", "7c5c6b3d18c171704b80a9504dee4feb3bfc629b940bd8efa6f42e0a186f7e69", tx.hashHex) - assertEquals("Tx Size is different.", 301, tx.size) + assertEquals("Tx Hash is different.", expectedTxHash, tx.hashHex) + assertEquals("Tx Size is different.", expectedTxSize, tx.size) assertEquals("Tx contains different number of mentioned sidechains.", 1, tx.getRelatedSidechains.size) - assertTrue(s"SidechainId '${sidechainIdHex}' is missed.", + assertTrue(s"SidechainId '$sidechainIdHex' is missed.", tx.getRelatedSidechains.contains(sidechainId)) val crosschainOutputs: Seq[MainchainTxCrosschainOutput] = tx.getCrosschainOutputs(sidechainId) - assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '${sidechainIdHex}'.", 1, crosschainOutputs.size) + assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '$sidechainIdHex'.", 1, crosschainOutputs.size) assertTrue("Crosschain output type is different.", crosschainOutputs.head.isInstanceOf[MainchainTxForwardTransferCrosschainOutput]) val ft: MainchainTxForwardTransferCrosschainOutput = crosschainOutputs.head.asInstanceOf[MainchainTxForwardTransferCrosschainOutput] assertEquals("Forward Transfer type is different.", MainchainTxForwardTransferCrosschainOutput.OUTPUT_TYPE, ft.outputType) - assertEquals("Forward Transfer hash is different.","a9feb11e45ff3f286f51fd5dfaadb098722342be990d130eaaa7f13248655cf8", BytesUtils.toHexString(ft.hash)) + assertEquals("Forward Transfer hash is different.","eff765f72dfbf720fb9c81705d5ed856f6d090bf4d65651ecec8479c2298b402", BytesUtils.toHexString(ft.hash)) assertEquals("Forward Transfer sc id is different.", sidechainIdHex, BytesUtils.toHexString(ft.sidechainId)) - assertEquals("Forward Transfer proposition is different.","000000000000000000000000000000000000000000000000000000000000add5", BytesUtils.toHexString(ft.propositionBytes)) - assertEquals("Forward Transfer amount is different.", 5000000, ft.amount) + assertEquals("Forward Transfer proposition is different.","a5b10622d70f094b7276e04608d97c7c699c8700164f78e16fe5e8082f4bb2ac", BytesUtils.toHexString(ft.propositionBytes)) + assertEquals("Forward Transfer amount is different.", expectedAmount, ft.amount) } - // fix test @Test - @Ignore def tx_vminus4_multiple_ft(): Unit = { val hex : String = Source.fromResource("mctx_v-4_multiple_ft").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) val tx: MainchainTransaction = MainchainTransaction.create(bytes, 0).get - val sidechainIdHex: String = "0000000000000000000000000000000000000000000000000000000000000002" + val sidechainIdHex: String = "7aebf04be3c093d2269459dc594b6d39c74db2519cae717a42c1ae6bfb28971a" val sidechainId: ByteArrayWrapper = new ByteArrayWrapper(BytesUtils.fromHexString(sidechainIdHex)) + val expectedTxHash: String = "e62169f1e0100ba739bf94a38439f530dbf43df18f834fd9353343108e60c2a2" + val expectedTxSize: Int = 739 - assertEquals("Tx Hash is different.", "f55bbe2189b8a56460f98475b1cdecf4e3479760c9a5d17855158ac0f9e50e35", tx.hashHex) - assertEquals("Tx Size is different.", 445, tx.size) + assertEquals("Tx Hash is different.", expectedTxHash, tx.hashHex) + assertEquals("Tx Size is different.", expectedTxSize, tx.size) assertEquals("Tx contains different number of mentioned sidechains.", 1, tx.getRelatedSidechains.size) - assertTrue(s"SidechainId '${sidechainIdHex}' is missed.", - tx.getRelatedSidechains.contains(sidechainId)) + assertTrue(s"SidechainId '$sidechainIdHex' is missed.", tx.getRelatedSidechains.contains(sidechainId)) val crosschainOutputs: Seq[MainchainTxCrosschainOutput] = tx.getCrosschainOutputs(sidechainId) - assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '${sidechainIdHex}'.", 3, crosschainOutputs.size) + assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '$sidechainIdHex'.", 3, crosschainOutputs.size) assertTrue("Crosschain output type is different.", crosschainOutputs.head.isInstanceOf[MainchainTxForwardTransferCrosschainOutput]) var ft: MainchainTxForwardTransferCrosschainOutput = crosschainOutputs.head.asInstanceOf[MainchainTxForwardTransferCrosschainOutput] assertEquals("Forward Transfer type is different.", MainchainTxForwardTransferCrosschainOutput.OUTPUT_TYPE, ft.outputType) - assertEquals("Forward Transfer hash is different.","2cc05580ad2123ebd4ee995d8394da6abc584973e03e3ccfe39f3a35088901cb", BytesUtils.toHexString(ft.hash)) + assertEquals("Forward Transfer hash is different.","d2b6e0359c795825ab9ec1ee72487da81c7e66a8553ae4ea67e6dbcfedc70fe7", BytesUtils.toHexString(ft.hash)) assertEquals("Forward Transfer sc id is different.", sidechainIdHex, BytesUtils.toHexString(ft.sidechainId)) assertEquals("Forward Transfer proposition is different.","000000000000000000000000000000000000000000000000000000000000add1", BytesUtils.toHexString(ft.propositionBytes)) - assertEquals("Forward Transfer amount is different.", 101000000L, ft.amount) + assertEquals("Forward Transfer amount is different.", 1000000000L, ft.amount) assertTrue("Crosschain output type is different.", crosschainOutputs(1).isInstanceOf[MainchainTxForwardTransferCrosschainOutput]) ft = crosschainOutputs(1).asInstanceOf[MainchainTxForwardTransferCrosschainOutput] assertEquals("Forward Transfer type is different.", MainchainTxForwardTransferCrosschainOutput.OUTPUT_TYPE, ft.outputType) - assertEquals("Forward Transfer hash is different.","53b6b64865869ec9d72fe79f247a4faa75e0e6a3f88d5d77e1f6c6f8d5f38a01", BytesUtils.toHexString(ft.hash)) + assertEquals("Forward Transfer hash is different.","602783a66caf90b30ad864f32b6ca28b55b51c0b5356b5582b709f38354ea7fe", BytesUtils.toHexString(ft.hash)) assertEquals("Forward Transfer sc id is different.", sidechainIdHex, BytesUtils.toHexString(ft.sidechainId)) assertEquals("Forward Transfer proposition is different.","000000000000000000000000000000000000000000000000000000000000add2", BytesUtils.toHexString(ft.propositionBytes)) - assertEquals("Forward Transfer amount is different.", 202000000L, ft.amount) + assertEquals("Forward Transfer amount is different.", 1100000000L, ft.amount) assertTrue("Crosschain output type is different.", crosschainOutputs(2).isInstanceOf[MainchainTxForwardTransferCrosschainOutput]) ft = crosschainOutputs(2).asInstanceOf[MainchainTxForwardTransferCrosschainOutput] assertEquals("Forward Transfer type is different.", MainchainTxForwardTransferCrosschainOutput.OUTPUT_TYPE, ft.outputType) - assertEquals("Forward Transfer hash is different.","49ff23977ef4db4b281e0957637b4d4bf30757d7be158b4b01124e57baca6790", BytesUtils.toHexString(ft.hash)) + assertEquals("Forward Transfer hash is different.","7574bd15af83a6927295a73992e13b42b233f3d417d7f91bfc8fc13a1a1aa542", BytesUtils.toHexString(ft.hash)) assertEquals("Forward Transfer sc id is different.", sidechainIdHex, BytesUtils.toHexString(ft.sidechainId)) assertEquals("Forward Transfer proposition is different.","000000000000000000000000000000000000000000000000000000000000add3", BytesUtils.toHexString(ft.propositionBytes)) - assertEquals("Forward Transfer amount is different.", 303000000L, ft.amount) + assertEquals("Forward Transfer amount is different.", 1200000000L, ft.amount) } - @Ignore @Test def tx_vminus4_sc_creation(): Unit = { val hex : String = Source.fromResource("mctx_v-4_sc_creation").getLines().next() val bytes: Array[Byte] = BytesUtils.fromHexString(hex) val tx: MainchainTransaction = MainchainTransaction.create(bytes, 0).get - val sidechainIdHex: String = "0000000000000000000000000000000000000000000000000000000000000001" + val sidechainIdHex: String = "053c9d27845378108eed154e262cbb63843fd3cb3bf3ca76f159acd185617976" val sidechainId: ByteArrayWrapper = new ByteArrayWrapper(BytesUtils.fromHexString(sidechainIdHex)) + val expectedTxHash: String = "3595e7cdcd45fa8c335b7cd9d71ce8d8324a1aa0ba6f298ce328e304975e8bf8" + val expectedTxSize: Int = 2696 + val expectedAmount: Long = 5000000000L // 50 Zen + val expectedWithdrawalEpochLength: Int = 1000 - assertEquals("Tx Hash is different.", "58eb814ae329d6b9b870204f829d6b4eb3def00fe3f4738b9f573c6cf79399a8", tx.hashHex) - assertEquals("Tx Size is different.", 1088, tx.size) + assertEquals("Tx Hash is different.", expectedTxHash, tx.hashHex) + assertEquals("Tx Size is different.", expectedTxSize, tx.size) assertEquals("Tx contains different number of mentioned sidechains.", 1, tx.getRelatedSidechains.size) - assertTrue(s"SidechainId '${sidechainIdHex}' is missed.", + assertTrue(s"SidechainId '$sidechainIdHex' is missed.", tx.getRelatedSidechains.contains(sidechainId)) val crosschainOutputs: Seq[MainchainTxCrosschainOutput] = tx.getCrosschainOutputs(sidechainId) - assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '${sidechainIdHex}'.", 1, crosschainOutputs.size) + assertEquals(s"Tx expected to have different number of crosschain outputs related to sidechainId '$sidechainIdHex'.", 1, crosschainOutputs.size) assertTrue("Crosschain output type is different.", crosschainOutputs.head.isInstanceOf[MainchainTxSidechainCreationCrosschainOutput]) val creation: MainchainTxSidechainCreationCrosschainOutput = crosschainOutputs.head.asInstanceOf[MainchainTxSidechainCreationCrosschainOutput] assertEquals("Sidechain creation type is different.", MainchainTxSidechainCreationCrosschainOutput.OUTPUT_TYPE, creation.outputType) - assertEquals("Sidechain creation hash is different.","c29dd4369c4d5ab2ed7421a0c8be795168065cc867ce02857f6495069968443c", BytesUtils.toHexString(creation.hash)) + assertEquals("Sidechain creation hash is different.","8c77365c2f72d34a17e18050c28716a5a8951767cb0c2d81032690c7eaca6731", BytesUtils.toHexString(creation.hash)) assertEquals("Sidechain creation sc id is different.", sidechainIdHex, BytesUtils.toHexString(creation.sidechainId)) - assertEquals("Sidechain creation withdrawal epoch length is different.", 1000, creation.withdrawalEpochLength) - assertEquals("Sidechain creation amount is different.", 5000000000L, creation.amount) - assertEquals("Sidechain creation address is different.", "a4465fd76c16fcc458448076372abf1912cc5b150663a64dffefe550f96feadd", + assertEquals("Sidechain creation withdrawal epoch length is different.", expectedWithdrawalEpochLength, creation.withdrawalEpochLength) + assertEquals("Sidechain creation amount is different.", expectedAmount, creation.amount) + assertEquals("Sidechain creation address is different.", "a5b10622d70f094b7276e04608d97c7c699c8700164f78e16fe5e8082f4bb2ac", BytesUtils.toHexString(creation.address)) - assertEquals("Sidechain creation custom data is different.", "3c158597376bccf305f7a363f7ba2b04e91e393eaedaa95a5e6284cd3607b58014a631e9e955dbdb2352a5b679e2d1269abeb59f81ef815d93280d8b46630b625f64e7c83e366c2bbd483ed0134322168ae8a6e1e0dd3d7f99ea038fe3df00003c29f7bdb83189a56e3ede091575f278b00d2754a842e0df517b8067304eada8b4bd31b3a51b4aa5365ebd35496102e8fb131684cb539d795f3b2624f84e0d82dc810075618c7b8259280ce14d8b03681ecc01fc69bb7bf0985b98140d06010000", + assertEquals("Sidechain creation custom data is different.", "2df6c69c3b5d7636512eea9241ebaf0138179ed2b4a3a9d3e06c24d99d5c04712ff31a8cd55bd4b347c39081143031087b28d4c46f31e07eda35256699697e94fcdc95c99855231a0bc499d5e760de37a682a728e34e5ab07a8fdac4b2120100e3eb23a3a2222cc636896601b94697cda1cf6e4df9dfe74db44c90f7d15d1b722f93dd6c754e3bddf80baa2961503ec64c4b3979e558fe3293f88d3031cfd079b325a6db009ca77088aaa55f237e517b4579d2bacf99fade605eab96f636010000", BytesUtils.toHexString(creation.customData)) } } diff --git a/sdk/src/test/scala/com/horizen/websocket/WebSocketChannelImplTest.scala b/sdk/src/test/scala/com/horizen/websocket/WebSocketChannelImplTest.scala index 809d1d5486..d7767516ac 100644 --- a/sdk/src/test/scala/com/horizen/websocket/WebSocketChannelImplTest.scala +++ b/sdk/src/test/scala/com/horizen/websocket/WebSocketChannelImplTest.scala @@ -16,12 +16,15 @@ import scala.concurrent.duration._ class WebSocketChannelImplTest extends JUnitSuite with MockitoSugar { private val serverHost = "localhost" - private val serverPort = 8999 + private var serverPort: Int = _ private var server: Server = _ @Before def setUp(): Unit = { - server = new Server(serverHost, serverPort, null, null, classOf[WebSocketServerEchoEndpoint]) + // start server on available port + server = new Server(serverHost, 0, null, null, classOf[WebSocketServerEchoEndpoint]) + // get real port value + serverPort = server.getPort } @Test @@ -648,13 +651,14 @@ class WebSocketChannelImplTest extends JUnitSuite with MockitoSugar { val mockedWebSocketMessageHandler: WebSocketMessageHandler = mock[WebSocketMessageHandler] val pushServerHost = "localhost" - val pushServerPort = 8999 - var pushServer: Server = new Server(pushServerHost, pushServerPort, null, null, classOf[WebSocketServerPushEndpoint]) + + var pushServer: Server = new Server(pushServerHost, 0, null, null, classOf[WebSocketServerPushEndpoint]) + val pushServerPort = pushServer.getPort pushServer.start() val conf = new WebSocketSettings( - address = "ws://" + serverHost + ":" + serverPort, + address = "ws://" + pushServerHost + ":" + pushServerPort, connectionTimeout = 10 milliseconds, reconnectionDelay = 0 seconds, reconnectionMaxAttempts = 2, From 325e03721ba6da62db5e1e3dd3406dfb94cbe397 Mon Sep 17 00:00:00 2001 From: Oleksandr Iozhytsia Date: Mon, 28 Sep 2020 17:29:02 +0300 Subject: [PATCH 2/2] Version updated to 0.2.5 --- examples/simpleapp/README.md | 4 ++-- examples/simpleapp/mc_sc_workflow_example.md | 6 +++--- examples/simpleapp/pom.xml | 4 ++-- pom.xml | 2 +- qa/SidechainTestFramework/sc_test_framework.py | 2 +- qa/SidechainTestFramework/scutil.py | 4 ++-- sdk/pom.xml | 2 +- tools/sctool/pom.xml | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/simpleapp/README.md b/examples/simpleapp/README.md index c8b8ceb644..393ff1d307 100644 --- a/examples/simpleapp/README.md +++ b/examples/simpleapp/README.md @@ -19,12 +19,12 @@ Otherwise, to run SimpleApp outside the IDE: * (Windows) ``` cd Sidechains-SDK\examples\simpleapp - java -cp ./target/sidechains-sdk-simpleapp-0.2.4.jar;./target/lib/* com.horizen.examples.SimpleApp + java -cp ./target/sidechains-sdk-simpleapp-0.2.5.jar;./target/lib/* com.horizen.examples.SimpleApp ``` * (Linux) ``` cd ./Sidechains-SDK/examples/simpleapp - java -cp ./target/sidechains-sdk-simpleapp-0.2.4.jar:./target/lib/* com.horizen.examples.SimpleApp + java -cp ./target/sidechains-sdk-simpleapp-0.2.5.jar:./target/lib/* com.horizen.examples.SimpleApp ``` On some Linux OSs during backward transfers certificates proofs generation a extremely big RAM consumption may happen, that will lead to the process force killing by the OS. While we keep monitoring the memory footprint of the proofs generation process, we have verified that setting the glibc per-thread cache with the following command 'export GLIBC_TUNABLES=glibc.malloc.tcache_count=0' just before starting the sidechain node in order keeps the memory consumption in check. diff --git a/examples/simpleapp/mc_sc_workflow_example.md b/examples/simpleapp/mc_sc_workflow_example.md index 6dcf37b2d9..c27869a883 100644 --- a/examples/simpleapp/mc_sc_workflow_example.md +++ b/examples/simpleapp/mc_sc_workflow_example.md @@ -15,7 +15,7 @@ Build SDK components by using command (in the root of the SDK folder): Run Bootstrapping tool using command: -`java -jar tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.2.4.jar` +`java -jar tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.2.5.jar` All other command are performed as commands for Bootstrapping tool in next format: `"command name" "parameters for command in JSON format"`. For any help you could use command `help`, for exit just print `exit` @@ -280,9 +280,9 @@ Run SimpleApp with the `my_settings.conf`: * For Windows: ``` - java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.4.jar;./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/simpleapp/src/main/resources/my_settings.conf + java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.5.jar;./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/simpleapp/src/main/resources/my_settings.conf ``` * For Linux: ``` - java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.4.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/simpleapp/src/main/resources/my_settings.conf + java -cp ./examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.5.jar:./examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp ./examples/simpleapp/src/main/resources/my_settings.conf ``` diff --git a/examples/simpleapp/pom.xml b/examples/simpleapp/pom.xml index 8cecdcb73c..d973d545b4 100644 --- a/examples/simpleapp/pom.xml +++ b/examples/simpleapp/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.horizen sidechains-sdk-simpleapp - 0.2.4 + 0.2.5 2018 UTF-8 @@ -16,7 +16,7 @@ io.horizen sidechains-sdk - 0.2.4 + 0.2.5 diff --git a/pom.xml b/pom.xml index 077f674a1e..e5e73906ad 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.horizen Sidechains - 0.2.4 + 0.2.5 2018 UTF-8 diff --git a/qa/SidechainTestFramework/sc_test_framework.py b/qa/SidechainTestFramework/sc_test_framework.py index 1cfcc11e4a..d85b24aa49 100644 --- a/qa/SidechainTestFramework/sc_test_framework.py +++ b/qa/SidechainTestFramework/sc_test_framework.py @@ -111,7 +111,7 @@ def main(self): help="Don't stop bitcoinds after the test execution") parser.add_option("--zendir", dest="zendir", default="ZenCore/src", help="Source directory containing zend/zen-cli (default: %default)") - parser.add_option("--scjarpath", dest="scjarpath", default="../examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.4.jar;../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp", #New option. Main class path won't be needed in future + parser.add_option("--scjarpath", dest="scjarpath", default="../examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.5.jar;../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp", #New option. Main class path won't be needed in future help="Directory containing .jar file for SC (default: %default)") parser.add_option("--tmpdir", dest="tmpdir", default="../examples/simpleapp/target/tmp", help="Root directory for datadirs") diff --git a/qa/SidechainTestFramework/scutil.py b/qa/SidechainTestFramework/scutil.py index d4b77ee0d1..32456075dc 100644 --- a/qa/SidechainTestFramework/scutil.py +++ b/qa/SidechainTestFramework/scutil.py @@ -98,7 +98,7 @@ def sync_sc_mempools(api_connections, wait_for=25): def launch_bootstrap_tool(command_name, json_parameters): json_param = json.dumps(json_parameters) java_ps = subprocess.Popen(["java", "-jar", - "../tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.2.4.jar", + "../tools/sctool/target/sidechains-sdk-scbootstrappingtools-0.2.5.jar", command_name, json_param], stdout=subprocess.PIPE) sc_bootstrap_output = java_ps.communicate()[0] jsone_node = json.loads(sc_bootstrap_output) @@ -342,7 +342,7 @@ def start_sc_node(i, dirname, extra_args=None, rpchost=None, timewait=None, bina lib_separator = ";" if binary is None: - binary = "../examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.4.jar" + lib_separator + "../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp" + binary = "../examples/simpleapp/target/sidechains-sdk-simpleapp-0.2.5.jar" + lib_separator + "../examples/simpleapp/target/lib/* com.horizen.examples.SimpleApp" # else if platform.system() == 'Linux': bashcmd = 'java -cp ' + binary + " " + (datadir + ('/node%s.conf' % i)) sidechainclient_processes[i] = subprocess.Popen(bashcmd.split()) diff --git a/sdk/pom.xml b/sdk/pom.xml index 78d6845a91..ca3364f3a1 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.horizen sidechains-sdk - 0.2.4 + 0.2.5 ${project.groupId}:${project.artifactId} Zendoo is a unique sidechain and scaling solution developed by Horizen. The Zendoo ${project.artifactId} is a framework that supports the creation of sidechains and their custom business logic, with the Horizen public blockchain as the mainchain. https://github.com/${project.github.organization}/${project.artifactId} diff --git a/tools/sctool/pom.xml b/tools/sctool/pom.xml index 5d9fdc03d0..f99902a10d 100644 --- a/tools/sctool/pom.xml +++ b/tools/sctool/pom.xml @@ -2,7 +2,7 @@ 4.0.0 io.horizen sidechains-sdk-scbootstrappingtools - 0.2.4 + 0.2.5 2018 UTF-8 @@ -16,7 +16,7 @@ io.horizen sidechains-sdk - 0.2.4 + 0.2.5