mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
Merge bitcoin/bitcoin#25267: test: check replaceable
mismatch error in createrawtransaction
RPC
1bace0cfee
test: check `replaceable` mismatch error in `createrawtransaction` RPC (Sebastian Falbesoner) Pull request description: This PR adds missing test coverage for the createrawtransaction RPC, in the case that the `replaceable` parameter is set, but the passed transaction doesn't signal RBF (i.e. no input's nSequence is < 0xffffffe):1c7ef0abd1/src/rpc/rawtransaction_util.cpp (L135-L137)
ACKs for top commit: laanwj: Code review ACK1bace0cfee
brunoerg: crACK1bace0cfee
furszy: Code review ACK1bace0cf
Tree-SHA512: e6390401c8026c782643e3de7be56ea1745736b7e4c8886186d75c353c301b57afdabb631b9d8e2770386e4d7a59ac5fba1f380b9a5a21296512ca4515b35baa
This commit is contained in:
commit
1f63b460a8
1 changed files with 5 additions and 0 deletions
|
@ -17,6 +17,7 @@ from decimal import Decimal
|
||||||
|
|
||||||
from test_framework.blocktools import COINBASE_MATURITY
|
from test_framework.blocktools import COINBASE_MATURITY
|
||||||
from test_framework.messages import (
|
from test_framework.messages import (
|
||||||
|
BIP125_SEQUENCE_NUMBER,
|
||||||
CTransaction,
|
CTransaction,
|
||||||
tx_from_hex,
|
tx_from_hex,
|
||||||
)
|
)
|
||||||
|
@ -220,6 +221,10 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair must contain exactly one key", self.nodes[0].createrawtransaction, [], [{'a': 1, 'b': 2}])
|
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair must contain exactly one key", self.nodes[0].createrawtransaction, [], [{'a': 1, 'b': 2}])
|
||||||
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair not an object as expected", self.nodes[0].createrawtransaction, [], [['key-value pair1'], ['2']])
|
assert_raises_rpc_error(-8, "Invalid parameter, key-value pair not an object as expected", self.nodes[0].createrawtransaction, [], [['key-value pair1'], ['2']])
|
||||||
|
|
||||||
|
# Test `createrawtransaction` mismatch between sequence number(s) and `replaceable` option
|
||||||
|
assert_raises_rpc_error(-8, "Invalid parameter combination: Sequence number(s) contradict replaceable option",
|
||||||
|
self.nodes[0].createrawtransaction, [{'txid': TXID, 'vout': 0, 'sequence': BIP125_SEQUENCE_NUMBER+1}], {}, 0, True)
|
||||||
|
|
||||||
# Test `createrawtransaction` invalid `locktime`
|
# Test `createrawtransaction` invalid `locktime`
|
||||||
assert_raises_rpc_error(-3, "Expected type number", self.nodes[0].createrawtransaction, [], {}, 'foo')
|
assert_raises_rpc_error(-3, "Expected type number", self.nodes[0].createrawtransaction, [], {}, 'foo')
|
||||||
assert_raises_rpc_error(-8, "Invalid parameter, locktime out of range", self.nodes[0].createrawtransaction, [], {}, -1)
|
assert_raises_rpc_error(-8, "Invalid parameter, locktime out of range", self.nodes[0].createrawtransaction, [], {}, -1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue