Skip to content

Commit

Permalink
Update: BIP's, Electrum V1 and V2 HDs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meherett committed Dec 5, 2024
1 parent 5713f51 commit 8eccfca
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 11 deletions.
4 changes: 3 additions & 1 deletion tests/hdwallet/hds/electrum/test_hds_electrum_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
# file COPYING or https://opensource.org/license/mit

from hdwallet.hds import ElectrumV1HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import ElectrumDerivation
from hdwallet.const import PUBLIC_KEY_TYPES


def test_electrum_v1_hd(data):

electrum_v1_hd: ElectrumV1HD = ElectrumV1HD(
public_key_type=PUBLIC_KEY_TYPES.COMPRESSED
public_key_type=PUBLIC_KEY_TYPES.COMPRESSED,
wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX
)

electrum_v1_hd.from_seed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# file COPYING or https://opensource.org/license/mit

from hdwallet.hds import ElectrumV2HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import ElectrumDerivation
from hdwallet.const import (
PUBLIC_KEY_TYPES, MODES
Expand All @@ -15,7 +16,9 @@
def test_electrum_v2_segwit_hd(data):

electrum_v2_hd: ElectrumV2HD = ElectrumV2HD(
mode=MODES.SEGWIT, public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
mode=MODES.SEGWIT,
public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED,
wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX
)

electrum_v2_hd.from_seed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# file COPYING or https://opensource.org/license/mit

from hdwallet.hds import ElectrumV2HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import ElectrumDerivation
from hdwallet.const import (
PUBLIC_KEY_TYPES, MODES
Expand All @@ -15,7 +16,9 @@
def test_electrum_v2_segwit_2fa_hd(data):

electrum_v2_hd: ElectrumV2HD = ElectrumV2HD(
mode=MODES.SEGWIT, public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
mode=MODES.SEGWIT,
wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX,
public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
)

electrum_v2_hd.from_seed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# file COPYING or https://opensource.org/license/mit

from hdwallet.hds import ElectrumV2HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import ElectrumDerivation
from hdwallet.const import (
PUBLIC_KEY_TYPES, MODES
Expand All @@ -15,7 +16,9 @@
def test_electrum_v2_standard_hd(data):

electrum_v2_hd: ElectrumV2HD = ElectrumV2HD(
mode=MODES.STANDARD, public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
mode=MODES.STANDARD,
wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX,
public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
)

electrum_v2_hd.from_seed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# file COPYING or https://opensource.org/license/mit

from hdwallet.hds import ElectrumV2HD
from hdwallet.cryptocurrencies import Bitcoin as Cryptocurrency
from hdwallet.derivations import ElectrumDerivation
from hdwallet.const import (
PUBLIC_KEY_TYPES, MODES
Expand All @@ -15,7 +16,9 @@
def test_electrum_v2_standard_2fa_hd(data):

electrum_v2_hd: ElectrumV2HD = ElectrumV2HD(
mode=MODES.STANDARD, public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
mode=MODES.STANDARD,
wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX,
public_key_type=PUBLIC_KEY_TYPES.UNCOMPRESSED
)

electrum_v2_hd.from_seed(
Expand Down
2 changes: 1 addition & 1 deletion tests/hdwallet/hds/test_hds_bip141.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_bip141_hd(data):
bip141_hd: BIP141HD = BIP141HD(
ecc=Cryptocurrency.ECC, semantic="p2wpkh"
ecc=Cryptocurrency.ECC, wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX, semantic="p2wpkh"
)

bip141_hd.from_seed(
Expand Down
3 changes: 2 additions & 1 deletion tests/hdwallet/hds/test_hds_bip32.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

def test_bip32_hd(data):
bip32_hd: BIP32HD = BIP32HD(
ecc=Cryptocurrency.ECC
ecc=Cryptocurrency.ECC, wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX

)

bip32_hd.from_seed(
Expand Down
2 changes: 1 addition & 1 deletion tests/hdwallet/hds/test_hds_bip44.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_bip44_hd(data):
bip44_hd: BIP44HD = BIP44HD(
ecc=Cryptocurrency.ECC
ecc=Cryptocurrency.ECC, wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX
)

bip44_hd.from_seed(
Expand Down
2 changes: 1 addition & 1 deletion tests/hdwallet/hds/test_hds_bip49.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_bip49_hd(data):
bip49_hd: BIP49HD = BIP49HD(
ecc=Cryptocurrency.ECC
ecc=Cryptocurrency.ECC, wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX
)

bip49_hd.from_seed(
Expand Down
2 changes: 1 addition & 1 deletion tests/hdwallet/hds/test_hds_bip84.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def test_bip84_hd(data):
bip84_hd: BIP84HD = BIP84HD(
ecc=Cryptocurrency.ECC
ecc=Cryptocurrency.ECC, wif_prefix = Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX
)

bip84_hd.from_seed(
Expand Down
7 changes: 6 additions & 1 deletion tests/hdwallet/hds/test_hds_bip86.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@

def test_bip86_hd(data):
bip86_hd: BIP86HD = BIP86HD(
ecc=Cryptocurrency.ECC, coin_type=Cryptocurrency.COIN_TYPE, account=0, change="external-chain", address=0
ecc=Cryptocurrency.ECC,
coin_type=Cryptocurrency.COIN_TYPE,
wif_prefix=Cryptocurrency.NETWORKS.MAINNET.WIF_PREFIX,
account=0,
change="external-chain",
address=0
)

bip86_hd.from_seed(
Expand Down

0 comments on commit 8eccfca

Please sign in to comment.