mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
added explicit 'valuecommitment' checking of gettxout with getrawtransaction rpcs
This commit is contained in:
parent
4a671e2958
commit
8fed03f63c
1 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue