mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
[qa] util: Move check_fee_amount out of wallet.py
This commit is contained in:
@@ -11,12 +11,7 @@ class WalletTest (BitcoinTestFramework):
|
||||
def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size):
|
||||
"""Return curr_balance after asserting the fee was in range"""
|
||||
fee = balance_with_fee - curr_balance
|
||||
target_fee = fee_per_byte * tx_size
|
||||
if fee < target_fee:
|
||||
raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)"%(str(fee), str(target_fee)))
|
||||
# allow the node's estimation to be at most 2 bytes off
|
||||
if fee > fee_per_byte * (tx_size + 2):
|
||||
raise AssertionError("Fee of %s BTC too high! (Should be %s BTC)"%(str(fee), str(target_fee)))
|
||||
assert_fee_amount(fee, tx_size, fee_per_byte * 1000)
|
||||
return curr_balance
|
||||
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user