Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_listtransactions.py
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
{"txid": txid, "account": "from1"}) | {"txid": txid, "account": "from1"}) | ||||
assert_array_result(self.nodes[1].listtransactions(), | assert_array_result(self.nodes[1].listtransactions(), | ||||
{"category": "send", "amount": Decimal("-0.44")}, | {"category": "send", "amount": Decimal("-0.44")}, | ||||
{"txid": txid, "account": ""}) | {"txid": txid, "account": ""}) | ||||
assert_array_result(self.nodes[1].listtransactions(), | assert_array_result(self.nodes[1].listtransactions(), | ||||
{"category": "receive", "amount": Decimal("0.44")}, | {"category": "receive", "amount": Decimal("0.44")}, | ||||
{"txid": txid, "account": "toself"}) | {"txid": txid, "account": "toself"}) | ||||
multisig = self.nodes[1].createmultisig( | pubkey = self.nodes[1].validateaddress( | ||||
1, [self.nodes[1].getnewaddress()]) | self.nodes[1].getnewaddress())['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( | assert( | ||||
len(self.nodes[0].listtransactions("watchonly", 100, 0, False)) == 0) | len(self.nodes[0].listtransactions("watchonly", 100, 0, False)) == 0) | ||||
assert_array_result( | assert_array_result( | ||||
self.nodes[0].listtransactions("watchonly", 100, 0, True), | self.nodes[0].listtransactions("watchonly", 100, 0, True), | ||||
{"category": "receive", "amount": Decimal("0.1")}, | {"category": "receive", "amount": Decimal("0.1")}, | ||||
{"txid": txid, "account": "watchonly"}) | {"txid": txid, "account": "watchonly"}) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
ListTransactionsTest().main() | ListTransactionsTest().main() |