RPC test for immature balance

This commit is contained in:
Jonas Schnelli 2014-12-25 08:57:16 +01:00 committed by Gregory Maxwell
parent 8024d67dae
commit 12d927a391

View file

@ -41,6 +41,10 @@ class WalletTest (BitcoinTestFramework):
self.nodes[0].setgenerate(True, 1) self.nodes[0].setgenerate(True, 1)
walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 50)
assert_equal(walletinfo['balance'], 0)
self.sync_all() self.sync_all()
self.nodes[1].setgenerate(True, 101) self.nodes[1].setgenerate(True, 101)
self.sync_all() self.sync_all()
@ -54,6 +58,9 @@ class WalletTest (BitcoinTestFramework):
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11) self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10) self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
walletinfo = self.nodes[0].getwalletinfo()
assert_equal(walletinfo['immature_balance'], 0)
# Have node0 mine a block, thus he will collect his own fee. # Have node0 mine a block, thus he will collect his own fee.
self.nodes[0].setgenerate(True, 1) self.nodes[0].setgenerate(True, 1)
self.sync_all() self.sync_all()