-
Notifications
You must be signed in to change notification settings - Fork 22
add P2WPKH to Bitcoinex.Address.Encode #87
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
base: master
Are you sure you want to change the base?
add P2WPKH to Bitcoinex.Address.Encode #87
Conversation
test/address_test.exs
Outdated
| end | ||
|
|
||
| test "return true for encoding p2wpkh" do | ||
| # script_hash = "0014751e76e8199196d454941c45d1b3a323f1433bd6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # script_hash = "0014751e76e8199196d454941c45d1b3a323f1433bd6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mix.exs
Outdated
| {:ex_doc, ">= 0.0.0", only: :dev, runtime: false}, | ||
| {:benchee, ">= 1.0.0", only: :dev} | ||
| {:benchee, ">= 1.0.0", only: :dev}, | ||
| {:binary, "~> 0.0.5"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious as to why we'd add a dependency that will do a pass through to :binary.bin_to_list/1?
Seem's like we can remove the dependency and call :binary.bin_to_list/1 directly, am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Updated. https://github.com/RiverFinancial/bitcoinex/compare/407bdae54377eef81df33e9e10117ccd34dc5fc9..eb8cf16d6b7a55b7a022d3e7803bdb6d96fde498
407bdae to
eb8cf16
Compare
| Base58.encode(<<decimal_prefix>> <> script_hash) | ||
| end | ||
|
|
||
| def encode(script_hash, network_name, :p2wpkh) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename script_hash to pubkey_hash? Otherwise LGTM
Resolves #82