Skip to content

Commit

Permalink
Test CI on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspider committed Jun 19, 2024
1 parent d97ff41 commit dc0d935
Showing 1 changed file with 80 additions and 78 deletions.
158 changes: 80 additions & 78 deletions tests_perf/test_perf_sign_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def sign_tx():
def test_perf_sign_psbt_singlesig_pkh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# PSBT for a legacy 2-output spend (1 change address)

assert False

wallet_policy = WalletPolicy(
"",
"pkh(@0/**)",
Expand All @@ -79,81 +81,81 @@ def test_perf_sign_psbt_singlesig_pkh(client: Client, n_inputs: int, speculos_gl
run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


@pytest.mark.parametrize("n_inputs", [1, 3, 10])
def test_perf_sign_psbt_singlesig_wpkh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# PSBT for a segwit 2-output spend (1 change address)

wallet_policy = WalletPolicy(
"",
"wpkh(@0/**)",
[
"[f5acc2fd/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P"
],
)

run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


@pytest.mark.parametrize("n_inputs", [1, 3, 10])
def test_perf_sign_psbt_singlesig_tr(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# PSBT for a taproot 2-output spend (1 change address)

wallet_policy = WalletPolicy(
name="",
descriptor_template="tr(@0/**)",
keys_info=[
f"[f5acc2fd/86'/1'/0']tpubDDKYE6BREvDsSWMazgHoyQWiJwYaDDYPbCFjYxN3HFXJP5fokeiK4hwK5tTLBNEDBwrDXn8cQ4v9b2xdW62Xr5yxoQdMu1v6c7UDXYVH27U",
],
)

run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


@pytest.mark.parametrize("n_inputs", [1, 3, 10])
def test_perf_sign_psbt_multisig2of3_wsh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
wallet_policy = WalletPolicy(
name="Cold storage",
descriptor_template="wsh(sortedmulti(2,@0/**,@1/**,@2/**))",
keys_info=[
"[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
"tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
"tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh"
],
)

run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


@pytest.mark.parametrize("n_inputs", [1, 3, 10])
def test_perf_sign_psbt_multisig3of5_wsh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
wallet_policy = WalletPolicy(
name="Cold storage",
descriptor_template="wsh(sortedmulti(3,@0/**,@1/**,@2/**,@3/**,@4/**))",
keys_info=[
"[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
"tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
"tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh",
"tpubDD3ULTdBbyuMMMs8BCsJKgZgEnZjjbsbtV6ig3xtkQnaSc1gu9kNhmDDEW49HoLzDNA4y2TMqRzj4BugrrtcpXkjoHSoMVhJwfZLUFmv6yn",
"tpubDDyh1VAY2sHfGHE59muC5PWa3tosSTm62sNTDSmZUsx9TbyBdoVkZibYZuDoqJ8dJ6v6eYZz6SE1d6sDv45NgJFB1oqCLGzyiQBGyjexc7V"
],
)

run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


@pytest.mark.parametrize("n_inputs", [1, 3, 10])
def test_perf_sign_psbt_tapminiscript_2paths(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# A taproot miniscript policy where the two placeholders (in different spending paths) are internal
# The app signs for both spending paths.
wallet_policy = WalletPolicy(
name="Cold storage",
descriptor_template="wsh(or_d(multi(4,@0/<0;1>/*,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*),and_v(v:thresh(3,pkh(@0/<2;3>/*),a:pkh(@1/<2;3>/*),a:pkh(@2/<2;3>/*),a:pkh(@3/<2;3>/*)),older(65535))))",
keys_info=[
"[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
"tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
"tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh",
"tpubDD3ULTdBbyuMMMs8BCsJKgZgEnZjjbsbtV6ig3xtkQnaSc1gu9kNhmDDEW49HoLzDNA4y2TMqRzj4BugrrtcpXkjoHSoMVhJwfZLUFmv6yn",
],
)

run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)
# @pytest.mark.parametrize("n_inputs", [1, 3, 10])
# def test_perf_sign_psbt_singlesig_wpkh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# # PSBT for a segwit 2-output spend (1 change address)

# wallet_policy = WalletPolicy(
# "",
# "wpkh(@0/**)",
# [
# "[f5acc2fd/84'/1'/0']tpubDCtKfsNyRhULjZ9XMS4VKKtVcPdVDi8MKUbcSD9MJDyjRu1A2ND5MiipozyyspBT9bg8upEp7a8EAgFxNxXn1d7QkdbL52Ty5jiSLcxPt1P"
# ],
# )

# run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


# @pytest.mark.parametrize("n_inputs", [1, 3, 10])
# def test_perf_sign_psbt_singlesig_tr(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# # PSBT for a taproot 2-output spend (1 change address)

# wallet_policy = WalletPolicy(
# name="",
# descriptor_template="tr(@0/**)",
# keys_info=[
# f"[f5acc2fd/86'/1'/0']tpubDDKYE6BREvDsSWMazgHoyQWiJwYaDDYPbCFjYxN3HFXJP5fokeiK4hwK5tTLBNEDBwrDXn8cQ4v9b2xdW62Xr5yxoQdMu1v6c7UDXYVH27U",
# ],
# )

# run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


# @pytest.mark.parametrize("n_inputs", [1, 3, 10])
# def test_perf_sign_psbt_multisig2of3_wsh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# wallet_policy = WalletPolicy(
# name="Cold storage",
# descriptor_template="wsh(sortedmulti(2,@0/**,@1/**,@2/**))",
# keys_info=[
# "[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
# "tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
# "tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh"
# ],
# )

# run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


# @pytest.mark.parametrize("n_inputs", [1, 3, 10])
# def test_perf_sign_psbt_multisig3of5_wsh(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# wallet_policy = WalletPolicy(
# name="Cold storage",
# descriptor_template="wsh(sortedmulti(3,@0/**,@1/**,@2/**,@3/**,@4/**))",
# keys_info=[
# "[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
# "tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
# "tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh",
# "tpubDD3ULTdBbyuMMMs8BCsJKgZgEnZjjbsbtV6ig3xtkQnaSc1gu9kNhmDDEW49HoLzDNA4y2TMqRzj4BugrrtcpXkjoHSoMVhJwfZLUFmv6yn",
# "tpubDDyh1VAY2sHfGHE59muC5PWa3tosSTm62sNTDSmZUsx9TbyBdoVkZibYZuDoqJ8dJ6v6eYZz6SE1d6sDv45NgJFB1oqCLGzyiQBGyjexc7V"
# ],
# )

# run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)


# @pytest.mark.parametrize("n_inputs", [1, 3, 10])
# def test_perf_sign_psbt_tapminiscript_2paths(client: Client, n_inputs: int, speculos_globals: SpeculosGlobals, benchmark):
# # A taproot miniscript policy where the two placeholders (in different spending paths) are internal
# # The app signs for both spending paths.
# wallet_policy = WalletPolicy(
# name="Cold storage",
# descriptor_template="wsh(or_d(multi(4,@0/<0;1>/*,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*),and_v(v:thresh(3,pkh(@0/<2;3>/*),a:pkh(@1/<2;3>/*),a:pkh(@2/<2;3>/*),a:pkh(@3/<2;3>/*)),older(65535))))",
# keys_info=[
# "[f5acc2fd/48'/1'/0'/2']tpubDFAqEGNyad35aBCKUAXbQGDjdVhNueno5ZZVEn3sQbW5ci457gLR7HyTmHBg93oourBssgUxuWz1jX5uhc1qaqFo9VsybY1J5FuedLfm4dK",
# "tpubDE7NQymr4AFtewpAsWtnreyq9ghkzQBXpCZjWLFVRAvnbf7vya2eMTvT2fPapNqL8SuVvLQdbUbMfWLVDCZKnsEBqp6UK93QEzL8Ck23AwF",
# "tpubDF4kujkh5dAhC1pFgBToZybXdvJFXXGX4BWdDxWqP7EUpG8gxkfMQeDjGPDnTr9e4NrkFmDM1ocav3Jz6x79CRZbxGr9dzFokJLuvDDnyRh",
# "tpubDD3ULTdBbyuMMMs8BCsJKgZgEnZjjbsbtV6ig3xtkQnaSc1gu9kNhmDDEW49HoLzDNA4y2TMqRzj4BugrrtcpXkjoHSoMVhJwfZLUFmv6yn",
# ],
# )

# run_test(client, wallet_policy, n_inputs, speculos_globals, benchmark)

0 comments on commit dc0d935

Please sign in to comment.