add rpc_misc.py, mv test getmemoryinfo, add test mallocinfo

This commit is contained in:
Adam Jonas 2019-01-31 14:45:27 -05:00
parent 4b6673d382
commit 2fa85ebd1c
3 changed files with 49 additions and 6 deletions
test/functional

View file

@ -11,7 +11,6 @@ from test_framework.util import (
assert_array_result,
assert_equal,
assert_fee_amount,
assert_greater_than,
assert_raises_rpc_error,
connect_nodes_bi,
sync_blocks,
@ -85,13 +84,8 @@ class WalletTest(BitcoinTestFramework):
assert_equal(txout['value'], 50)
# Send 21 BTC from 0 to 2 using sendtoaddress call.
# Locked memory should increase to sign transactions
self.log.info("test getmemoryinfo")
memory_before = self.nodes[0].getmemoryinfo()
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
memory_after = self.nodes[0].getmemoryinfo()
assert_greater_than(memory_after['locked']['used'], memory_before['locked']['used'])
self.log.info("test gettxout (second part)")
# utxo spent in mempool should be visible if you exclude mempool