Skip to content

Commit ea1fd43

Browse files
committed
Merge #10257: [test] Add test for getmemoryinfo
d4668f3 [test] Add test for getmemoryinfo (Jimmy Song) Tree-SHA512: f5285022504f7f3a5d85981c7c424e5cf1156167dbc4209933ea2a699b741e427f4f908f6d49435376c0e23347db24eb1129b74805cbfce5e0b4ce9e48f71fb0
2 parents 526e839 + d4668f3 commit ea1fd43

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/wallet.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ def run_test(self):
5757
assert_equal(len(self.nodes[2].listunspent()), 0)
5858

5959
# Send 21 BTC from 0 to 2 using sendtoaddress call.
60+
# Locked memory should use at least 32 bytes to sign each transaction
61+
self.log.info("test getmemoryinfo")
62+
memory_before = self.nodes[0].getmemoryinfo()
6063
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
6164
mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
65+
memory_after = self.nodes[0].getmemoryinfo()
66+
assert(memory_before['locked']['used'] + 64 <= memory_after['locked']['used'])
6267

6368
self.log.info("test gettxout")
6469
# utxo spent in mempool should be visible if you exclude mempool
@@ -78,7 +83,6 @@ def run_test(self):
7883
# but 10 will go to node2 and the rest will go to node0
7984
balance = self.nodes[0].getbalance()
8085
assert_equal(set([txout1['value'], txout2['value']]), set([10, balance]))
81-
8286
walletinfo = self.nodes[0].getwalletinfo()
8387
assert_equal(walletinfo['immature_balance'], 0)
8488

0 commit comments

Comments
 (0)