Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 829 Lines • ▼ Show 20 Lines | def test_option_subtract_fee_from_outputs(self): | ||||
assert_greater_than(share[3], 0) | assert_greater_than(share[3], 0) | ||||
# Outputs 2 and 3 take the same share of the fee. | # Outputs 2 and 3 take the same share of the fee. | ||||
assert_equal(share[2], share[3]) | assert_equal(share[2], share[3]) | ||||
# Output 0 takes at least as much share of the fee, and no more than 2 | # Output 0 takes at least as much share of the fee, and no more than 2 | ||||
# satoshis more, than outputs 2 and 3. | # satoshis more, than outputs 2 and 3. | ||||
assert_greater_than_or_equal(share[0], share[2]) | assert_greater_than_or_equal(share[0], share[2]) | ||||
assert_greater_than_or_equal(share[2] + Decimal(2e-8), share[0]) | assert_greater_than_or_equal(share[2] + Decimal("2e-8"), share[0]) | ||||
# The fee is the same in both transactions. | # The fee is the same in both transactions. | ||||
assert_equal(result[0]['fee'], result[1]['fee']) | assert_equal(result[0]['fee'], result[1]['fee']) | ||||
# The total subtracted from the outputs is equal to the fee. | # The total subtracted from the outputs is equal to the fee. | ||||
assert_equal(share[0] + share[2] + share[3], result[0]['fee']) | assert_equal(share[0] + share[2] + share[3], result[0]['fee']) | ||||
def test_subtract_fee_with_presets(self): | def test_subtract_fee_with_presets(self): | ||||
Show All 17 Lines |