Changeset View
Changeset View
Standalone View
Standalone View
test/functional/wallet_listtransactions.py
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
pubkey = self.nodes[1].getaddressinfo( | pubkey = self.nodes[1].getaddressinfo( | ||||
self.nodes[1].getnewaddress())['pubkey'] | self.nodes[1].getnewaddress())['pubkey'] | ||||
multisig = self.nodes[1].createmultisig(1, [pubkey]) | multisig = self.nodes[1].createmultisig(1, [pubkey]) | ||||
self.nodes[0].importaddress( | self.nodes[0].importaddress( | ||||
multisig["redeemScript"], "watchonly", False, True) | multisig["redeemScript"], "watchonly", False, True) | ||||
txid = self.nodes[1].sendtoaddress(multisig["address"], 0.1) | txid = self.nodes[1].sendtoaddress(multisig["address"], 0.1) | ||||
self.nodes[1].generate(1) | self.nodes[1].generate(1) | ||||
self.sync_all() | self.sync_all() | ||||
assert not [tx for tx in self.nodes[0].listtransactions( | assert len( | ||||
dummy="*", count=100, skip=0, include_watchonly=False) if "label" in tx and tx["label"] == "watchonly"] | self.nodes[0].listtransactions( | ||||
txs = [tx for tx in self.nodes[0].listtransactions( | label="watchonly", | ||||
dummy="*", count=100, skip=0, include_watchonly=True) if "label" in tx and tx['label'] == 'watchonly'] | count=100, | ||||
assert_array_result( | include_watchonly=False)) == 0 | ||||
txs, {"category": "receive", "amount": Decimal("0.1")}, {"txid": txid}) | assert_array_result(self.nodes[0].listtransactions(label="watchonly", count=100, include_watchonly=True), | ||||
{"category": "receive", "amount": Decimal("0.1")}, | |||||
{"txid": txid, "label": "watchonly"}) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ListTransactionsTest().main() | ListTransactionsTest().main() |