Changeset View
Changeset View
Standalone View
Standalone View
test/functional/listtransactions.py
Show All 13 Lines | |||||
def txFromHex(hexstring): | def txFromHex(hexstring): | ||||
tx = CTransaction() | tx = CTransaction() | ||||
f = BytesIO(hex_str_to_bytes(hexstring)) | f = BytesIO(hex_str_to_bytes(hexstring)) | ||||
tx.deserialize(f) | tx.deserialize(f) | ||||
return tx | return tx | ||||
class ListTransactionsTest(BitcoinTestFramework): | class ListTransactionsTest(BitcoinTestFramework): | ||||
def set_test_params(self): | |||||
def __init__(self): | self.num_nodes = 2 | ||||
super().__init__() | |||||
self.num_nodes = 4 | |||||
self.setup_clean_chain = False | |||||
def setup_nodes(self): | |||||
# This test requires mocktime | |||||
self.enable_mocktime() | self.enable_mocktime() | ||||
self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir) | |||||
def run_test(self): | def run_test(self): | ||||
# Simple send, 0 to 1: | # Simple send, 0 to 1: | ||||
txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1) | txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1) | ||||
self.sync_all() | self.sync_all() | ||||
assert_array_result(self.nodes[0].listtransactions(), | assert_array_result(self.nodes[0].listtransactions(), | ||||
{"txid": txid}, | {"txid": txid}, | ||||
{"category": "send", "account": "", "amount": Decimal("-0.1"), "confirmations": 0}) | {"category": "send", "account": "", "amount": Decimal("-0.1"), "confirmations": 0}) | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |