aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-08-04 23:53:00 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-08-10 09:50:53 -0300
commit5364dd8666ae1afa35536f9b4fc0170eeaf37888 (patch)
tree17f77bb2f64bfa2c9f5d8b7b60614bd784745014 /test
parentbe443328037162f265cc85d05b1a7665b5f104d2 (diff)
test: locked_wallet, skip default fee estimation
Same as we do with the nodes default wallets. No test case on this file is meant to exercise fee estimation.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/wallet_fundrawtransaction.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/functional/wallet_fundrawtransaction.py b/test/functional/wallet_fundrawtransaction.py
index e367daae2c..fa4f009f34 100755
--- a/test/functional/wallet_fundrawtransaction.py
+++ b/test/functional/wallet_fundrawtransaction.py
@@ -23,6 +23,7 @@ from test_framework.util import (
assert_raises_rpc_error,
count_bytes,
find_vout_for_address,
+ get_fee,
)
from test_framework.wallet_util import generate_keypair
@@ -570,6 +571,8 @@ class RawTransactionsTest(BitcoinTestFramework):
df_wallet = self.nodes[1].get_wallet_rpc(self.default_wallet_name)
self.nodes[1].createwallet(wallet_name="locked_wallet", descriptors=self.options.descriptors)
wallet = self.nodes[1].get_wallet_rpc("locked_wallet")
+ # This test is not meant to exercise fee estimation. Making sure all txs are sent at a consistent fee rate.
+ wallet.settxfee(self.min_relay_tx_fee)
# Add some balance to the wallet (this will be reverted at the end of the test)
df_wallet.sendall(recipients=[wallet.getnewaddress()])
@@ -599,8 +602,11 @@ class RawTransactionsTest(BitcoinTestFramework):
# Choose input
inputs = wallet.listunspent()
- # Deduce fee to produce a changeless transaction
- value = inputs[0]["amount"] - Decimal("0.00002200")
+
+ # Deduce exact fee to produce a changeless transaction
+ tx_size = 110 # Total tx size: 110 vbytes, p2wpkh -> p2wpkh. Input 68 vbytes + rest of tx is 42 vbytes.
+ value = inputs[0]["amount"] - get_fee(tx_size, self.min_relay_tx_fee)
+
outputs = {self.nodes[0].getnewaddress():value}
rawtx = wallet.createrawtransaction(inputs, outputs)
# fund a transaction that does not require a new key for the change output