Skip to content

Commit

Permalink
Add CI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3rdIteration committed Jan 3, 2024
1 parent 9c71694 commit c308fc3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
20 changes: 17 additions & 3 deletions btcrecover/test/test_seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def can_load_keccak():
class TestRecoveryFromAddress(unittest.TestCase):

def address_tester(self, wallet_type, the_address, the_address_limit, correct_mnemonic, test_path=None,
pathlist_file=None, addr_start_index = 0, force_p2sh = False, checksinglexpubaddress = False, **kwds):
pathlist_file=None, addr_start_index = 0, force_p2sh = False, checksinglexpubaddress = False, force_p2tr = False, **kwds):

if pathlist_file:
test_path = btcrseed.load_pathlist("./derivationpath-lists/" + pathlist_file)
Expand All @@ -389,14 +389,16 @@ def address_tester(self, wallet_type, the_address, the_address_limit, correct_mn
address_limit=the_address_limit,
address_start_index=addr_start_index,
force_p2sh=force_p2sh,
checksinglexpubaddress=checksinglexpubaddress)
checksinglexpubaddress=checksinglexpubaddress,
force_p2tr=force_p2tr)
else:
wallet = wallet_type.create_from_params(addresses=[the_address],
address_limit=the_address_limit,
address_start_index=addr_start_index,
force_p2sh=force_p2sh,
path=test_path,
checksinglexpubaddress=checksinglexpubaddress)
checksinglexpubaddress=checksinglexpubaddress,
force_p2tr=force_p2tr,)

# Convert the mnemonic string into a mnemonic_ids_guess
wallet.config_mnemonic(correct_mnemonic, **kwds)
Expand Down Expand Up @@ -590,6 +592,18 @@ def test_bip84_addr_BTC_defaultderivationpaths(self):
self.address_tester(btcrseed.WalletBIP39, "bc1qv87qf7prhjf2ld8vgm7l0mj59jggm6ae5jdkx2", 2,
"element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate "
"sister uniform advice pen praise soap lizard festival connect baby")
def test_p2tr_bip86_addr_BTC_defaultderivationpaths(self):
self.address_tester(btcrseed.WalletBIP39, "bc1prg35cfxqc23zwqfpnt3qxmay2xyw76jngxag0agpzj24lhs85qfqr8ualh", 1,
"word hurdle hello session tail grace police castle minimum equal apple crunch")

def test_p2tr_addr_BTC_forceP2SH(self):
self.address_tester(btcrseed.WalletBIP39, "bc1pqgsnwqe99ug0ygndc3g4cpc680ze9fraex6ud2lcpktphr0xxkusq2tmpj", 1,
"calm great hip soda enhance abuse tiny summer gloom depth shrug chronic", force_p2tr=True)

def test_p2tr_bip86_addr_BTC_ordinalswallet(self):
self.address_tester(btcrseed.WalletBIP39, "bc1pmpa44tpufkq0fhw4m09el9uh98jchnhky62mrqwa74du6k5hy4xs43606x", 1,
"basket manage solve glide gravity deliver black wire spice gospel narrow seven",
["m/86'/0'/0'"])

def test_bip44_addr_XRP(self):
self.address_tester(btcrseed.WalletBIP39, "rJGNUmwiYDwXEsLzUFV9njhP3syrDvA6hs", 2,
Expand Down
3 changes: 2 additions & 1 deletion requirements-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ shamir-mnemonic~=0.2.2
bitcoin-utils~=0.5.5
pylibscrypt~=2.0.0
git+https://github.com/ethereum/staking-deposit-cli.git@v2.5.0
py_ecc~=6.0.0
py_ecc~=6.0.0
bitcoinlib~=0.6.13
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
coincurve~=18.0.0
green~=3.3.0
protobuf~=3.19.1
pycryptodome~=3.12.0
pycryptodome~=3.12.0
bitcoinlib~=0.6.13

0 comments on commit c308fc3

Please sign in to comment.