Skip to content

Commit 932564b

Browse files
committed
scripted-diff: update max-fee-exceeded error message to include RPC
-BEGIN VERIFY SCRIPT- sed -i 's/Fee exceeds maximum configured by \-\maxtxfee/Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)/g' src/util/error.cpp test/functional/rpc_fundrawtransaction.py test/functional/rpc_psbt.py test/functional/rpc_rawtransaction.py test/functional/wallet_bumpfee.py test/functional/wallet_create_tx.py -END VERIFY SCRIPT-
1 parent 8f1290c commit 932564b

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/util/error.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bilingual_str TransactionErrorString(const TransactionError err)
3030
case TransactionError::SIGHASH_MISMATCH:
3131
return Untranslated("Specified sighash value does not match value stored in PSBT");
3232
case TransactionError::MAX_FEE_EXCEEDED:
33-
return Untranslated("Fee exceeds maximum configured by -maxtxfee");
33+
return Untranslated("Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
3434
// no default case, so the compiler can warn about missing cases
3535
}
3636
assert(false);

test/functional/rpc_fundrawtransaction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def test_option_feerate(self):
667667
result = self.nodes[3].fundrawtransaction(rawtx) # uses self.min_relay_tx_fee (set by settxfee)
668668
result2 = self.nodes[3].fundrawtransaction(rawtx, {"feeRate": 2 * self.min_relay_tx_fee})
669669
result3 = self.nodes[3].fundrawtransaction(rawtx, {"feeRate": 10 * self.min_relay_tx_fee})
670-
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by -maxtxfee", self.nodes[3].fundrawtransaction, rawtx, {"feeRate": 1})
670+
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)", self.nodes[3].fundrawtransaction, rawtx, {"feeRate": 1})
671671
result_fee_rate = result['fee'] * 1000 / count_bytes(result['hex'])
672672
assert_fee_amount(result2['fee'], count_bytes(result2['hex']), 2 * result_fee_rate)
673673
assert_fee_amount(result3['fee'], count_bytes(result3['hex']), 10 * result_fee_rate)

test/functional/rpc_psbt.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def run_test(self):
184184

185185
# feeRate of 10 BTC / KB produces a total fee well above -maxtxfee
186186
# previously this was silently capped at -maxtxfee
187-
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by -maxtxfee", self.nodes[1].walletcreatefundedpsbt, [{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.nodes[1].getnewaddress():29.99}, 0, {"feeRate": 10, "add_inputs": True})
188-
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by -maxtxfee", self.nodes[1].walletcreatefundedpsbt, [{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.nodes[1].getnewaddress():1}, 0, {"feeRate": 10, "add_inputs": False})
187+
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)", self.nodes[1].walletcreatefundedpsbt, [{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.nodes[1].getnewaddress():29.99}, 0, {"feeRate": 10, "add_inputs": True})
188+
assert_raises_rpc_error(-4, "Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)", self.nodes[1].walletcreatefundedpsbt, [{"txid":txid,"vout":p2wpkh_pos},{"txid":txid,"vout":p2sh_p2wpkh_pos},{"txid":txid,"vout":p2pkh_pos}], {self.nodes[1].getnewaddress():1}, 0, {"feeRate": 10, "add_inputs": False})
189189

190190
# partially sign multisig things with node 1
191191
psbtx = wmulti.walletcreatefundedpsbt(inputs=[{"txid":txid,"vout":p2wsh_pos},{"txid":txid,"vout":p2sh_pos},{"txid":txid,"vout":p2sh_p2wsh_pos}], outputs={self.nodes[1].getnewaddress():29.99}, options={'changeAddress': self.nodes[1].getrawchangeaddress()})['psbt']

test/functional/rpc_rawtransaction.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def run_test(self):
458458
assert_equal(testres['allowed'], False)
459459
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
460460
# and sendrawtransaction should throw
461-
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by -maxtxfee', self.nodes[2].sendrawtransaction, rawTxSigned['hex'], 0.00001000)
461+
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)', self.nodes[2].sendrawtransaction, rawTxSigned['hex'], 0.00001000)
462462
# and the following calls should both succeed
463463
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']])[0]
464464
assert_equal(testres['allowed'], True)
@@ -482,7 +482,7 @@ def run_test(self):
482482
assert_equal(testres['allowed'], False)
483483
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
484484
# and sendrawtransaction should throw
485-
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by -maxtxfee', self.nodes[2].sendrawtransaction, rawTxSigned['hex'])
485+
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)', self.nodes[2].sendrawtransaction, rawTxSigned['hex'])
486486
# and the following calls should both succeed
487487
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']], maxfeerate='0.20000000')[0]
488488
assert_equal(testres['allowed'], True)

test/functional/wallet_bumpfee.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def test_maxtxfee_fails(self, rbf_node, dest_address):
348348
self.restart_node(1, ['-maxtxfee=0.000025'] + self.extra_args[1])
349349
rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
350350
rbfid = spend_one_input(rbf_node, dest_address)
351-
assert_raises_rpc_error(-4, "Unable to create transaction. Fee exceeds maximum configured by -maxtxfee", rbf_node.bumpfee, rbfid)
351+
assert_raises_rpc_error(-4, "Unable to create transaction. Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)", rbf_node.bumpfee, rbfid)
352352
self.restart_node(1, self.extra_args[1])
353353
rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
354354
self.connect_nodes(1, 0)

test/functional/wallet_create_tx.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def test_tx_size_too_large(self):
5353
self.restart_node(0, extra_args=[fee_setting])
5454
assert_raises_rpc_error(
5555
-6,
56-
"Fee exceeds maximum configured by -maxtxfee",
56+
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
5757
lambda: self.nodes[0].sendmany(dummy="", amounts=outputs),
5858
)
5959
assert_raises_rpc_error(
6060
-4,
61-
"Fee exceeds maximum configured by -maxtxfee",
61+
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
6262
lambda: self.nodes[0].fundrawtransaction(hexstring=raw_tx),
6363
)
6464

@@ -67,12 +67,12 @@ def test_tx_size_too_large(self):
6767
self.nodes[0].settxfee(0.01)
6868
assert_raises_rpc_error(
6969
-6,
70-
"Fee exceeds maximum configured by -maxtxfee",
70+
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
7171
lambda: self.nodes[0].sendmany(dummy="", amounts=outputs),
7272
)
7373
assert_raises_rpc_error(
7474
-4,
75-
"Fee exceeds maximum configured by -maxtxfee",
75+
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)",
7676
lambda: self.nodes[0].fundrawtransaction(hexstring=raw_tx),
7777
)
7878
self.nodes[0].settxfee(0)

0 commit comments

Comments
 (0)