Changeset View
Changeset View
Standalone View
Standalone View
test/functional/fundrawtransaction.py
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# | # | ||||
# test a fundrawtransaction with which will not get a change output # | # test a fundrawtransaction with which will not get a change output # | ||||
# | # | ||||
utx = get_unspent(self.nodes[2].listunspent(), 5) | utx = get_unspent(self.nodes[2].listunspent(), 5) | ||||
inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | inputs = [{'txid': utx['txid'], 'vout': utx['vout']}] | ||||
outputs = { | outputs = { | ||||
self.nodes[0].getnewaddress(): Decimal(5.0) - fee - feeTolerance} | self.nodes[0].getnewaddress(): satoshi_round(Decimal(5.0) - fee - feeTolerance)} | ||||
rawtx = self.nodes[2].createrawtransaction(inputs, outputs) | rawtx = self.nodes[2].createrawtransaction(inputs, outputs) | ||||
dec_tx = self.nodes[2].decoderawtransaction(rawtx) | dec_tx = self.nodes[2].decoderawtransaction(rawtx) | ||||
assert_equal(utx['txid'], dec_tx['vin'][0]['txid']) | assert_equal(utx['txid'], dec_tx['vin'][0]['txid']) | ||||
rawtxfund = self.nodes[2].fundrawtransaction(rawtx) | rawtxfund = self.nodes[2].fundrawtransaction(rawtx) | ||||
fee = rawtxfund['fee'] | fee = rawtxfund['fee'] | ||||
dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex']) | dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex']) | ||||
totalOut = 0 | totalOut = 0 | ||||
▲ Show 20 Lines • Show All 613 Lines • Show Last 20 Lines |