mirror of
https://github.com/monero-project/monero
synced 2025-10-06 08:42:47 +02:00
functional_tests: check transfers list consistency in cold_signing
This commit is contained in:
@@ -131,9 +131,32 @@ class ColdSigningTest():
|
||||
res = self.hot_wallet.export_outputs()
|
||||
self.cold_wallet.import_outputs(res.outputs_data_hex)
|
||||
|
||||
# Check consistency between hot & cold transfers list, especially that one-time addresses and amounts line up
|
||||
def check_transfers_list_consistency(do_check_key_images):
|
||||
hot_transfers_list = self.hot_wallet.incoming_transfers()
|
||||
cold_transfers_list = self.cold_wallet.incoming_transfers()
|
||||
if 'transfers' not in hot_transfers_list:
|
||||
assert 'transfers' not in cold_transfers_list
|
||||
return
|
||||
hot_transfers_list = hot_transfers_list['transfers']
|
||||
cold_transfers_list = cold_transfers_list['transfers']
|
||||
assert len(hot_transfers_list) == len(cold_transfers_list)
|
||||
attributes_to_cmp = ['amount', 'subaddr_index', 'pubkey']
|
||||
if do_check_key_images:
|
||||
attributes_to_cmp.append("key_image")
|
||||
for i in range(len(hot_transfers_list)):
|
||||
for attr in attributes_to_cmp:
|
||||
hot_val = hot_transfers_list[i][attr]
|
||||
cold_val = cold_transfers_list[i][attr]
|
||||
assert hot_val == cold_val, "outputs mismatch ({}, \"{}\"): {} vs {}".format(i, attr, hot_val, cold_val)
|
||||
|
||||
check_transfers_list_consistency(False)
|
||||
|
||||
res = self.cold_wallet.export_key_images(True)
|
||||
self.hot_wallet.import_key_images(res.signed_key_images, offset = res.offset)
|
||||
|
||||
check_transfers_list_consistency(True)
|
||||
|
||||
def create_tx(self, destination_addr, piecemeal_output_export):
|
||||
daemon = Daemon()
|
||||
|
||||
|
Reference in New Issue
Block a user