Browse Source

Merge #10257: [test] Add test for getmemoryinfo

d4668f3 [test] Add test for getmemoryinfo (Jimmy Song)

Tree-SHA512: f5285022504f7f3a5d85981c7c424e5cf1156167dbc4209933ea2a699b741e427f4f908f6d49435376c0e23347db24eb1129b74805cbfce5e0b4ce9e48f71fb0
0.15
Wladimir J. van der Laan 8 years ago
parent
commit
ea1fd43bb9
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
  1. 6
      test/functional/wallet.py

6
test/functional/wallet.py

@ -57,8 +57,13 @@ class WalletTest(BitcoinTestFramework):
assert_equal(len(self.nodes[2].listunspent()), 0) assert_equal(len(self.nodes[2].listunspent()), 0)
# Send 21 BTC from 0 to 2 using sendtoaddress call. # Send 21 BTC from 0 to 2 using sendtoaddress call.
# Locked memory should use at least 32 bytes to sign each transaction
self.log.info("test getmemoryinfo")
memory_before = self.nodes[0].getmemoryinfo()
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11) self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10) mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
memory_after = self.nodes[0].getmemoryinfo()
assert(memory_before['locked']['used'] + 64 <= memory_after['locked']['used'])
self.log.info("test gettxout") self.log.info("test gettxout")
# utxo spent in mempool should be visible if you exclude mempool # utxo spent in mempool should be visible if you exclude mempool
@ -78,7 +83,6 @@ class WalletTest(BitcoinTestFramework):
# but 10 will go to node2 and the rest will go to node0 # but 10 will go to node2 and the rest will go to node0
balance = self.nodes[0].getbalance() balance = self.nodes[0].getbalance()
assert_equal(set([txout1['value'], txout2['value']]), set([10, balance])) assert_equal(set([txout1['value'], txout2['value']]), set([10, balance]))
walletinfo = self.nodes[0].getwalletinfo() walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 0) assert_equal(walletinfo['immature_balance'], 0)

Loading…
Cancel
Save