Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ int wally_address_to_scriptpubkey(const char *addr, uint32_t network, unsigned c
version = decoded[0];
if (network_from_addr_version(version, &addr_network) != WALLY_OK)
return WALLY_EINVAL;
if (network == WALLY_NETWORK_BITCOIN_REGTEST)
network = WALLY_NETWORK_BITCOIN_TESTNET; /* regtest uses testnet prefix */
if (network != addr_network)
return WALLY_EINVAL;

Expand Down
2 changes: 2 additions & 0 deletions src/test/test_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

NETWORK_BITCOIN_MAINNET = 0x01
NETWORK_BITCOIN_TESTNET = 0x02
NETWORK_BITCOIN_REGTEST = 0xff
NETWORK_LIQUID_MAINNET = 0x03
NETWORK_LIQUID_REGTEST = 0x04
NETWORK_LIQUID_TESTNET = 0x05
Expand Down Expand Up @@ -96,6 +97,7 @@ def get_test_key(self, vec, path):
def test_address_vectors(self):
self.do_test_vector(vec, 'm/0H/1', NETWORK_BITCOIN_MAINNET)
self.do_test_vector(vec, 'm/1H/1', NETWORK_BITCOIN_TESTNET) # Testnet
self.do_test_vector(vec, 'm/1H/1', NETWORK_BITCOIN_REGTEST) # Testnet

def do_test_vector(self, vec, path, network):
key = self.get_test_key(vec, path)
Expand Down