diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7ab0718b8..572bd38e3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ All notable changes to this project are documented in this file. - Allow override of test invocation return type - Add current wallet height to bottom toolbar - Change class attributes of ``Transaction`` into instance attributes and fix constructor +- Fix sys_fee calculation in block persist. - Improve testing of "getbalance" RPC method - Support cancelling actions with ``KeyboardInterrupt`` - Enhance output of `wallet` cli command diff --git a/neo/Core/State/StateDescriptor.py b/neo/Core/State/StateDescriptor.py index 7d22a61a4..91b213e22 100644 --- a/neo/Core/State/StateDescriptor.py +++ b/neo/Core/State/StateDescriptor.py @@ -22,10 +22,10 @@ class StateDescriptor(SerializableMixin): @property def SystemFee(self): - if self.Type == StateType.Account: - return Fixed8.Zero() - elif self.Type == StateType.Validator: + if self.Type == StateType.Validator: return self.GetSystemFee_Validator() + else: + return Fixed8.Zero() def Size(self): """ diff --git a/neo/Core/TX/StateTransaction.py b/neo/Core/TX/StateTransaction.py index 4f11b8e88..c38c8175b 100644 --- a/neo/Core/TX/StateTransaction.py +++ b/neo/Core/TX/StateTransaction.py @@ -28,15 +28,6 @@ def __init__(self, *args, **kwargs): self.Type = TransactionType.StateTransaction - def NetworkFee(self): - """ - Get the network fee for a claim transaction. - - Returns: - Fixed8: currently fixed to 0. - """ - return Fixed8(0) - def SystemFee(self): amount = Fixed8.Zero() for d in self.Descriptors: diff --git a/neo/Core/TX/Transaction.py b/neo/Core/TX/Transaction.py index f93c26de5..c837d7605 100644 --- a/neo/Core/TX/Transaction.py +++ b/neo/Core/TX/Transaction.py @@ -245,7 +245,7 @@ def __init__(self, inputs=None, outputs=None, attributes=None, scripts=None): self.Attributes = [] if attributes is None else attributes self.scripts = [] if scripts is None else scripts self.InventoryType = 0x01 # InventoryType TX 0x01 - self.__references = None + self._references = None self.Type = None self.raw_tx = False self.withdraw_hold = None @@ -297,7 +297,7 @@ def getAllInputs(self): def ResetReferences(self): """Reset local stored references.""" - self.__references = None + self._references = None def ResetHashData(self): """Reset local stored hash data.""" @@ -323,7 +323,7 @@ def References(self): Key (UInt256): input PrevHash Value (TransactionOutput): object. """ - if self.__references is None: + if self._references is None: refs = {} @@ -335,9 +335,9 @@ def References(self): for input in group: refs[input] = tx.outputs[input.PrevIndex] - self.__references = refs + self._references = refs - return self.__references + return self._references def Size(self): """ diff --git a/neo/Core/TX/test_transactions.py b/neo/Core/TX/test_transactions.py index c8ce5b208..af9072ec9 100644 --- a/neo/Core/TX/test_transactions.py +++ b/neo/Core/TX/test_transactions.py @@ -183,7 +183,7 @@ def test_issue_tx(self): self.assertEqual(json['sys_fee'], "0") self.assertEqual(json['net_fee'], "0") self.assertEqual(json['scripts'][0]['invocation'], "") - self.assertEqual(json['scripts'][0]['verification'], "51") + self.assertEqual(json['scripts'][0]['verification'], "51") cr = b'800001f012e99481e4bb93e59088e7baa6e6b58be8af9502f8e0bc69b6af579e69a56d3d3d559759cdb848cb55b54531afc6e3322c85badf08002c82c09c5b49d10cd776c8679789ba98d0b0236f0db4dc67695a1eb920a646b9000001cd5e195b9235a31b7423af5e6937a660f7e7e62524710110b847bab41721090c0061c2540cd1220067f97110a66136d38badc7b9f88eab013027ce490241400bd2e921cee90c8de1a192e61e33eb8980a3dc00c388ee9aac0712178cc8fceed8bb59788f7caf3c4dc082abcdaaa49772fda86db4ceea243bda31bcde9b8a0b3c21034b44ed9c8a88fb2497b6b57206cc08edd42c5614bd1fee790e5b795dee0f4e1104182f145967cc4ee2f1c9f4e0782756dabf246d0a4fe60a035441402fe3e20c303e26c3817fed6fc7db8edde4ac62b16eee796c01c2b59e382b7ddfc82f0b36c7f7520821c7b72b9aff50ae27a016961f1ef1dade9cafa85655380f2321034b44ed9c8a88fb2497b6b57206cc08edd42c5614bd1fee790e5b795dee0f4e11ac' cr2 = b'800001f012e99481e4bb93e59088e7baa6e6b58be8af9502f8e0bc69b6af579e69a56d3d3d559759cdb848cb55b54531afc6e3322c85badf08002c82c09c5b49d10cd776c8679789ba98d0b0236f0db4dc67695a1eb920a646b9000001cd5e195b9235a31b7423af5e6937a660f7e7e62524710110b847bab41721090c0061c2540cd1220067f97110a66136d38badc7b9f88eab013027ce49' @@ -275,10 +275,19 @@ def test_state_tx(self): reader = BinaryReader(ms) tx = Transaction.DeserializeFrom(reader) + + # the net_fee calculation in short is : net_fee = inputs - outputs -system fee. + # For this test to be able to grab the input values we need to make the TX that it references available for this test + ms2 = MemoryStream(binascii.unhexlify( + b'80000001def3ab1c73a13e80fea34ca751c79fe8dcf68d93d91d4956818baf0b99d95818010002e72d286979ee6cb1b7e65dfddfb2e384100b8d148e7758de42e4168b71792c6000e8764817000000faaa0f339e0fb33f91697cbf5aac41d17921222ae72d286979ee6cb1b7e65dfddfb2e384100b8d148e7758de42e4168b71792c60008997b2270000002d9a070d388aa24d9f639bc8ddf985dc473c75d70141401a07d186fdfe3f9862c873d7cd9bdcb9cc8b3f5edcf853af31addcc4476d7d4fe89385cc955a4f604c667110332c14cb2fd8f62a29569b01a572774c7f7136572321026aeca2aed2094e9622a44cf584c694554f10cdb84d4f8eeab3e28ead4e87c168ac')) + reader2 = BinaryReader(ms2) + vout_tx = Transaction.DeserializeFrom(reader2) + self.assertEqual(tx.ToArray(), self.sttx) self.assertEqual(tx.Hash.ToBytes(), self.sttx_id) - json = tx.ToJson() + with patch('neo.Core.Blockchain.Blockchain.GetTransaction', return_value=(vout_tx, 0)): + json = tx.ToJson() self.assertEqual(json['size'], 191) self.assertEqual(json['type'], "StateTransaction") self.assertEqual(json['version'], 0) diff --git a/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py b/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py index 19dbb2e3a..e75c4b709 100644 --- a/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py +++ b/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py @@ -1,5 +1,6 @@ import plyvel import binascii +import struct from neo.Core.Blockchain import Blockchain from neo.Core.Header import Header from neo.Core.Block import Block @@ -514,7 +515,7 @@ def GetSysFeeAmount(self, hash): hash = hash.ToBytes() try: value = self._db.get(DBPrefix.DATA_Block + hash)[0:8] - amount = int.from_bytes(value, 'little', signed=False) + amount = struct.unpack(" ", is_password=True) except KeyboardInterrupt: - print("Splitting cancelled") - return + print("Splitting cancelled") + return if not wallet.ValidatePassword(passwd): print("incorrect password") return diff --git a/neo/Prompt/Commands/tests/test_claim_command.py b/neo/Prompt/Commands/tests/test_claim_command.py index fc4ff2d92..a9b5eb38c 100644 --- a/neo/Prompt/Commands/tests/test_claim_command.py +++ b/neo/Prompt/Commands/tests/test_claim_command.py @@ -73,7 +73,7 @@ def test_1_no_available_claim(self): unavailable_bonus = wallet.GetUnavailableBonus() - self.assertEqual(Fixed8.FromDecimal(0.0002685), unavailable_bonus) + self.assertEqual(Fixed8.FromDecimal(0.00028250).value, unavailable_bonus.value) unclaimed_coins = wallet.GetUnclaimedCoins() @@ -93,7 +93,7 @@ def test_2_wallet_with_claimable_gas(self): unavailable_bonus = wallet.GetUnavailableBonus() - self.assertEqual(Fixed8.FromDecimal(0.000601), unavailable_bonus) + self.assertEqual(Fixed8.FromDecimal(0.000629).value, unavailable_bonus.value) unclaimed_coins = wallet.GetUnclaimedCoins() @@ -101,7 +101,7 @@ def test_2_wallet_with_claimable_gas(self): available_bonus = wallet.GetAvailableClaimTotal() - self.assertEqual(Fixed8.FromDecimal(0.000288), available_bonus) + self.assertEqual(Fixed8.FromDecimal(0.000288).value, available_bonus.value) def test_3_wallet_no_claimable_gas(self): diff --git a/neo/Prompt/Commands/tests/test_send_commands.py b/neo/Prompt/Commands/tests/test_send_commands.py index 6ddbe44ca..5843d7148 100644 --- a/neo/Prompt/Commands/tests/test_send_commands.py +++ b/neo/Prompt/Commands/tests/test_send_commands.py @@ -214,6 +214,7 @@ def test_send_token_ok(self): mock_print.getvalue()) def test_insufficient_funds(self): + with patch('sys.stdout', new=StringIO()) as mock_print: PromptData.Wallet = self.GetWallet1(recreate=True) args = ['send', 'gas', self.watch_addr_str, '72620'] @@ -232,7 +233,8 @@ def test_transaction_size_1(self): res = Wallet.CommandWallet().execute(args) self.assertFalse(res) - self.assertIn('Transaction cancelled. The tx size (1026) exceeds the max free tx size (1024).\nA network fee of 0.001 GAS is required.', mock_print.getvalue()) # notice the required fee is equal to the low priority threshold + self.assertIn('Transaction cancelled. The tx size (1026) exceeds the max free tx size (1024).\nA network fee of 0.001 GAS is required.', + mock_print.getvalue()) # notice the required fee is equal to the low priority threshold def test_transaction_size_2(self): with patch('sys.stdout', new=StringIO()) as mock_print: @@ -243,7 +245,8 @@ def test_transaction_size_2(self): res = Wallet.CommandWallet().execute(args) self.assertFalse(res) - self.assertIn('Transaction cancelled. The tx size (1411) exceeds the max free tx size (1024).\nA network fee of 0.00387 GAS is required.', mock_print.getvalue()) # the required fee is equal to (1411-1024) * 0.0001 (FEE_PER_EXTRA_BYTE) = 0.00387 + self.assertIn('Transaction cancelled. The tx size (1411) exceeds the max free tx size (1024).\nA network fee of 0.00387 GAS is required.', + mock_print.getvalue()) # the required fee is equal to (1411-1024) * 0.0001 (FEE_PER_EXTRA_BYTE) = 0.00387 def test_bad_password(self): with patch('neo.Prompt.Commands.Send.prompt', side_effect=['blah']): diff --git a/neo/Prompt/test_utils.py b/neo/Prompt/test_utils.py index 9c5d607d8..9241c8817 100644 --- a/neo/Prompt/test_utils.py +++ b/neo/Prompt/test_utils.py @@ -16,7 +16,6 @@ class TestInputParser(TestCase): def test_utils_1(self): - args = [1, 2, 3] args, neo, gas = Utils.get_asset_attachments(args) @@ -26,7 +25,6 @@ def test_utils_1(self): self.assertIsNone(gas) def test_utils_2(self): - args = [] args, neo, gas = Utils.get_asset_attachments(args) @@ -36,14 +34,12 @@ def test_utils_2(self): self.assertIsNone(gas) def test_utils_3(self): - args = None with self.assertRaises(Exception): Utils.get_asset_attachments(args) def test_utils_4(self): - args = [1, 2, '--attach-neo=100'] args, neo, gas = Utils.get_asset_attachments(args) @@ -115,7 +111,6 @@ def test_owner_3(self): self.assertIsInstance(list(owners)[0], UInt160) def test_owner_and_assets(self): - args = [1, 2, "--owners=['APRgMZHZubii29UXF9uFa6sohrsYupNAvx','AXjaFSP23Jkbe6Pk9pPGT6NBDs1HVdqaXK',]", '--attach-neo=10'] args, owners = Utils.get_owners_from_params(args) @@ -130,7 +125,6 @@ def test_owner_and_assets(self): self.assertEqual(neo, Fixed8.FromDecimal(10)) def test_string_from_fixed8(self): - amount_str = Utils.string_from_fixed8(100234, 8) self.assertEqual(amount_str, '0.00100234') @@ -144,7 +138,6 @@ def test_string_from_fixed8(self): self.assertEqual(amount_str, '5343534002.34') def test_parse_no_address(self): - params = ['a', 'b', 'c'] params, result = Utils.get_parse_addresses(params) @@ -160,77 +153,64 @@ def test_parse_no_address(self): self.assertFalse(result) def test_gather_param(self): - with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='hello') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.String) self.assertEqual(result, 'hello') with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value=1) as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Integer) self.assertEqual(result, 1) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='1') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Integer) self.assertEqual(result, 1) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value=1.03) as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Integer) self.assertEqual(result, 1) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="bytearray(b'abc')") as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.ByteArray) self.assertEqual(result, bytearray(b'abc')) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="b'abc'") as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.ByteArray) self.assertEqual(result, bytearray(b'abc')) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="abc") as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Boolean) self.assertEqual(result, True) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value=0) as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Boolean) self.assertEqual(result, False) # test ContractParameterType.ByteArray for address input with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='AeV59NyZtgj5AMQ7vY6yhr2MRvcfFeLWSb') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.ByteArray) self.assertEqual(result, bytearray(b'\xf9\x1dkp\x85\xdb|Z\xaf\t\xf1\x9e\xee\xc1\xca<\r\xb2\xc6\xec')) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='["a","b","c"]') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Array) self.assertEqual(result, ['a', 'b', 'c']) with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='["a","b","c", [1, 3, 4], "e"]') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Array) self.assertEqual(result, ['a', 'b', 'c', [1, 3, 4], 'e']) # test ContractParameterType.Array without a closed list with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value='["a","b","c", [1, 3, 4], "e"') as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Array, do_continue=False) self.assertEqual(result, None) @@ -238,16 +218,14 @@ def test_gather_param(self): # test ContractParameterType.Array with no list with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="b'abc'") as fake_prompt: + result, abort = Utils.gather_param(0, ContractParameterType.Array, do_continue=False) - result, abort = Utils.gather_param(0, ContractParameterType.Array, do_continue=False) - - self.assertRaises(Exception, "Please provide a list") - self.assertEqual(result, None) - self.assertEqual(abort, True) + self.assertRaises(Exception, "Please provide a list") + self.assertEqual(result, None) + self.assertEqual(abort, True) # test ContractParameterType.PublicKey with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="03cbb45da6072c14761c9da545749d9cfd863f860c351066d16df480602a2024c6") as fake_prompt: - test_wallet_path = shutil.copyfile( WalletFixtureTestCase.wallet_1_path(), WalletFixtureTestCase.wallet_1_dest() @@ -272,14 +250,12 @@ def test_gather_param(self): # test ContractParameterType.PublicKey with bad public key with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="blah") as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.PublicKey) self.assertIsNone(result) self.assertTrue(abort) # test unknown ContractParameterType with mock.patch('neo.Prompt.Utils.get_input_prompt', return_value="9698b1cac6ce9cbe8517e490778525b929e01903") as fake_prompt: - result, abort = Utils.gather_param(0, ContractParameterType.Hash160, do_continue=False) self.assertRaises(Exception, "Unknown param type Hash160") diff --git a/neo/SmartContract/tests/test_smart_contract.py b/neo/SmartContract/tests/test_smart_contract.py index 6bb273eb8..f3dd0403f 100644 --- a/neo/SmartContract/tests/test_smart_contract.py +++ b/neo/SmartContract/tests/test_smart_contract.py @@ -14,7 +14,7 @@ def leveldb_testpath(cls): # test need to be updated whenever we change the fixtures def test_a_initial_setup(self): - self.assertEqual(self._blockchain.Height, 12349) + self.assertEqual(self._blockchain.Height, 12356) invb = b'000000007134e5ee56f841bb73dbff969a9ef793c05f175cd386b2f24874a54c441cc0500e6c4e19da72fd4956a28670f36d26e03fd43c1794a1d3a5ad4f738dd48b53f505c7605b992400006b76abd322b7bd0bbe48d3a3f5d10013ab9ffee489706078714f1ea201c3400df8020bf9c22cd865b43b73060be3302abbab95b5f38941ba288cd77b846c9c1edcef1ab9a108f0a2fb8180e88178d3e85e316243054e48b29ced9dde54766340d9efc4f6d78970aba6712688071b862413bd53d58620e87c951aa3eac5c2611cdfecfcf084c12cfbe6cd356ef7726b9b5e93c10b5ffa7dc6e77ae8dc8c7af09240756caac1dad30a93662f36194fe270bb2afe0a557492122027df5f95dc5b1b9d18b169a6a96795019067ba008e5d42250c23886f0807ec20f3c880b2e740d1048b532102103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e2102a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd622102b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc22103d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee69954ae0200006b76abd300000000d101de39202f726f6f742f2e6e656f707974686f6e2f436861696e732f556e6974546573742d534d2f636f6e7472616374732f73616d706c65322e70790474657374047465737404746573740474657374000102030702024c725ec56b6a00527ac46a51527ac46a52527ac46a00c3036164649c640d006a51c36a52c3936c7566616a00c3037375629c640d006a51c36a52c3946c7566616a00c3036d756c9c640d006a51c36a52c3956c7566616a00c3036469769c640d006a51c36a52c3966c7566614f6c7566006c756668134e656f2e436f6e74726163742e437265617465001a7118020000000001347fff9221a8caf429279a82906688eb78264c1a9a2791d95ee47b6e095120aa000001e72d286979ee6cb1b7e65dfddfb2e384100b8d148e7758de42e4168b71792c600080b5fc5c02000023ba2703c53263e8d6e522dc32203339dcd8eee90141405787dc8c47ba7da02668582b822bb50e1b615546a5f01826967cba603a0744a01aed6c098d809f20ec199a84269aa01ea911564effe7c1b4ad65d71f4ca995a12321031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4aac' invbh = b'ac2d9d876bb6ee5cf1d011820409180cda7594b88c94f94a110ce2f5e472294e' diff --git a/neo/Utils/BlockchainFixtureTestCase.py b/neo/Utils/BlockchainFixtureTestCase.py index ef30557a7..c5b8b5d4a 100644 --- a/neo/Utils/BlockchainFixtureTestCase.py +++ b/neo/Utils/BlockchainFixtureTestCase.py @@ -15,11 +15,11 @@ class BlockchainFixtureTestCase(NeoTestCase): - FIXTURE_REMOTE_LOC = 'https://s3.us-east-2.amazonaws.com/cityofzion/fixtures/fixtures_v8.tar.gz' - FIXTURE_FILENAME = os.path.join(settings.DATA_DIR_PATH, 'Chains/fixtures_v8.tar.gz') + FIXTURE_REMOTE_LOC = 'https://s3.us-east-2.amazonaws.com/cityofzion/fixtures/fixtures_v10.tar.gz' + FIXTURE_FILENAME = os.path.join(settings.DATA_DIR_PATH, 'Chains/fixtures_v10.tar.gz') - N_FIXTURE_REMOTE_LOC = 'https://s3.us-east-2.amazonaws.com/cityofzion/fixtures/notif_fixtures_v8.tar.gz' - N_FIXTURE_FILENAME = os.path.join(settings.DATA_DIR_PATH, 'Chains/notif_fixtures_v8.tar.gz') + N_FIXTURE_REMOTE_LOC = 'https://s3.us-east-2.amazonaws.com/cityofzion/fixtures/notif_fixtures_v10.tar.gz' + N_FIXTURE_FILENAME = os.path.join(settings.DATA_DIR_PATH, 'Chains/notif_fixtures_v10.tar.gz') N_NOTIFICATION_DB_NAME = os.path.join(settings.DATA_DIR_PATH, 'fixtures/test_notifications') _blockchain = None diff --git a/neo/Utils/fixtures/neo-test1-w.wallet b/neo/Utils/fixtures/neo-test1-w.wallet index d136a7de8..02c5741d1 100644 Binary files a/neo/Utils/fixtures/neo-test1-w.wallet and b/neo/Utils/fixtures/neo-test1-w.wallet differ diff --git a/neo/Utils/fixtures/neo-test2-w.wallet b/neo/Utils/fixtures/neo-test2-w.wallet index c88d40497..a013877af 100644 Binary files a/neo/Utils/fixtures/neo-test2-w.wallet and b/neo/Utils/fixtures/neo-test2-w.wallet differ diff --git a/neo/Utils/fixtures/neo-test3-w.wallet b/neo/Utils/fixtures/neo-test3-w.wallet index 6c24176eb..e590de972 100644 Binary files a/neo/Utils/fixtures/neo-test3-w.wallet and b/neo/Utils/fixtures/neo-test3-w.wallet differ diff --git a/neo/api/JSONRPC/test_json_rpc_api.py b/neo/api/JSONRPC/test_json_rpc_api.py index 21f57203f..73e87dd4d 100644 --- a/neo/api/JSONRPC/test_json_rpc_api.py +++ b/neo/api/JSONRPC/test_json_rpc_api.py @@ -273,7 +273,7 @@ def test_get_bestblockhash(self): req = self._gen_post_rpc_req("getbestblockhash", params=[]) mock_req = mock_post_request(json.dumps(req).encode("utf-8")) res = json.loads(self.app.home(mock_req)) - self.assertEqual(res['result'], '0x62539bdf30ff2567355efb38b1911cc07258710cfab5b50d3e32751618969bcb') + self.assertEqual(res['result'], '0x0c9f39eddd425aba7c27543a90768093a90c76a35090ef9b413027927e887811') def test_get_connectioncount(self): # make sure we have a predictable state @@ -761,7 +761,7 @@ def test_valid_multirequest(self): self.assertEqual(type(res), list) self.assertEqual(len(res), 2) - expected_raw_block = '00000000999086db552ba8f84734bddca55b25a8d3d8c5f866f941209169c38d35376e9902c78a8ae8efe7e9d46f76399a9d9449155e861d6849c110ea5f6b7d146a9a8aa4d1305b01000000bd7d9349807816a1be48d3a3f5d10013ab9ffee489706078714f1ea201c340dcbeadb300ff983f40f537ba6d63721cafda183b2cd161801ffb0f8316f100b63dbfbae665bba75fa1a954f14351f91cbf07bf90e60ff79f3e9076bcb1b512184075c25a44184ce92f7d7af1d2f22bee69374dd1bf0327f8956ede0dc23dda90106cf555fb8202fe6db9acda1d0b4fff8fdcd0404daa4b359c73017c7cdb80094640fb383c7016aae89a0a01b3c431a5625340378b95b57f4b71c4427ff1177a786b11b1c8060c075e3234afdd03790764ccd99680ea102890e359ab9050b5b32b2b8b532102103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e2102a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd622102b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc22103d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee69954ae010000bd7d934900000000' + expected_raw_block = '00000000999086db552ba8f84734bddca55b25a8d3d8c5f866f941209169c38d35376e9902c78a8ae8efe7e9d46f76399a9d9449155e861d6849c110ea5f6b7d146a9a8aa4d1305b01000000bd7d9349807816a1be48d3a3f5d10013ab9ffee489706078714f1ea201c340dcbeadb300ff983f40f537ba6d63721cafda183b2cd161801ffb0f8316f100b63dbfbae665bba75fa1a954f14351f91cbf07bf90e60ff79f3e9076bcb1b5121840665a065b967ac0bddddd1ed1b9a7c02c7c434e804e6e77d019778b74d6642423401e35dd9d8195d6896322e7ed6922c1eb8b086391b884a6acda2c34b70927f84075c25a44184ce92f7d7af1d2f22bee69374dd1bf0327f8956ede0dc23dda90106cf555fb8202fe6db9acda1d0b4fff8fdcd0404daa4b359c73017c7cdb8009468b532102103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e2102a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd622102b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc22103d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee69954ae010000bd7d934900000000' self.assertEqual(res[0]['result'], expected_raw_block) expected_verbose_hash = '0x55f745c9098d5d5bdaff9f8f32aad29c904c83d9832b48c16e677d30c7da4273' self.assertEqual(res[1]['result']['hash'], expected_verbose_hash)