mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
test all single-key pegout address types
This commit is contained in:
parent
40a62a151d
commit
894d76e7c8
1 changed files with 8 additions and 4 deletions
|
|
@ -15,8 +15,8 @@ from test_framework.util import (
|
||||||
)
|
)
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
def get_new_unconfidential_address(node):
|
def get_new_unconfidential_address(node, addr_type="p2sh-segwit"):
|
||||||
addr = node.getnewaddress()
|
addr = node.getnewaddress("", addr_type)
|
||||||
val_addr = node.getaddressinfo(addr)
|
val_addr = node.getaddressinfo(addr)
|
||||||
if 'unconfidential' in val_addr:
|
if 'unconfidential' in val_addr:
|
||||||
return val_addr['unconfidential']
|
return val_addr['unconfidential']
|
||||||
|
|
@ -148,6 +148,8 @@ class FedPegTest(BitcoinTestFramework):
|
||||||
pegout_tested = True
|
pegout_tested = True
|
||||||
break
|
break
|
||||||
assert pegout_tested
|
assert pegout_tested
|
||||||
|
sidechain.generatetoaddress(1, sidechain.getnewaddress())
|
||||||
|
assert_equal(sidechain.gettransaction(pegout_txid)["confirmations"], 1)
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
parent = self.nodes[0]
|
parent = self.nodes[0]
|
||||||
|
|
@ -289,8 +291,10 @@ class FedPegTest(BitcoinTestFramework):
|
||||||
if "confirmations" not in tx or tx["confirmations"] == 0:
|
if "confirmations" not in tx or tx["confirmations"] == 0:
|
||||||
raise Exception("Peg-in confirmation has failed.")
|
raise Exception("Peg-in confirmation has failed.")
|
||||||
|
|
||||||
print("Test pegout")
|
print("Test pegouts")
|
||||||
self.test_pegout(get_new_unconfidential_address(parent), sidechain)
|
self.test_pegout(get_new_unconfidential_address(parent, "legacy"), sidechain)
|
||||||
|
self.test_pegout(get_new_unconfidential_address(parent, "p2sh-segwit"), sidechain)
|
||||||
|
self.test_pegout(get_new_unconfidential_address(parent, "bech32"), sidechain)
|
||||||
|
|
||||||
print("Test pegout P2SH")
|
print("Test pegout P2SH")
|
||||||
parent_chain_addr = get_new_unconfidential_address(parent)
|
parent_chain_addr = get_new_unconfidential_address(parent)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue