mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-26 23:09:03 +02:00
rpc: Add generatetodescriptor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"""Test the invalidateblock RPC."""
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
connect_nodes,
|
||||
@@ -62,7 +62,7 @@ class InvalidateTest(BitcoinTestFramework):
|
||||
wait_until(lambda: self.nodes[1].getblockcount() == 4, timeout=5)
|
||||
|
||||
self.log.info("Verify that we reconsider all ancestors as well")
|
||||
blocks = self.nodes[1].generatetoaddress(10, ADDRESS_BCRT1_UNSPENDABLE)
|
||||
blocks = self.nodes[1].generatetodescriptor(10, ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR)
|
||||
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
|
||||
# Invalidate the two blocks at the tip
|
||||
self.nodes[1].invalidateblock(blocks[-1])
|
||||
@@ -74,7 +74,7 @@ class InvalidateTest(BitcoinTestFramework):
|
||||
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
|
||||
|
||||
self.log.info("Verify that we reconsider all descendants")
|
||||
blocks = self.nodes[1].generatetoaddress(10, ADDRESS_BCRT1_UNSPENDABLE)
|
||||
blocks = self.nodes[1].generatetodescriptor(10, ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR)
|
||||
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
|
||||
# Invalidate the two blocks at the tip
|
||||
self.nodes[1].invalidateblock(blocks[-2])
|
||||
|
||||
@@ -12,6 +12,7 @@ from .util import hex_str_to_bytes
|
||||
from . import segwit_addr
|
||||
|
||||
ADDRESS_BCRT1_UNSPENDABLE = 'bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj'
|
||||
ADDRESS_BCRT1_UNSPENDABLE_DESCRIPTOR = 'addr(bcrt1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xueyj)#juyq9d97'
|
||||
|
||||
|
||||
class AddressType(enum.Enum):
|
||||
|
||||
Reference in New Issue
Block a user