Skip to content

Commit

Permalink
reintroduce regtest for future expansion with networking
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneBronzini committed Mar 24, 2018
1 parent 9f2843f commit d29747c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion btcpy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# propagated, or distributed except according to the terms contained in the
# LICENSE.md file.

networks = {'mainnet', 'testnet'}
networks = {'mainnet', 'testnet', 'regtest'}

MAINNET = None
NETNAME = None
Expand Down
2 changes: 1 addition & 1 deletion btcpy/structs/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def from_wif(wif, check_network=True):
raise ValueError('Unknown private key prefix: {:02x}'.format(prefix))

if check_network:
if prefix != Constants.get('wif.prefixes')[net_name()]:
if prefix != Constants.get('wif.prefixes')['mainnet' if is_mainnet() else 'testnet']:
raise ValueError('{0} prefix in non-{0} environment'.format(net_name()))

public_compressed = len(rest) == 33
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from btcpy.structs.script import *
from btcpy.setup import setup

setup('testnet')
setup('regtest')


keys = [('tpubDHVQPtNuLdRLj7FU348D5PcrkkPj5ibhN52cfjthEH9KTfwTaVmo'
Expand Down
2 changes: 1 addition & 1 deletion tests/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from btcpy.lib.base58 import b58decode_check, b58encode_check
from btcpy.lib.parsing import IncompleteParsingException

setup('testnet')
setup('regtest')


def get_data(filename):
Expand Down

0 comments on commit d29747c

Please sign in to comment.