conf_target
and estimate_mode
errors with JSONRPCException: JSON integer out of range (-1)
.
conf_target
and estimate_mode
errors with JSONRPCException: JSON integer out of range (-1)
.
Issue can be reproduced with the following code:
0diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
1+++ b/test/functional/wallet_bumpfee.py
2@@ -17,7 +17,7 @@ from decimal import Decimal
3-from test_framework.messages import BIP125_SEQUENCE_NUMBER, CTransaction
4+from test_framework.messages import BIP125_SEQUENCE_NUMBER, COIN, CTransaction
5 from test_framework.test_framework import BitcoinTestFramework
6@@ -36,6 +36,8 @@ NORMAL = 0.00100000
7 TOO_HIGH = 1.00000000
8
9+BTC_MODE = "BTC/kB"
10+SAT_MODE = "sat/B"
11
12@@ -77,8 +79,8 @@ class BumpFeeTest(BitcoinTestFramework):
13 self.test_invalid_parameters(rbf_node, dest_address)
14- test_simple_bumpfee_succeeds(self, "default", rbf_node, peer_node, dest_address)
15- test_simple_bumpfee_succeeds(self, "fee_rate", rbf_node, peer_node, dest_address)
16+ for mode in ["default", "fee_rate", BTC_MODE, SAT_MODE]:
17+ test_simple_bumpfee_succeeds(self, mode, rbf_node, peer_node, dest_address)
18 test_feerate_args(self, rbf_node, peer_node, dest_address)
19@@ -132,6 +134,13 @@ def test_simple_bumpfee_succeeds(self, mode, rbf_node, peer_node, dest_address):
20 if mode == "fee_rate":
21 bumped_psbt = rbf_node.psbtbumpfee(rbfid, {"fee_rate": NORMAL})
22 bumped_tx = rbf_node.bumpfee(rbfid, {"fee_rate": NORMAL})
23+ elif mode == BTC_MODE:
24+ bumped_psbt = rbf_node.psbtbumpfee(rbfid, {"conf_target": NORMAL, "estimate_mode": BTC_MODE})
25+ bumped_tx = rbf_node.bumpfee(rbfid, {"conf_target": NORMAL, "estimate_mode": BTC_MODE})
26+ elif mode == SAT_MODE:
27+ sat_fee = NORMAL * COIN / 1000 # convert NORMAL from BTC/kB to sat/B
28+ bumped_psbt = rbf_node.psbtbumpfee(rbfid, {"conf_target": sat_fee, "estimate_mode": SAT_MODE})
29+ bumped_tx = rbf_node.bumpfee(rbfid, {"conf_target": sat_fee, "estimate_mode": SAT_MODE})
30 else:
31 bumped_psbt = rbf_node.psbtbumpfee(rbfid)
32 bumped_tx = rbf_node.bumpfee(rbfid)