mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Consistently use FormatStateMessage in RPC error output
This will include the error code and debug output as well as the reason string. See #11955 for the motivation.
This commit is contained in:
@@ -21,7 +21,7 @@ from test_framework.script import CScript
|
||||
from io import BytesIO
|
||||
import time
|
||||
|
||||
NULLDUMMY_ERROR = "64: non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)"
|
||||
NULLDUMMY_ERROR = "non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero) (code 64)"
|
||||
|
||||
def trueDummy(tx):
|
||||
scriptSig = CScript(tx.vin[0].scriptSig)
|
||||
|
||||
@@ -58,7 +58,7 @@ class MempoolLimitTest(BitcoinTestFramework):
|
||||
# specifically fund this tx with a fee < mempoolminfee, >= than minrelaytxfee
|
||||
txF = self.nodes[0].fundrawtransaction(tx, {'feeRate': relayfee})
|
||||
txFS = self.nodes[0].signrawtransaction(txF['hex'])
|
||||
assert_raises_rpc_error(-26, "66: mempool min fee not met", self.nodes[0].sendrawtransaction, txFS['hex'])
|
||||
assert_raises_rpc_error(-26, "mempool min fee not met, 166 < 411 (code 66)", self.nodes[0].sendrawtransaction, txFS['hex'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
MempoolLimitTest().main()
|
||||
|
||||
@@ -120,7 +120,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
|
||||
tx_id = self.nodes[0].decoderawtransaction(tx_hex)["txid"]
|
||||
|
||||
# This will raise an exception due to min relay fee not being met
|
||||
assert_raises_rpc_error(-26, "66: min relay fee not met", self.nodes[0].sendrawtransaction, tx_hex)
|
||||
assert_raises_rpc_error(-26, "min relay fee not met (code 66)", self.nodes[0].sendrawtransaction, tx_hex)
|
||||
assert(tx_id not in self.nodes[0].getrawmempool())
|
||||
|
||||
# This is a less than 1000-byte transaction, so just set the fee
|
||||
|
||||
Reference in New Issue
Block a user