Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_equal(output[0], output[2] + result[2]['fee']) | assert_equal(output[0], output[2] + result[2]['fee']) | ||||
assert_equal(change[0] + result[0]['fee'], change[2]) | assert_equal(change[0] + result[0]['fee'], change[2]) | ||||
assert_equal(output[3], output[4] + result[4]['fee']) | assert_equal(output[3], output[4] + result[4]['fee']) | ||||
assert_equal(change[3] + result[3]['fee'], change[4]) | assert_equal(change[3] + result[3]['fee'], change[4]) | ||||
inputs = [] | inputs = [] | ||||
outputs = { | outputs = { | ||||
self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)} | self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)} | ||||
keys = list(outputs.keys()) | |||||
rawTx = self.nodes[3].createrawtransaction(inputs, outputs) | rawTx = self.nodes[3].createrawtransaction(inputs, outputs) | ||||
result = [self.nodes[3].fundrawtransaction(rawTx), | result = [self.nodes[3].fundrawtransaction(rawTx), | ||||
# split the fee between outputs 0, 2, and 3, but not output 1 | # split the fee between outputs 0, 2, and 3, but not output 1 | ||||
self.nodes[3].fundrawtransaction(rawTx, {"subtractFeeFromOutputs": [0, 2, 3]})] | self.nodes[3].fundrawtransaction(rawTx, {"subtractFeeFromOutputs": [0, 2, 3]})] | ||||
dec_tx = [self.nodes[3].decoderawtransaction(result[0]['hex']), | dec_tx = [self.nodes[3].decoderawtransaction(result[0]['hex']), | ||||
self.nodes[3].decoderawtransaction(result[1]['hex'])] | self.nodes[3].decoderawtransaction(result[1]['hex'])] | ||||
Show All 34 Lines |