Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for testnet wifs and addresses #28

Closed
coinlogic opened this issue May 4, 2014 · 4 comments
Closed

Support for testnet wifs and addresses #28

coinlogic opened this issue May 4, 2014 · 4 comments

Comments

@coinlogic
Copy link

Looks like encoding.py doesn't support testnet wifs and addresses. This is mainly because the allowable_prefixes are only limited to mainnet. Is there any specific reason for this limitation? Or can this limitation be removed to allow testnet?

@richardkiss
Copy link
Owner

You can set allowable_prefixes of is_valid_bitcoin_address to any list of prefixes... the idea is to look it up in pycoin.networks.address_prefix_for_netcode.

If this isn't clear, feel free to reopen this issue for clarification.

@coinlogic
Copy link
Author

The problem is not limited to is_valid_bitcoin.

Look at is_valid_wif() there is no way to specify the prefix here. Or in wif_to_secret_exponent().
Testnet wifs have a different prefix, so these functions fail when used with testnet wifs. Further, these functions are used at several places with an assumption of mainnet wif prefixes. e.g. in scripts/spend.py and tx/tx_utils.py

@richardkiss
Copy link
Owner

Gotchya, I'll fix it.

@richardkiss richardkiss reopened this May 6, 2014
@richardkiss
Copy link
Owner

Fixed in 9040e3b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants