mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05:00
test: use miniwallet in test_rpc() function in feature_rbf.py
This commit is contained in:
parent
8d83f9c1d1
commit
74c0d81b46
1 changed files with 12 additions and 13 deletions
|
@ -26,7 +26,7 @@ from test_framework.script_util import (
|
||||||
DUMMY_2_P2WPKH_SCRIPT,
|
DUMMY_2_P2WPKH_SCRIPT,
|
||||||
)
|
)
|
||||||
from test_framework.wallet import MiniWallet
|
from test_framework.wallet import MiniWallet
|
||||||
|
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
||||||
|
|
||||||
MAX_REPLACEMENT_LIMIT = 100
|
MAX_REPLACEMENT_LIMIT = 100
|
||||||
class ReplaceByFeeTest(BitcoinTestFramework):
|
class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
|
@ -44,9 +44,6 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
]
|
]
|
||||||
self.supports_cli = False
|
self.supports_cli = False
|
||||||
|
|
||||||
def skip_test_if_missing_module(self):
|
|
||||||
self.skip_if_no_wallet()
|
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.wallet = MiniWallet(self.nodes[0])
|
self.wallet = MiniWallet(self.nodes[0])
|
||||||
# the pre-mined test framework chain contains coinbase outputs to the
|
# the pre-mined test framework chain contains coinbase outputs to the
|
||||||
|
@ -531,9 +528,9 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
assert tx2b_txid in self.nodes[0].getrawmempool()
|
assert tx2b_txid in self.nodes[0].getrawmempool()
|
||||||
|
|
||||||
def test_rpc(self):
|
def test_rpc(self):
|
||||||
us0 = self.nodes[0].listunspent()[0]
|
us0 = self.wallet.get_utxo()
|
||||||
ins = [us0]
|
ins = [us0]
|
||||||
outs = {self.nodes[0].getnewaddress(): Decimal(1.0000000)}
|
outs = {ADDRESS_BCRT1_UNSPENDABLE: Decimal(1.0000000)}
|
||||||
rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True)
|
rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True)
|
||||||
rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False)
|
rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False)
|
||||||
json0 = self.nodes[0].decoderawtransaction(rawtx0)
|
json0 = self.nodes[0].decoderawtransaction(rawtx0)
|
||||||
|
@ -541,14 +538,16 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||||
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
||||||
assert_equal(json1["vin"][0]["sequence"], 4294967295)
|
assert_equal(json1["vin"][0]["sequence"], 4294967295)
|
||||||
|
|
||||||
rawtx2 = self.nodes[0].createrawtransaction([], outs)
|
if self.is_wallet_compiled():
|
||||||
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
|
self.init_wallet(0)
|
||||||
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": False})
|
rawtx2 = self.nodes[0].createrawtransaction([], outs)
|
||||||
|
frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": True})
|
||||||
|
frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {"replaceable": False})
|
||||||
|
|
||||||
json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex'])
|
json0 = self.nodes[0].decoderawtransaction(frawtx2a['hex'])
|
||||||
json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex'])
|
json1 = self.nodes[0].decoderawtransaction(frawtx2b['hex'])
|
||||||
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
assert_equal(json0["vin"][0]["sequence"], 4294967293)
|
||||||
assert_equal(json1["vin"][0]["sequence"], 4294967294)
|
assert_equal(json1["vin"][0]["sequence"], 4294967294)
|
||||||
|
|
||||||
def test_no_inherited_signaling(self):
|
def test_no_inherited_signaling(self):
|
||||||
confirmed_utxo = self.wallet.get_utxo()
|
confirmed_utxo = self.wallet.get_utxo()
|
||||||
|
|
Loading…
Add table
Reference in a new issue