Skip to content

Commit 74c0d81

Browse files
test: use miniwallet in test_rpc() function in feature_rbf.py
1 parent 8d83f9c commit 74c0d81

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

test/functional/feature_rbf.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
DUMMY_2_P2WPKH_SCRIPT,
2727
)
2828
from test_framework.wallet import MiniWallet
29-
29+
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
3030

3131
MAX_REPLACEMENT_LIMIT = 100
3232
class ReplaceByFeeTest(BitcoinTestFramework):
@@ -44,9 +44,6 @@ def set_test_params(self):
4444
]
4545
self.supports_cli = False
4646

47-
def skip_test_if_missing_module(self):
48-
self.skip_if_no_wallet()
49-
5047
def run_test(self):
5148
self.wallet = MiniWallet(self.nodes[0])
5249
# the pre-mined test framework chain contains coinbase outputs to the
@@ -531,24 +528,26 @@ def test_prioritised_transactions(self):
531528
assert tx2b_txid in self.nodes[0].getrawmempool()
532529

533530
def test_rpc(self):
534-
us0 = self.nodes[0].listunspent()[0]
531+
us0 = self.wallet.get_utxo()
535532
ins = [us0]
536-
outs = {self.nodes[0].getnewaddress(): Decimal(1.0000000)}
533+
outs = {ADDRESS_BCRT1_UNSPENDABLE: Decimal(1.0000000)}
537534
rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True)
538535
rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False)
539536
json0 = self.nodes[0].decoderawtransaction(rawtx0)
540537
json1 = self.nodes[0].decoderawtransaction(rawtx1)
541538
assert_equal(json0["vin"][0]["sequence"], 4294967293)
542539
assert_equal(json1["vin"][0]["sequence"], 4294967295)
543540

544-
rawtx2 = self.nodes[0].createrawtransaction([], outs)
545-
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
546-
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": False})
541+
if self.is_wallet_compiled():
542+
self.init_wallet(0)
543+
rawtx2 = self.nodes[0].createrawtransaction([], outs)
544+
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
545+
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": False})
547546

548-
json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex'])
549-
json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex'])
550-
assert_equal(json0["vin"][0]["sequence"], 4294967293)
551-
assert_equal(json1["vin"][0]["sequence"], 4294967294)
547+
json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex'])
548+
json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex'])
549+
assert_equal(json0["vin"][0]["sequence"], 4294967293)
550+
assert_equal(json1["vin"][0]["sequence"], 4294967294)
552551

553552
def test_no_inherited_signaling(self):
554553
confirmed_utxo = self.wallet.get_utxo()

0 commit comments

Comments
 (0)