1
1
#!/usr/bin/env python3
2
- # Copyright (c) 2014-2018 The Bitcoin Core developers
2
+ # Copyright (c) 2014-2019 The Bitcoin Core developers
3
3
# Distributed under the MIT software license, see the accompanying
4
4
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
"""Test the wallet."""
@@ -195,7 +195,7 @@ def run_test(self):
195
195
txid = self .nodes [2 ].sendtoaddress (address , 10 , "" , "" , False )
196
196
self .nodes [2 ].generate (1 )
197
197
self .sync_all ([self .nodes [0 :3 ]])
198
- node_2_bal = self .check_fee_amount (self .nodes [2 ].getbalance (), Decimal ('84' ), fee_per_byte , self .get_vsize (self .nodes [2 ].getrawtransaction (txid )))
198
+ node_2_bal = self .check_fee_amount (self .nodes [2 ].getbalance (), Decimal ('84' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )[ 'hex' ] ))
199
199
assert_equal (self .nodes [0 ].getbalance (), Decimal ('10' ))
200
200
201
201
# Send 10 BTC with subtract fee from amount
@@ -204,14 +204,14 @@ def run_test(self):
204
204
self .sync_all ([self .nodes [0 :3 ]])
205
205
node_2_bal -= Decimal ('10' )
206
206
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
207
- node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), Decimal ('20' ), fee_per_byte , self .get_vsize (self .nodes [2 ].getrawtransaction (txid )))
207
+ node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), Decimal ('20' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )[ 'hex' ] ))
208
208
209
209
# Sendmany 10 BTC
210
210
txid = self .nodes [2 ].sendmany ('' , {address : 10 }, 0 , "" , [])
211
211
self .nodes [2 ].generate (1 )
212
212
self .sync_all ([self .nodes [0 :3 ]])
213
213
node_0_bal += Decimal ('10' )
214
- node_2_bal = self .check_fee_amount (self .nodes [2 ].getbalance (), node_2_bal - Decimal ('10' ), fee_per_byte , self .get_vsize (self .nodes [2 ].getrawtransaction (txid )))
214
+ node_2_bal = self .check_fee_amount (self .nodes [2 ].getbalance (), node_2_bal - Decimal ('10' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )[ 'hex' ] ))
215
215
assert_equal (self .nodes [0 ].getbalance (), node_0_bal )
216
216
217
217
# Sendmany 10 BTC with subtract fee from amount
@@ -220,7 +220,7 @@ def run_test(self):
220
220
self .sync_all ([self .nodes [0 :3 ]])
221
221
node_2_bal -= Decimal ('10' )
222
222
assert_equal (self .nodes [2 ].getbalance (), node_2_bal )
223
- node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), node_0_bal + Decimal ('10' ), fee_per_byte , self .get_vsize (self .nodes [2 ].getrawtransaction (txid )))
223
+ node_0_bal = self .check_fee_amount (self .nodes [0 ].getbalance (), node_0_bal + Decimal ('10' ), fee_per_byte , self .get_vsize (self .nodes [2 ].gettransaction (txid )[ 'hex' ] ))
224
224
225
225
# Test ResendWalletTransactions:
226
226
# Create a couple of transactions, then start up a fourth
@@ -481,7 +481,7 @@ def run_test(self):
481
481
self .nodes [0 ].generate (1 )
482
482
destination = self .nodes [1 ].getnewaddress ()
483
483
txid = self .nodes [0 ].sendtoaddress (destination , 0.123 )
484
- tx = self .nodes [0 ].decoderawtransaction (self .nodes [0 ].getrawtransaction (txid ))
484
+ tx = self .nodes [0 ].decoderawtransaction (self .nodes [0 ].gettransaction (txid )[ 'hex' ] )
485
485
output_addresses = [vout ['scriptPubKey' ]['addresses' ][0 ] for vout in tx ["vout" ]]
486
486
assert len (output_addresses ) > 1
487
487
for address in output_addresses :
0 commit comments