Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_timelock.py
Show All 24 Lines | def run_test(self): | ||||
self.log.info("Send to new address with locktime") | self.log.info("Send to new address with locktime") | ||||
node.send( | node.send( | ||||
outputs={address: 5_000_000}, | outputs={address: 5_000_000}, | ||||
options={"locktime": mtp_tip - 1}, | options={"locktime": mtp_tip - 1}, | ||||
) | ) | ||||
self.generate(node, 1, sync_fun=self.no_op) | self.generate(node, 1, sync_fun=self.no_op) | ||||
self.log.info( | self.log.info("Check that clock can not change finality of confirmed txs") | ||||
"Check that clock can not change finality of confirmed txs") | |||||
amount_before_ad = node.getreceivedbyaddress(address) | amount_before_ad = node.getreceivedbyaddress(address) | ||||
amount_before_lb = node.getreceivedbylabel(label) | amount_before_lb = node.getreceivedbylabel(label) | ||||
list_before_ad = node.listreceivedbyaddress(address_filter=address) | list_before_ad = node.listreceivedbyaddress(address_filter=address) | ||||
list_before_lb = node.listreceivedbylabel(include_empty=False) | list_before_lb = node.listreceivedbylabel(include_empty=False) | ||||
balance_before = node.getbalances()["mine"]["trusted"] | balance_before = node.getbalances()["mine"]["trusted"] | ||||
coin_before = node.listunspent(maxconf=1) | coin_before = node.listunspent(maxconf=1) | ||||
node.setmocktime(mtp_tip - 1) | node.setmocktime(mtp_tip - 1) | ||||
assert_equal(node.getreceivedbyaddress(address), amount_before_ad) | assert_equal(node.getreceivedbyaddress(address), amount_before_ad) | ||||
assert_equal(node.getreceivedbylabel(label), amount_before_lb) | assert_equal(node.getreceivedbylabel(label), amount_before_lb) | ||||
assert_equal( | assert_equal(node.listreceivedbyaddress(address_filter=address), list_before_ad) | ||||
node.listreceivedbyaddress( | assert_equal(node.listreceivedbylabel(include_empty=False), list_before_lb) | ||||
address_filter=address), | |||||
list_before_ad) | |||||
assert_equal( | |||||
node.listreceivedbylabel( | |||||
include_empty=False), | |||||
list_before_lb) | |||||
assert_equal(node.getbalances()["mine"]["trusted"], balance_before) | assert_equal(node.getbalances()["mine"]["trusted"], balance_before) | ||||
assert_equal(node.listunspent(maxconf=1), coin_before) | assert_equal(node.listunspent(maxconf=1), coin_before) | ||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
WalletLocktimeTest().main() | WalletLocktimeTest().main() |