Ext outputs to list

This commit is contained in:
nolash
2021-10-10 14:00:47 +02:00
parent 33f173f0c9
commit 5f126d8d59
6 changed files with 17 additions and 12 deletions

View File

@@ -39,5 +39,3 @@ class TestCICEthBase(EthTesterCase):
self.proofs = []
for i in range(3):
self.proofs.append(random.randbytes(32).hex())

View File

@@ -17,8 +17,12 @@ class TestCICEthOffline(TestCICEthBase):
def test_offline_token_index(self):
self.adapter.token_address = self.token_address
v = self.adapter.process_token_index()
self.assertEqual(self.adapter.outputs['token_index'][:8], '4420e486')
self.assertEqual(self.adapter.outputs[0], v)
self.assertEqual(self.adapter.outputs[0][:8], '4420e486')
def test_offline_address_declarator(self):
pass
if __name__ == '__main__':
unittest.main()

View File

@@ -38,7 +38,7 @@ class TestCICEthRPC(TestCICEthBase):
adapter_norpc.token_address = self.token_address
vv = adapter_norpc.process_token_index()
tx_raw = bytes.fromhex(strip_0x(adapter_norpc.outputs['token_index']))
tx_raw = bytes.fromhex(strip_0x(vv))
tx = unpack(tx_raw, self.chain_spec)
self.assertEqual(strip_0x(tx['hash']), strip_0x(v))

View File

@@ -29,7 +29,7 @@ class TestCICEthSign(TestCICEthBase):
def test_sign_token_index(self):
self.adapter.token_address = self.token_address
v = self.adapter.process_token_index()
tx_raw = bytes.fromhex(strip_0x(self.adapter.outputs['token_index']))
tx_raw = bytes.fromhex(strip_0x(self.adapter.outputs[0]))
tx = unpack(tx_raw, self.chain_spec)
self.assertEqual(strip_0x(tx['data'])[:8], '4420e486')