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

add P2WPKH to Bitcoinex.Address.Encode #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelknowles
Copy link

Resolves #82

@@ -249,5 +249,15 @@ defmodule Bitcoinex.AddressTest do
script_hash = Base.decode16!("6d77fa9de297e9c536c6b23cfda1a8450bb5f765", case: :lower)
assert "3BfqJjn7H2jsbKd2NVHGP4sQWQ2bQWBRLv" == Address.encode(script_hash, :mainnet, :p2sh)
end

test "return true for encoding p2wpkh" do
# script_hash = "0014751e76e8199196d454941c45d1b3a323f1433bd6"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# script_hash = "0014751e76e8199196d454941c45d1b3a323f1433bd6"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mix.exs Outdated
@@ -34,7 +34,8 @@ defmodule Bitcoinex.MixProject do
{:timex, "~> 3.1"},
{:decimal, "~> 1.0 or ~> 2.0"},
{: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"}
Copy link
Collaborator

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelknowles michaelknowles force-pushed the michaelknowles--add-p2wpkh-address-encode branch from 407bdae to eb8cf16 Compare May 6, 2024 04:09
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.

Missing implementation for Bitcoinex.Address.encode P2WPKH.
3 participants