Skip to content

Commit

Permalink
added explicit 'valuecommitment' checking of gettxout with getrawtran…
Browse files Browse the repository at this point in the history
…saction rpcs
  • Loading branch information
tdudz authored and instagibbs committed Jun 16, 2017
1 parent 4a671e2 commit 8fed03f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qa/rpc-tests/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ def run_test (self):
# 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)
Expand Down

0 comments on commit 8fed03f

Please sign in to comment.