diff --git a/tests/conftest.py b/tests/conftest.py index 1404216c..2a7ac40b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,7 @@ settings.mint_host = "0.0.0.0" settings.mint_listen_port = SERVER_PORT settings.mint_url = SERVER_ENDPOINT -settings.lightning = False +settings.lightning = True settings.tor = False settings.mint_lightning_backend = "FakeWallet" settings.mint_database = "./test_data/test_mint" diff --git a/tests/test_mint.py b/tests/test_mint.py index cf95caca..07908e86 100644 --- a/tests/test_mint.py +++ b/tests/test_mint.py @@ -66,13 +66,14 @@ async def test_get_keyset(ledger: Ledger): @pytest.mark.asyncio async def test_mint(ledger: Ledger): + invoice, payment_hash = await ledger.request_mint(8) blinded_messages_mock = [ BlindedMessage( amount=8, B_="02634a2c2b34bec9e8a4aba4361f6bf202d7fa2365379b0840afe249a7a9d71239", ) ] - promises = await ledger.mint(blinded_messages_mock) + promises = await ledger.mint(blinded_messages_mock, hash=payment_hash) assert len(promises) assert promises[0].amount == 8 assert ( @@ -83,6 +84,7 @@ async def test_mint(ledger: Ledger): @pytest.mark.asyncio async def test_mint_invalid_blinded_message(ledger: Ledger): + invoice, payment_hash = await ledger.request_mint(8) blinded_messages_mock_invalid_key = [ BlindedMessage( amount=8, @@ -90,7 +92,8 @@ async def test_mint_invalid_blinded_message(ledger: Ledger): ) ] await assert_err( - ledger.mint(blinded_messages_mock_invalid_key), "invalid public key" + ledger.mint(blinded_messages_mock_invalid_key, hash=payment_hash), + "invalid public key", ) diff --git a/tests/test_wallet.py b/tests/test_wallet.py index b4e5cb07..b99427f2 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -136,15 +136,17 @@ async def test_get_keyset_ids(wallet1: Wallet): @pytest.mark.asyncio async def test_mint(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) assert wallet1.balance == 64 @pytest.mark.asyncio async def test_mint_amounts(wallet1: Wallet): """Mint predefined amounts""" + invoice = await wallet1.request_mint(64) amts = [1, 1, 1, 2, 2, 4, 16] - await wallet1.mint(amount=sum(amts), split=amts) + await wallet1.mint(amount=sum(amts), split=amts, hash=invoice.hash) assert wallet1.balance == 27 assert wallet1.proof_amounts == amts @@ -171,7 +173,8 @@ async def test_mint_amounts_wrong_order(wallet1: Wallet): @pytest.mark.asyncio async def test_split(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) assert wallet1.balance == 64 p1, p2 = await wallet1.split(wallet1.proofs, 20) assert wallet1.balance == 64 @@ -185,7 +188,8 @@ async def test_split(wallet1: Wallet): @pytest.mark.asyncio async def test_split_to_send(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) keep_proofs, spendable_proofs = await wallet1.split_to_send( wallet1.proofs, 32, set_reserved=True ) @@ -199,7 +203,8 @@ async def test_split_to_send(wallet1: Wallet): @pytest.mark.asyncio async def test_split_more_than_balance(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await assert_err( wallet1.split(wallet1.proofs, 128), # "Mint Error: inputs do not have same amount as outputs", @@ -210,7 +215,8 @@ async def test_split_more_than_balance(wallet1: Wallet): @pytest.mark.asyncio async def test_split_to_send_more_than_balance(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await assert_err( wallet1.split_to_send(wallet1.proofs, 128, set_reserved=True), "balance too low.", @@ -221,7 +227,8 @@ async def test_split_to_send_more_than_balance(wallet1: Wallet): @pytest.mark.asyncio async def test_double_spend(wallet1: Wallet): - doublespend = await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + doublespend = await wallet1.mint(64, hash=invoice.hash) await wallet1.split(wallet1.proofs, 20) await assert_err( wallet1.split(doublespend, 20), @@ -233,7 +240,8 @@ async def test_double_spend(wallet1: Wallet): @pytest.mark.asyncio async def test_duplicate_proofs_double_spent(wallet1: Wallet): - doublespend = await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + doublespend = await wallet1.mint(64, hash=invoice.hash) await assert_err( wallet1.split(wallet1.proofs + doublespend, 20), "Mint Error: proofs already pending.", @@ -244,7 +252,8 @@ async def test_duplicate_proofs_double_spent(wallet1: Wallet): @pytest.mark.asyncio async def test_send_and_redeem(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) _, spendable_proofs = await wallet1.split_to_send( wallet1.proofs, 32, set_reserved=True ) @@ -261,7 +270,8 @@ async def test_send_and_redeem(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_invalidate_unspent_proofs(wallet1: Wallet): """Try to invalidate proofs that have not been spent yet. Should not work!""" - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await wallet1.invalidate(wallet1.proofs) assert wallet1.balance == 64 @@ -269,14 +279,16 @@ async def test_invalidate_unspent_proofs(wallet1: Wallet): @pytest.mark.asyncio async def test_invalidate_unspent_proofs_without_checking(wallet1: Wallet): """Try to invalidate proofs that have not been spent yet but force no check.""" - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await wallet1.invalidate(wallet1.proofs, check_spendable=False) assert wallet1.balance == 0 @pytest.mark.asyncio async def test_split_invalid_amount(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await assert_err( wallet1.split(wallet1.proofs, -1), "amount must be positive.", @@ -285,14 +297,16 @@ async def test_split_invalid_amount(wallet1: Wallet): @pytest.mark.asyncio async def test_create_p2pk_pubkey(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey = await wallet1.create_p2pk_pubkey() PublicKey(bytes.fromhex(pubkey), raw=True) @pytest.mark.asyncio async def test_p2sh(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) _ = await wallet1.create_p2sh_address_and_store() # receiver side _, send_proofs = await wallet1.split_to_send(wallet1.proofs, 8) # sender side @@ -305,7 +319,8 @@ async def test_p2sh(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_p2sh_receive_with_wrong_wallet(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) wallet1_address = await wallet1.create_p2sh_address_and_store() # receiver side secret_lock = await wallet1.create_p2sh_lock(wallet1_address) # sender side _, send_proofs = await wallet1.split_to_send( @@ -316,7 +331,8 @@ async def test_p2sh_receive_with_wrong_wallet(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_token_state(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) assert wallet1.balance == 64 resp = await wallet1.check_proof_state(wallet1.proofs) assert resp.dict()["spendable"] @@ -382,7 +398,8 @@ async def test_generate_secrets_from_to(wallet3: Wallet): @pytest.mark.asyncio async def test_restore_wallet_after_mint(wallet3: Wallet): await reset_wallet_db(wallet3) - await wallet3.mint(64) + invoice = await wallet3.request_mint(64) + await wallet3.mint(64, hash=invoice.hash) assert wallet3.balance == 64 await reset_wallet_db(wallet3) await wallet3.load_proofs() @@ -411,7 +428,8 @@ async def test_restore_wallet_after_split_to_send(wallet3: Wallet): ) await reset_wallet_db(wallet3) - await wallet3.mint(64) + invoice = await wallet3.request_mint(64) + await wallet3.mint(64, hash=invoice.hash) assert wallet3.balance == 64 _, spendable_proofs = await wallet3.split_to_send(wallet3.proofs, 32, set_reserved=True) # type: ignore @@ -432,8 +450,8 @@ async def test_restore_wallet_after_send_and_receive(wallet3: Wallet, wallet2: W "hello rug want adapt talent together lunar method bean expose beef position" ) await reset_wallet_db(wallet3) - - await wallet3.mint(64) + invoice = await wallet3.request_mint(64) + await wallet3.mint(64, hash=invoice.hash) assert wallet3.balance == 64 _, spendable_proofs = await wallet3.split_to_send(wallet3.proofs, 32, set_reserved=True) # type: ignore @@ -472,7 +490,8 @@ async def test_restore_wallet_after_send_and_self_receive(wallet3: Wallet): ) await reset_wallet_db(wallet3) - await wallet3.mint(64) + invoice = await wallet3.request_mint(64) + await wallet3.mint(64, hash=invoice.hash) assert wallet3.balance == 64 _, spendable_proofs = await wallet3.split_to_send(wallet3.proofs, 32, set_reserved=True) # type: ignore @@ -497,7 +516,8 @@ async def test_restore_wallet_after_send_twice( wallet3.private_key = PrivateKey() await reset_wallet_db(wallet3) - await wallet3.mint(2) + invoice = await wallet3.request_mint(2) + await wallet3.mint(2, hash=invoice.hash) box.add(wallet3.proofs) assert wallet3.balance == 2 @@ -550,7 +570,8 @@ async def test_restore_wallet_after_send_and_self_receive_nonquadratic_value( ) await reset_wallet_db(wallet3) - await wallet3.mint(64) + invoice = await wallet3.request_mint(64) + await wallet3.mint(64, hash=invoice.hash) box.add(wallet3.proofs) assert wallet3.balance == 64 diff --git a/tests/test_wallet_htlc.py b/tests/test_wallet_htlc.py index 3303e099..5128b3ab 100644 --- a/tests/test_wallet_htlc.py +++ b/tests/test_wallet_htlc.py @@ -58,7 +58,8 @@ async def wallet2(mint): @pytest.mark.asyncio async def test_create_htlc_secret(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() secret = await wallet1.create_htlc_lock(preimage=preimage) @@ -67,7 +68,8 @@ async def test_create_htlc_secret(wallet1: Wallet): @pytest.mark.asyncio async def test_htlc_split(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() secret = await wallet1.create_htlc_lock(preimage=preimage) @@ -79,7 +81,8 @@ async def test_htlc_split(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_htlc_redeem_with_preimage(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" # preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() secret = await wallet1.create_htlc_lock(preimage=preimage) @@ -92,7 +95,8 @@ async def test_htlc_redeem_with_preimage(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_htlc_redeem_with_wrong_preimage(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" # preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() secret = await wallet1.create_htlc_lock(preimage=preimage[:-1] + "1") @@ -107,7 +111,8 @@ async def test_htlc_redeem_with_wrong_preimage(wallet1: Wallet, wallet2: Wallet) @pytest.mark.asyncio async def test_htlc_redeem_with_no_signature(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" pubkey_wallet1 = await wallet1.create_p2pk_pubkey() # preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() @@ -126,7 +131,8 @@ async def test_htlc_redeem_with_no_signature(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_htlc_redeem_with_wrong_signature(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" pubkey_wallet1 = await wallet1.create_p2pk_pubkey() # preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() @@ -149,7 +155,8 @@ async def test_htlc_redeem_with_wrong_signature(wallet1: Wallet, wallet2: Wallet @pytest.mark.asyncio async def test_htlc_redeem_with_correct_signature(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" pubkey_wallet1 = await wallet1.create_p2pk_pubkey() # preimage_hash = hashlib.sha256(bytes.fromhex(preimage)).hexdigest() @@ -171,7 +178,8 @@ async def test_htlc_redeem_with_correct_signature(wallet1: Wallet, wallet2: Wall async def test_htlc_redeem_hashlock_wrong_signature_timelock_correct_signature( wallet1: Wallet, wallet2: Wallet ): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() @@ -205,7 +213,8 @@ async def test_htlc_redeem_hashlock_wrong_signature_timelock_correct_signature( async def test_htlc_redeem_hashlock_wrong_signature_timelock_wrong_signature( wallet1: Wallet, wallet2: Wallet ): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) preimage = "00000000000000000000000000000000" pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() diff --git a/tests/test_wallet_p2pk.py b/tests/test_wallet_p2pk.py index db16f54a..883e64bd 100644 --- a/tests/test_wallet_p2pk.py +++ b/tests/test_wallet_p2pk.py @@ -59,14 +59,16 @@ async def wallet2(mint): @pytest.mark.asyncio async def test_create_p2pk_pubkey(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey = await wallet1.create_p2pk_pubkey() PublicKey(bytes.fromhex(pubkey), raw=True) @pytest.mark.asyncio async def test_p2pk(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # p2pk test secret_lock = await wallet1.create_p2pk_lock(pubkey_wallet2) # sender side @@ -78,7 +80,8 @@ async def test_p2pk(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_p2pk_receive_with_wrong_private_key(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # receiver side # sender side secret_lock = await wallet1.create_p2pk_lock(pubkey_wallet2) # sender side @@ -97,7 +100,8 @@ async def test_p2pk_receive_with_wrong_private_key(wallet1: Wallet, wallet2: Wal async def test_p2pk_short_locktime_receive_with_wrong_private_key( wallet1: Wallet, wallet2: Wallet ): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # receiver side # sender side secret_lock = await wallet1.create_p2pk_lock( @@ -121,7 +125,8 @@ async def test_p2pk_short_locktime_receive_with_wrong_private_key( @pytest.mark.asyncio async def test_p2pk_locktime_with_refund_pubkey(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # receiver side # sender side garbage_pubkey = PrivateKey().pubkey @@ -148,7 +153,8 @@ async def test_p2pk_locktime_with_refund_pubkey(wallet1: Wallet, wallet2: Wallet @pytest.mark.asyncio async def test_p2pk_locktime_with_wrong_refund_pubkey(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await wallet2.create_p2pk_pubkey() # receiver side # sender side garbage_pubkey = PrivateKey().pubkey @@ -182,7 +188,8 @@ async def test_p2pk_locktime_with_wrong_refund_pubkey(wallet1: Wallet, wallet2: async def test_p2pk_locktime_with_second_refund_pubkey( wallet1: Wallet, wallet2: Wallet ): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet1 = await wallet1.create_p2pk_pubkey() # receiver side pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # receiver side # sender side @@ -212,7 +219,8 @@ async def test_p2pk_locktime_with_second_refund_pubkey( @pytest.mark.asyncio async def test_p2pk_multisig_2_of_2(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() assert pubkey_wallet1 != pubkey_wallet2 @@ -232,7 +240,8 @@ async def test_p2pk_multisig_2_of_2(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_p2pk_multisig_duplicate_signature(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() assert pubkey_wallet1 != pubkey_wallet2 @@ -254,7 +263,8 @@ async def test_p2pk_multisig_duplicate_signature(wallet1: Wallet, wallet2: Walle @pytest.mark.asyncio async def test_p2pk_multisig_quorum_not_met_1_of_2(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() assert pubkey_wallet1 != pubkey_wallet2 @@ -273,7 +283,8 @@ async def test_p2pk_multisig_quorum_not_met_1_of_2(wallet1: Wallet, wallet2: Wal @pytest.mark.asyncio async def test_p2pk_multisig_quorum_not_met_2_of_3(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet1 = await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() assert pubkey_wallet1 != pubkey_wallet2 @@ -296,7 +307,8 @@ async def test_p2pk_multisig_quorum_not_met_2_of_3(wallet1: Wallet, wallet2: Wal @pytest.mark.asyncio async def test_p2pk_multisig_with_duplicate_publickey(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey_wallet2 = await wallet2.create_p2pk_pubkey() # p2pk test secret_lock = await wallet1.create_p2pk_lock( @@ -312,7 +324,8 @@ async def test_p2pk_multisig_with_duplicate_publickey(wallet1: Wallet, wallet2: async def test_p2pk_multisig_with_wrong_first_private_key( wallet1: Wallet, wallet2: Wallet ): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) await wallet1.create_p2pk_pubkey() pubkey_wallet2 = await wallet2.create_p2pk_pubkey() wrong_pubklic_key = PrivateKey().pubkey diff --git a/tests/test_wallet_p2sh.py b/tests/test_wallet_p2sh.py index 95402047..0ae72185 100644 --- a/tests/test_wallet_p2sh.py +++ b/tests/test_wallet_p2sh.py @@ -56,14 +56,16 @@ async def wallet2(mint): @pytest.mark.asyncio async def test_create_p2pk_pubkey(wallet1: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) pubkey = await wallet1.create_p2pk_pubkey() PublicKey(bytes.fromhex(pubkey), raw=True) @pytest.mark.asyncio async def test_p2sh(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) _ = await wallet1.create_p2sh_address_and_store() # receiver side _, send_proofs = await wallet1.split_to_send(wallet1.proofs, 8) # sender side @@ -76,7 +78,8 @@ async def test_p2sh(wallet1: Wallet, wallet2: Wallet): @pytest.mark.asyncio async def test_p2sh_receive_with_wrong_wallet(wallet1: Wallet, wallet2: Wallet): - await wallet1.mint(64) + invoice = await wallet1.request_mint(64) + await wallet1.mint(64, hash=invoice.hash) wallet1_address = await wallet1.create_p2sh_address_and_store() # receiver side secret_lock = await wallet1.create_p2sh_lock(wallet1_address) # sender side _, send_proofs = await wallet1.split_to_send(