Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_hd.py
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Send a transaction to addr, which is out of the initial keypool. | # Send a transaction to addr, which is out of the initial keypool. | ||||
# The wallet that has set a new seed (restore_rpc) should not | # The wallet that has set a new seed (restore_rpc) should not | ||||
# detect this transaction. | # detect this transaction. | ||||
txid = self.nodes[0].sendtoaddress(addr, 1) | txid = self.nodes[0].sendtoaddress(addr, 1) | ||||
origin_rpc.sendrawtransaction( | origin_rpc.sendrawtransaction( | ||||
self.nodes[0].gettransaction(txid)['hex']) | self.nodes[0].gettransaction(txid)['hex']) | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
self.sync_blocks() | |||||
origin_rpc.gettransaction(txid) | origin_rpc.gettransaction(txid) | ||||
assert_raises_rpc_error(-5, | assert_raises_rpc_error(-5, | ||||
'Invalid or non-wallet transaction id', | 'Invalid or non-wallet transaction id', | ||||
restore_rpc.gettransaction, | restore_rpc.gettransaction, | ||||
txid) | txid) | ||||
out_of_kp_txid = txid | out_of_kp_txid = txid | ||||
# Send a transaction to last_addr, which is in the initial keypool. | # Send a transaction to last_addr, which is in the initial keypool. | ||||
# The wallet that has set a new seed (restore_rpc) should detect this | # The wallet that has set a new seed (restore_rpc) should detect this | ||||
# transaction and generate 3 new keys from the initial seed. | # transaction and generate 3 new keys from the initial seed. | ||||
# The previous transaction (out_of_kp_txid) should still not be | # The previous transaction (out_of_kp_txid) should still not be | ||||
# detected as a rescan is required. | # detected as a rescan is required. | ||||
txid = self.nodes[0].sendtoaddress(last_addr, 1) | txid = self.nodes[0].sendtoaddress(last_addr, 1) | ||||
origin_rpc.sendrawtransaction( | origin_rpc.sendrawtransaction( | ||||
self.nodes[0].gettransaction(txid)['hex']) | self.nodes[0].gettransaction(txid)['hex']) | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
self.sync_blocks() | |||||
origin_rpc.gettransaction(txid) | origin_rpc.gettransaction(txid) | ||||
restore_rpc.gettransaction(txid) | restore_rpc.gettransaction(txid) | ||||
assert_raises_rpc_error(-5, | assert_raises_rpc_error(-5, | ||||
'Invalid or non-wallet transaction id', | 'Invalid or non-wallet transaction id', | ||||
restore_rpc.gettransaction, | restore_rpc.gettransaction, | ||||
out_of_kp_txid) | out_of_kp_txid) | ||||
restore2_rpc.gettransaction(txid) | restore2_rpc.gettransaction(txid) | ||||
assert_raises_rpc_error(-5, | assert_raises_rpc_error(-5, | ||||
Show All 36 Lines |