mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
RPC: unify arg type error message
We were throwing two different errors for the same problematic: * "Expected type {expected], got {type}" --> RPCTypeCheckArgument() * "JSON value of type {type} is not of expected type {expected}" --> UniValue::checkType()
This commit is contained in:
@@ -65,7 +65,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||
assert_equal(node.getmempoolinfo()['size'], self.mempool_size)
|
||||
|
||||
self.log.info('Should not accept garbage to testmempoolaccept')
|
||||
assert_raises_rpc_error(-3, 'Expected type array, got string', lambda: node.testmempoolaccept(rawtxs='ff00baar'))
|
||||
assert_raises_rpc_error(-3, 'JSON value of type string is not of expected type array', lambda: node.testmempoolaccept(rawtxs='ff00baar'))
|
||||
assert_raises_rpc_error(-8, 'Array must contain between 1 and 25 transactions.', lambda: node.testmempoolaccept(rawtxs=['ff22']*26))
|
||||
assert_raises_rpc_error(-8, 'Array must contain between 1 and 25 transactions.', lambda: node.testmempoolaccept(rawtxs=[]))
|
||||
assert_raises_rpc_error(-22, 'TX decode failed', lambda: node.testmempoolaccept(rawtxs=['ff00baar']))
|
||||
|
Reference in New Issue
Block a user