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

bugfix: allow for testnet BIP32 address generation #8

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

nmarley
Copy link
Contributor

@nmarley nmarley commented Feb 18, 2016

This passes the @network of Keychain on thru to BTC::Key. Currently
testnet BIP32 keychains will generate mainnet addresses.

This passes the @network of Keychain on thru to BTC::Key. Currently
testnet BIP32 keychains will generate mainnet addresses.
@nmarley
Copy link
Contributor Author

nmarley commented Feb 18, 2016

Currently:

$ irb -rbtcruby
>> kc = BTC::Keychain.new(xpub: 'tpubD6NzVbkrYhZ4XgiXtGrdW5XDAPFCL9h7we1vwNCpn8tGbBcgfVYjXyhWo4E1xkh56hjod1RhGjxbaTLV3X4FyWuejifB9jusQ46QzG87VKp');nil
=> nil
>> kc.derived_key('0/0').address.to_s
=> "12CL4K2eVqj7hQTix7dM7CVHCkpP17Pry3"

After patch:

irb -I./lib -rbtcruby
>> kc = BTC::Keychain.new(xpub: 'tpubD6NzVbkrYhZ4XgiXtGrdW5XDAPFCL9h7we1vwNCpn8tGbBcgfVYjXyhWo4E1xkh56hjod1RhGjxbaTLV3X4FyWuejifB9jusQ46QzG87VKp');nil
=> nil
>> kc.derived_key('0/0').address.to_s
=> "mgiHMN7dJsANUWwLfgbiw7hc4kR5xMjPhw"
>>

@oleganza
Copy link
Owner

Thanks!

oleganza added a commit that referenced this pull request Feb 19, 2016
bugfix: allow for testnet BIP32 address generation
@oleganza oleganza merged commit 084b169 into oleganza:master Feb 19, 2016
@nmarley nmarley deleted the testnet-bip32 branch February 25, 2016 08:39
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

Successfully merging this pull request may close these issues.

2 participants