Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions lib/extendedkey.ex
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ defmodule Bitcoinex.ExtendedKey do
parent_fingerprint: binary,
child_num: binary,
chaincode: binary,
key: binary,
checksum: binary
key: binary
}

@enforce_keys [
Expand All @@ -142,8 +141,7 @@ defmodule Bitcoinex.ExtendedKey do
:parent_fingerprint,
:child_num,
:chaincode,
:key,
:checksum
:key
]

defstruct [
Expand All @@ -152,8 +150,7 @@ defmodule Bitcoinex.ExtendedKey do
:parent_fingerprint,
:child_num,
:chaincode,
:key,
:checksum
:key
]

@xpub_pfx <<0x04, 0x88, 0xB2, 0x1E>>
Expand Down Expand Up @@ -253,7 +250,7 @@ defmodule Bitcoinex.ExtendedKey do
xkey =
<<prefix::binary-size(4), depth::binary-size(1), parent_fingerprint::binary-size(4),
child_num::binary-size(4), chaincode::binary-size(32), key::binary-size(33),
checksum::binary-size(4)>>
_checksum::binary-size(4)>>
) do
cond do
prefix not in @all_prefixes ->
Expand All @@ -276,8 +273,7 @@ defmodule Bitcoinex.ExtendedKey do
parent_fingerprint: parent_fingerprint,
child_num: child_num,
chaincode: chaincode,
key: key,
checksum: checksum
key: key
}}
end
end
Expand Down
2 changes: 0 additions & 2 deletions test/extendedkey_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ defmodule Bitcoinex.Secp256k1.ExtendedKeyTest do
chaincode:
<<135, 61, 255, 129, 192, 47, 82, 86, 35, 253, 31, 229, 22, 126, 172, 58, 85, 160, 73,
222, 61, 49, 75, 180, 46, 226, 39, 255, 237, 55, 213, 8>>,
checksum: <<171, 71, 59, 33>>,
child_num: <<0, 0, 0, 0>>,
depth: <<0>>,
key:
Expand All @@ -48,7 +47,6 @@ defmodule Bitcoinex.Secp256k1.ExtendedKeyTest do
chaincode:
<<135, 61, 255, 129, 192, 47, 82, 86, 35, 253, 31, 229, 22, 126, 172, 58, 85, 160, 73,
222, 61, 49, 75, 180, 46, 226, 39, 255, 237, 55, 213, 8>>,
checksum: <<231, 126, 157, 113>>,
child_num: <<0, 0, 0, 0>>,
depth: <<0>>,
key:
Expand Down