aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2019-07-27 19:35:07 +0200
committerSjors Provoost <sjors@sprovoost.nl>2019-08-17 12:52:50 +0200
commit576580fe8a063f21c0e903af1cf8f85cd6cb71d7 (patch)
treedfcadd9975d850c8df6f7bb54ec6463065aa9e5e /test
parent0942a60c06ab4bde275369e7b7bd1caa3b20778e (diff)
downloadbitcoin-576580fe8a063f21c0e903af1cf8f85cd6cb71d7.tar.xz
[test] walletcreatefundedpsbt: check RBF is disabled when -walletrbf=0
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_psbt.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 5e89ad9f5e..7a4cf42b2d 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -7,7 +7,7 @@
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_equal, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
+from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, connect_nodes_bi, disconnect_nodes, find_output, sync_blocks
import json
import os
@@ -22,7 +22,7 @@ class PSBTTest(BitcoinTestFramework):
self.num_nodes = 3
self.extra_args = [
["-walletrbf=1"],
- [],
+ ["-walletrbf=0"],
[]
]
@@ -199,7 +199,7 @@ class PSBTTest(BitcoinTestFramework):
psbtx_info = self.nodes[0].walletcreatefundedpsbt([{"txid":unspent["txid"], "vout":unspent["vout"]}], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"replaceable":False}, False)
decoded_psbt = self.nodes[0].decodepsbt(psbtx_info["psbt"])
for tx_in, psbt_in in zip(decoded_psbt["tx"]["vin"], decoded_psbt["inputs"]):
- assert(tx_in["sequence"] > MAX_BIP125_RBF_SEQUENCE)
+ assert_greater_than(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
assert "bip32_derivs" not in psbt_in
assert_equal(decoded_psbt["tx"]["locktime"], block_height+2)
@@ -218,6 +218,13 @@ class PSBTTest(BitcoinTestFramework):
assert_equal(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
assert_equal(decoded_psbt["tx"]["locktime"], 0)
+ # Same construction without optional arguments, for a node with -walletrbf=0
+ unspent1 = self.nodes[1].listunspent()[0]
+ psbtx_info = self.nodes[1].walletcreatefundedpsbt([{"txid":unspent1["txid"], "vout":unspent1["vout"]}], [{self.nodes[2].getnewaddress():unspent1["amount"]+1}], block_height)
+ decoded_psbt = self.nodes[1].decodepsbt(psbtx_info["psbt"])
+ for tx_in in decoded_psbt["tx"]["vin"]:
+ assert_greater_than(tx_in["sequence"], MAX_BIP125_RBF_SEQUENCE)
+
# Make sure change address wallet does not have P2SH innerscript access to results in success
# when attempting BnB coin selection
self.nodes[0].walletcreatefundedpsbt([], [{self.nodes[2].getnewaddress():unspent["amount"]+1}], block_height+2, {"changeAddress":self.nodes[1].getnewaddress()}, False)