added explicit 'valuecommitment' checking of gettxout with getrawtransaction rpcs

This commit is contained in:
tdudz 2017-06-15 17:50:12 -07:00 committed by Gregory Sanders
parent 4a671e2958
commit 8fed03f63c

View file

@ -74,13 +74,20 @@ class WalletTest (BitcoinTestFramework):
# Send 21 BTC from 0 to 2 using sendtoaddress call.
txid1 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
txout1v0 = self.nodes[0].gettxout(txid1, 0)
rawtx1 = self.nodes[0].getrawtransaction(txid1, 1)
valuecommit1 = rawtx1["vout"][0]["serValue"]
assert_equal(txout1v0['confirmations'], 0)
assert(not txout1v0['coinbase'])
assert_equal(valuecommit1, txout1v0['valuecommitment'])
txid2 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
txout2v0 = self.nodes[0].gettxout(txid2, 0)
rawtx2 = self.nodes[0].getrawtransaction(txid2, 1)
valuecommit2 = rawtx2["vout"][0]["serValue"]
assert_equal(txout2v0['confirmations'], 0)
assert(not txout2v0['coinbase'])
assert_equal(valuecommit2, txout2v0['valuecommitment'])
walletinfo = self.nodes[0].getwalletinfo("bitcoin")
assert_equal(walletinfo['immature_balance'], 0)