From 8905669520ec0cd7ec984bfd0259f6b68c3e25df Mon Sep 17 00:00:00 2001 From: saratomaz Date: Wed, 8 May 2024 15:47:23 +0100 Subject: [PATCH] Add V3 plutus scripts tests --- .../v3/alwaysFailsPolicyScriptV3.plutus | 5 ++ .../v3/alwaysSucceedSpendScriptV3.plutus | 5 ++ .../tests/data/plutus/v3/blsMint.plutus | 5 ++ .../tests/data/plutus/v3/blsSpend.plutus | 5 ++ .../v3/mintTokenNamePolicyScriptV3.plutus | 5 ++ .../plutus/v3/timeRangePolicyScriptV3.plutus | 5 ++ .../v3/verifyEcdsaPolicyScriptV3.plutus | 5 ++ .../v3/verifySchnorrPolicyScriptV3.plutus | 5 ++ .../v3/witnessRedeemerPolicyScriptV3.plutus | 5 ++ cardano_node_tests/tests/plutus_common.py | 56 +++++++++++++++++++ .../tests/tests_plutus/test_mint_build.py | 17 +++++- .../tests_plutus/test_mint_negative_build.py | 32 +++++++++-- .../tests_plutus/test_mint_negative_raw.py | 12 +++- .../tests/tests_plutus/test_spend_build.py | 24 +++++--- .../tests_plutus/test_spend_negative_build.py | 10 ++-- .../tests_plutus/test_spend_negative_raw.py | 12 ++-- .../tests/tests_plutus/test_spend_raw.py | 24 ++++---- .../test_mint_secp256k1_build.py | 12 ++-- .../test_mint_secp256k1_raw.py | 12 ++-- 19 files changed, 210 insertions(+), 46 deletions(-) create mode 100644 cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/blsMint.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus diff --git a/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus new file mode 100644 index 000000000..7e67d744e --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "4b4a010100225968c0022c01" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus new file mode 100644 index 000000000..a9b930f56 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "484701010022280001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus b/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus new file mode 100644 index 000000000..92c46c254 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590a0c590a090101003232323232323232323232322259323232333573466ee4cddc00180099bb6001337709000000c0020046eed2213097f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb003232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302623232325333573466e1d20000021800980e9aba100198029aba1357440021303203135573c0046aae74004dd5000998130009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c094d5d0800ccc08c8c8c8c94ccd5cd19b8748000008600260526ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260740726aae78008d55ce8009baa001357426ae880042606c06a6aae78008d55ce8009baa357420073007357420053232325333573466e1d200000218000a999ab9a3370e90010010c014dd71aba10010a999ab9a3370e90020010c00cd5d080084c0d80d4d55cf0011aab9d00137546ae8400666040eb8d5d09aba20011aba200135744002260620606aae78008d55ce8009baa001375a6ae8403cc004d5d0807180118013ad330240183574201866602c036eb4d5d08059919192999ab9a3370e90000010c004c8c8c94ccd5cd19b874800000860026605ceb4d5d0800cc0b4d5d09aba2001098190189aab9e00235573a0026ea8d5d0800cc8c8c94ccd5cd19b874800000860026605ceb4d5d0800cc0b4d5d09aba2001098190189aab9e00235573a0026ea8d5d09aba2001098178171aab9e00235573a0026ea8d5d0805198123ae3574201266602c02804c6ae84020cc008098d5d080398151aba100633301601a3301602923232325333573466e1d200000218010a999ab9a3370e90010010c01054ccd5cd19b874801000860002606005e6aae78008d55ce8009baa0013574200a6604802a6ae84010c004d5d080198009aba1357440066030eb4c051d71aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200135744002260380366aae78008d55ce8009baa357420133001357426ae880244646464a666ae68cdc3a40000043003375c6ae840042a666ae68cdc3a4004004300930073574200215333573466e1d2004002180398059aba10010a999ab9a3370e90030010c004dd69aba100198041aba13574400215333573466e1d2008002180598051aba10010a999ab9a3370e90050010c014dd69aba100198029aba1357440021301c01b35573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298059aba10019919192999ab9a3370e90000010994024cc034074d5d08014d5d0800ccc035d71aba135744002357440022a666ae68cdc3a400400430013300c01c357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c088084d55cf0011aab9d00137546ae84d5d1000854ccd5cd19b8748010008601666601201ceb4d5d0800ccc031d71aba13574400215333573466e1d200600218039980600e1aba10010a999ab9a3370e9004001099194034cc038078d5d0801ccc064040d5d08014ccc02c041d69aba1001c9919192999ab9a3370e90000010c004dd69aba10019bad357426ae88004260480466aae78008d55ce8009baa357426ae8800644660320040021aba2001357440022a666ae68cdc3a401400430053300c01c357420033232325333573466e1d200000213300f75c6ae840044c088084d55cf0011aab9d00137546ae84d5d1000854ccd5cd19b874803000860042603e03c6aae78008d55ce8009baa357426ae880046ae880044c06c068d55cf0011aab9d00137540024464460046eac004c06488cccd55cf800940008ca007001300635573a003300535573c00298021aba20031aba100280011919192999ab9a3370e90000010c004c05cd5d0800cdd69aba1357440021301901835573c0046aae74004dd500091919192999ab9a3370e90000010c034c01cd5d0800ccc015d69aba13574400215333573466e1d2002002180998039aba100199802bad357426ae880042a64666ae68cdc3a400800630033008357420053001357426ae880082a666ae68cdc3a400c00626500b300935742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c020d5d08014dd69aba13574400415333573466e1d200a003180a98041aba10020a999ab9a3370e90060018c044c020d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098041aba100298041aba13574400415333573466e1d2014003180798041aba10020980c80c11919192999ab9a3370e90000010c004dd71aba10010a99199ab9a3370e90010018c014c004d5d0801054ccd5cd19b874801000c60066eb8d5d08014c004d5d09aba20020980e80e11919192999ab9a3370e90000010c004c03cd5d0800854ccd5cd19b874800800860042a666ae68cdc3a400800430041302001f35573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980c00b9aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000086002600a6ae840042a666ae68cdc3a4004004300330053574200215333573466e1d200400218029bae357420021301601535573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980a80a1aab9e00235573a0026ea80044c044040d55cf0011aab9d00137540046eb400a300089806a481035054350018059112999ab9a3370e00200c2c2a666ae68cdc400080309980199b810060023370200c002265001337080060033370800400233004002001300a2225333573466e1c00401440084cc00c004cdc3001000919118011bac001300a2233335573e0025000280198021aba100298019aba200240012000200123232325333573466e1d200000218010a999ab9a3370e90010010c0004c024020d55cf0011aab9d001375400244646464a666ae68cdc3a4000004300215333573466e1d2002002180098029aba10010a999ab9a3370e90020010c0104c024020d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300535742003375a6ae84d5d100084c01c018d55cf0011aab9d00137540024646464a666ae68cdc3a400000426eb8d5d0800898030029aab9e00235573a0026ea80052401035054310023263357380030002323001001223300330020020011" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus b/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus new file mode 100644 index 000000000..fefa382d4 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590a10590a0d0101003232323232323232323232322225932323232333573466ee4cddc00200099bb6001337700060030008011bbb48813097f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb003232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302823232325333573466e1d20000021800980e9aba100198029aba1357440021303403335573c0046aae74004dd5000998140009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c094d5d0800ccc08c8c8c8c94ccd5cd19b8748000008600260526ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260780766aae78008d55ce8009baa001357426ae880042607006e6aae78008d55ce8009baa357420073007357420053232325333573466e1d200000218000a999ab9a3370e90010010c014dd71aba10010a999ab9a3370e90020010c00cd5d080084c0e00dcd55cf0011aab9d00137546ae8400666040eb8d5d09aba20011aba200135744002260660646aae78008d55ce8009baa001375a6ae8403cc004d5d080718009800bad330260183574201866602c036eb4d5d08059919192999ab9a3370e90000010c004c8c8c94ccd5cd19b8748000008600266060eb4d5d0800cc0bcd5d09aba20010981a0199aab9e00235573a0026ea8d5d0800cc8c8c94ccd5cd19b8748000008600266060eb4d5d0800cc0bcd5d09aba20010981a0199aab9e00235573a0026ea8d5d09aba2001098188181aab9e00235573a0026ea8d5d0805198133ae3574201266602c0280506ae84020cc0040a0d5d080398161aba100633301601a3301602b23232325333573466e1d200000218010a999ab9a3370e90010010c01054ccd5cd19b87480100086000260640626aae78008d55ce8009baa0013574200a6604c02a6ae84010c008d5d080198011aba135744006602aeb8c05dd69aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440022603c03a6aae78008d55ce8009baa357420133001357426ae880244646464a666ae68cdc3a40000043003375c6ae840042a666ae68cdc3a4004004300930073574200215333573466e1d2004002180398059aba10010a999ab9a3370e90030010c004dd69aba100198041aba13574400215333573466e1d2008002180598051aba10010a999ab9a3370e90050010c014dd69aba100198029aba1357440021301e01d35573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298059aba10019919192999ab9a3370e90000010994024cc03407cd5d08014d5d0800ccc035d71aba135744002357440022a666ae68cdc3a400400430013300c01e357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c09008cd55cf0011aab9d00137546ae84d5d1000854ccd5cd19b8748010008601666601201ceb4d5d0800ccc031d71aba13574400215333573466e1d200600218039980600f1aba10010a999ab9a3370e9004001099194034cc038080d5d0801ccc06c040d5d08014ccc02c041d69aba1001c9919192999ab9a3370e90000010c004dd69aba10019bad357426ae880042604c04a6aae78008d55ce8009baa357426ae8800644660360040021aba2001357440022a666ae68cdc3a401400430053300c01e357420033232325333573466e1d200000213300f75c6ae840044c09008cd55cf0011aab9d00137546ae84d5d1000854ccd5cd19b87480300086004260420406aae78008d55ce8009baa357426ae880046ae880044c074070d55cf0011aab9d00137540024464460046eac004c06c88cccd55cf800940008ca007001300635573a003300535573c00298021aba20031aba100280011919192999ab9a3370e90000010c004c064d5d0800cdd69aba1357440021301b01a35573c0046aae74004dd500091919192999ab9a3370e90000010c034c01cd5d0800ccc015d69aba13574400215333573466e1d2002002180998039aba100199802bad357426ae880042a64666ae68cdc3a400800630033008357420053001357426ae880082a666ae68cdc3a400c00626500b300935742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c020d5d08014dd69aba13574400415333573466e1d200a003180a98041aba10020a999ab9a3370e90060018c044c020d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098041aba100298041aba13574400415333573466e1d2014003180798041aba10020980d80d11919192999ab9a3370e90000010c004dd71aba10010a99199ab9a3370e90010018c014c004d5d0801054ccd5cd19b874801000c60066eb8d5d08014c004d5d09aba20020980f80f11919192999ab9a3370e90000010c004c03cd5d0800854ccd5cd19b874800800860042a666ae68cdc3a400800430041302202135573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980d00c9aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000086002600a6ae840042a666ae68cdc3a4004004300330053574200215333573466e1d200400218029bae357420021301801735573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980b80b1aab9e00235573a0026ea80044c04c048d55cf0011aab9d00137540066eb400cdd6801c60011300e491035054350018059112999ab9a3370e00200c2c2a666ae68cdc400080309980199b810060023370200c002265001337080060033370800400233004002001300a2225333573466e1c00401440084cc00c004cdc3001000919118011bac001300a2233335573e0025000280198021aba100298019aba200240012000200123232325333573466e1d200000218010a999ab9a3370e90010010c0004c024020d55cf0011aab9d001375400244646464a666ae68cdc3a4000004300215333573466e1d2002002180098029aba10010a999ab9a3370e90020010c0104c024020d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300535742003375a6ae84d5d100084c01c018d55cf0011aab9d00137540024646464a666ae68cdc3a400000426eb8d5d0800898030029aab9e00235573a0026ea80052401035054310023263357380030002323001001223300330020020011" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus new file mode 100644 index 000000000..d94a24b31 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "587f587d0101003223225333573466e24c8c8cc0188964006290004886400a44a666ae68cdc780100389805000898030018005200522900193480064d269348989001914801488888888888888880304800060043000300222590018a40012219002912999ab9a3371e00400e20022600c00611918008009119801980100100081" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus new file mode 100644 index 000000000..463dd0b67 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590265590262010100323232232232532323232933300100900b0058c0022b266600201201600f180146401e45200f225323293330020119006912c800c400a2b20052180099806809000a200510021200922590018801456400a430013300d0120014400a200422a00318014540042b2666002021200522590018801456400a430013300b0110014400a20042401244b200310028ac801486002660160220028801440084600118014600022253232900490a801456400e430048c00230044540042b20052150028c00a2a00215900290ac801484ccc02c0140080062d180222d15900190c00a2d1800004452003229002912994801454c8ca401642a0051328012801c540042b2a0052150028c0022a00215900390aca80148564ccc02c02400800630028c002300245a300245a2b2a0032180045a300222b2007213259500390ac999806005001000c60051800460048c002300219806004800c4ca004a003159500190c00230008c0080c801c8964006200515900290c004cc0300280051002880100a40064444444400e29001911110020a40064444400a900191480148888888888888888024800c0060058003001800800b00020020032337020029001480064003323001001223225333573466e2400c00460060073300230050030010c000c008008466e01200200180091199ab9a3370e0040030008014894ccd5cd19b8700200118000a999ab9a3371200400230041801488ccd5cd19b88002001800400a44666ae68cdc4801000c00200522333573466e2400800600500091199ab9a337100040030028004894ccd5cd19b8900200110011002912999ab9a33712004002200420021" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus new file mode 100644 index 000000000..316c5edc9 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "58ba58b801010032229003911199ab9a3337680060040030008010ccccd448800888a002007002800884a400a0024881210392d7b94bc6a11c335a043ee1ff326b6eacee6230d3685861cd62bce350a172e00048812016e0bf1f85594a11e75030981c0b670370b3ad83a43f49ae58a2fd6f6513cde9004881405fb12954b28be6456feb080cfb8467b6f5677f62eb9ad231de7a575f4b6857512754fb5ef7e0e60e270832e7bb0e2f0dc271012fa9c46c02504aa0e798be62950001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus new file mode 100644 index 000000000..b291da005 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "58d958d701010032229003911199ab9a33376a0060040030008010ccccd448800888a002007002800884a400a002488120599de3e582e2a3779208a210dfeae8f330b9af00a47a7fb22e9bb8ef596f301b0048814030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030004881405a56da88e6fd8419181dec4d3dd6997bab953d2fc71ab65e23cfc9e7e3d1a310613454a60f6703819a39fdac2a410a094442afd1fc083354443e8d8bb4461a9b0001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus new file mode 100644 index 000000000..f734ec8db --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "583858360101002322900191480148888888888888888c0500203230010012232590028c00a442a666ae68cdc78030010c0004c00c0046004005" +} diff --git a/cardano_node_tests/tests/plutus_common.py b/cardano_node_tests/tests/plutus_common.py index 168eebf63..935031265 100644 --- a/cardano_node_tests/tests/plutus_common.py +++ b/cardano_node_tests/tests/plutus_common.py @@ -32,6 +32,9 @@ SECP256K1_LOOP_ECDSA_PLUTUS_V2 = SCRIPTS_V2_DIR / "ecdsa-secp256k1-loop.plutus" SECP256K1_LOOP_SCHNORR_PLUTUS_V2 = SCRIPTS_V2_DIR / "schnorr-secp256k1-loop.plutus" +ALWAYS_SUCCEEDS_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysSucceedSpendScriptV3.plutus" +ALWAYS_FAILS_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysFailsPolicyScriptV3.plutus" + MINTING_PLUTUS_V1 = SCRIPTS_V1_DIR / "anyone-can-mint.plutus" MINTING_TIME_RANGE_PLUTUS_V1 = SCRIPTS_V1_DIR / "time_range.plutus" MINTING_CONTEXT_EQUIVALENCE_PLUTUS_V1 = SCRIPTS_V1_DIR / "minting-context-equivalence-test.plutus" @@ -47,6 +50,10 @@ MINTING_SECP256K1_SCHNORR_PLUTUS_V2 = SCRIPTS_V2_DIR / "secp256k1-schnorr-policy.plutus" MINTING_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysSucceedPolicyScriptV3.plutus" +MINTING_SECP256K1_ECDSA_PLUTUS_V3 = SCRIPTS_V3_DIR / "verifyEcdsaPolicyScriptV3.plutus" +MINTING_SECP256K1_SCHNORR_PLUTUS_V3 = SCRIPTS_V3_DIR / "verifySchnorrPolicyScriptV3.plutus" +MINTING_TIME_RANGE_PLUTUS_V3 = SCRIPTS_V3_DIR / "timeRangePolicyScriptV3.plutus" +MINTING_WITNESS_REDEEMER_PLUTUS_V3 = SCRIPTS_V3_DIR / "witnessRedeemerPolicyScriptV3.plutus" STAKE_GUESS_42_PLUTUS_V1 = SCRIPTS_V1_DIR / "guess-42-stake.plutus" @@ -100,6 +107,9 @@ class ExecutionCost: per_time=430_445_916, per_space=128_584, fixed_cost=38_455 ) +ALWAYS_FAILS_V3_COST = ExecutionCost(per_time=230_100, per_space=1_100, fixed_cost=81) +ALWAYS_SUCCEEDS_V3_COST = ExecutionCost(per_time=230_100, per_space=1_100, fixed_cost=81) + MINTING_COST = ExecutionCost(per_time=259_868_784, per_space=978_434, fixed_cost=74_960) MINTING_TIME_RANGE_COST = ExecutionCost( per_time=277_239_670, per_space=1_044_064, fixed_cost=80_232 @@ -150,6 +160,11 @@ class PlutusScriptData: script_type=clusterlib.ScriptTypes.PLUTUS_V2, execution_cost=ALWAYS_FAILS_V2_COST, ), + "v3": PlutusScriptData( + script_file=ALWAYS_FAILS_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=ALWAYS_FAILS_V3_COST, + ), } ALWAYS_SUCCEEDS = { @@ -163,6 +178,11 @@ class PlutusScriptData: script_type=clusterlib.ScriptTypes.PLUTUS_V2, execution_cost=ALWAYS_SUCCEEDS_V2_COST, ), + "v3": PlutusScriptData( + script_file=ALWAYS_SUCCEEDS_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=ALWAYS_SUCCEEDS_V3_COST, + ), } GUESSING_GAME = { @@ -209,6 +229,42 @@ class PlutusScriptData: ), } +MINTING_WITNESS_REDEEMER = { + "v1": PlutusScriptData( + script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_WITNESS_REDEEMER_COST, + ), + "v3": PlutusScriptData( + script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_WITNESS_REDEEMER_COST, + ), +} + +MINTING_TIME_RANGE = { + "v1": PlutusScriptData( + script_file=MINTING_TIME_RANGE_PLUTUS_V1, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_TIME_RANGE_COST, + ), + "v3": PlutusScriptData( + script_file=MINTING_TIME_RANGE_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=MINTING_TIME_RANGE_COST, + ), +} + +MINTING_SECP256K1_ECDSA = { + "v2": MINTING_SECP256K1_ECDSA_PLUTUS_V2, + "v3": MINTING_SECP256K1_ECDSA_PLUTUS_V3, +} + +MINTING_SECP256K1_SCHNORR = { + "v2": MINTING_SECP256K1_SCHNORR_PLUTUS_V2, + "v3": MINTING_SECP256K1_SCHNORR_PLUTUS_V3, +} + @dataclasses.dataclass(frozen=True, order=True) class PlutusOp: diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_build.py index 7f024a1f9..23feb5f86 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_build.py @@ -241,12 +241,21 @@ def test_minting_one_token( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.testnets @submit_utils.PARAM_SUBMIT_METHOD def test_time_range_minting( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, submit_method: str, ): """Test minting a token with a time constraints Plutus script. @@ -270,8 +279,10 @@ def test_time_range_minting( token_amount = 5 script_fund = 200_000_000 + plutus_script = plutus_common.MINTING_TIME_RANGE[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_TIME_RANGE_COST, + execution_cost=plutus_script.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -301,7 +312,7 @@ def test_time_range_minting( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + policyid = cluster.g_transaction.get_policyid(plutus_script.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -311,7 +322,7 @@ def test_time_range_minting( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=plutus_script.script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py index 337b09ca4..791b1fc54 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py @@ -89,11 +89,20 @@ def fund_issuer_long_asset_name( @allure.link(helpers.get_vcs_link()) @pytest.mark.testnets + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @submit_utils.PARAM_SUBMIT_METHOD def test_witness_redeemer_missing_signer( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, submit_method: str, ): """Test minting a token with a Plutus script with invalid signers. @@ -134,7 +143,7 @@ def test_witness_redeemer_missing_signer( # Step 2: mint the "qacoin" policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1 + plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file ) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" @@ -145,7 +154,7 @@ def test_witness_redeemer_missing_signer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_file=plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file, collaterals=collateral_utxos, redeemer_file=plutus_common.DATUM_WITNESS_GOLDEN_NORMAL, ) @@ -356,9 +365,20 @@ def test_asset_name_too_long( ), min_req_utxo_error @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.testnets def test_time_range_missing_tx_validity( - self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord] + self, + cluster: clusterlib.ClusterLib, + payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a time constraints Plutus script and no TX validity. @@ -407,7 +427,9 @@ def test_time_range_missing_tx_validity( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + script_file = plutus_common.MINTING_TIME_RANGE[plutus_version].script_file + + policyid = cluster.g_transaction.get_policyid(script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -417,7 +439,7 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py index 1cbc5247e..c9d96f451 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py @@ -497,11 +497,21 @@ def test_execution_units_above_limit( assert "ExUnitsTooBigUTxO" in err_str, err_str @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) + @pytest.mark.testnets @pytest.mark.testnets def test_time_range_missing_tx_validity( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a time constraints Plutus script and no TX validity. @@ -557,7 +567,7 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=plutus_common.MINTING_TIME_RANGE[plutus_version].script_file, collaterals=collateral_utxos, execution_units=( plutus_common.MINTING_TIME_RANGE_COST.per_time, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_build.py index 6375a75a8..26fd756cd 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_build.py @@ -83,7 +83,7 @@ class TestBuildLocking: @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_locking( self, cluster: clusterlib.ClusterLib, @@ -634,10 +634,12 @@ def test_two_scripts_spending( ) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_always_fails( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test locking a Tx output with a Plutus script and spending the locked UTxO. @@ -653,11 +655,13 @@ def test_always_fails( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) + plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_script.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_script.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( @@ -686,10 +690,12 @@ def test_always_fails( assert helpers.is_in_interval(tx_output_fund.fee, expected_fee_fund, frac=0.15) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_script_invalid( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test failing script together with the `--script-invalid` argument - collateral is taken. @@ -705,11 +711,13 @@ def test_script_invalid( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) + plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_script.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_script.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( @@ -759,7 +767,7 @@ def test_script_invalid( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_token_locking( self, cluster: clusterlib.ClusterLib, @@ -836,7 +844,7 @@ def test_txout_token_locking( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_partial_spending( self, cluster: clusterlib.ClusterLib, @@ -959,7 +967,7 @@ def test_partial_spending( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_is_txin( self, cluster: clusterlib.ClusterLib, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py index 4ba71d3b7..6b840e3d2 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py @@ -164,7 +164,7 @@ def test_no_script( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_w_tokens( self, cluster: clusterlib.ClusterLib, @@ -233,7 +233,7 @@ def test_collateral_w_tokens( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_same_collateral_txin( self, cluster: clusterlib.ClusterLib, @@ -373,7 +373,7 @@ def test_invalid_guessing_game( assert "The Plutus script evaluation failed" in err_str, err_str @allure.link(helpers.get_vcs_link()) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_two_scripts_spending_one_fail( self, cluster: clusterlib.ClusterLib, @@ -403,10 +403,10 @@ def test_two_scripts_spending_one_fail( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) plutus_op2 = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) # Step 1: fund the Plutus scripts diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py b/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py index b6686726a..e716f1934 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py @@ -279,7 +279,7 @@ def test_no_script( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_w_tokens( self, cluster: clusterlib.ClusterLib, @@ -344,7 +344,7 @@ def test_collateral_w_tokens( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_same_collateral_txin( self, cluster: clusterlib.ClusterLib, @@ -396,7 +396,7 @@ def test_same_collateral_txin( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_percent( self, cluster: clusterlib.ClusterLib, @@ -452,7 +452,7 @@ def test_collateral_percent( assert "InsufficientCollateral" in err_str, err_str @allure.link(helpers.get_vcs_link()) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_two_scripts_spending_one_fail( self, cluster: clusterlib.ClusterLib, @@ -480,10 +480,10 @@ def test_two_scripts_spending_one_fail( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) plutus_op2 = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) # Step 1: fund the Plutus scripts diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_raw.py b/cardano_node_tests/tests/tests_plutus/test_spend_raw.py index 1bb0364ce..24c613381 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_raw.py @@ -135,7 +135,7 @@ class TestLocking: @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_locking( self, cluster: clusterlib.ClusterLib, @@ -629,10 +629,12 @@ def test_two_scripts_spending( dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_output_redeem) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_always_fails( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test locking a Tx output with a Plutus script and spending the locked UTxO. @@ -649,10 +651,10 @@ def test_always_fails( amount = 2_000_000 plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, - redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) script_utxos, collateral_utxos, __ = spend_raw._fund_script( @@ -685,10 +687,12 @@ def test_always_fails( assert "PlutusFailure" in err, err @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_script_invalid( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test failing script together with the `--script-invalid` argument - collateral is taken. @@ -703,10 +707,10 @@ def test_script_invalid( amount = 2_000_000 plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, - redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) script_utxos, collateral_utxos, __ = spend_raw._fund_script( @@ -748,7 +752,7 @@ def test_script_invalid( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_token_locking( self, cluster: clusterlib.ClusterLib, @@ -809,7 +813,7 @@ def test_txout_token_locking( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_partial_spending( self, cluster: clusterlib.ClusterLib, @@ -899,7 +903,7 @@ def test_partial_spending( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync @pytest.mark.parametrize("scenario", ("max", "max+1", "none")) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collaterals( self, cluster: clusterlib.ClusterLib, diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py index 7fbb10d0b..6280a783d 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py @@ -134,12 +134,14 @@ def _fund_issuer_mint_token( common.check_missing_utxos(cluster_obj=cluster_obj, utxos=out_utxos) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize("algorithm", ("ecdsa", "schnorr")) def test_use_secp_builtin_functions( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], algorithm: str, + plutus_version: str, ): """Test that is possible to use the two SECP256k1 builtin functions. @@ -151,9 +153,9 @@ def test_use_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( @@ -203,6 +205,7 @@ def test_use_secp_builtin_functions( raise @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize( "test_vector", ("invalid_sig", "invalid_pubkey", "no_msg", "no_pubkey", "no_sig"), @@ -214,6 +217,7 @@ def test_negative_secp_builtin_functions( payment_addrs: tp.List[clusterlib.AddressRecord], test_vector: str, algorithm: str, + plutus_version: str, ): """Try to mint a token with invalid test vectors. @@ -222,9 +226,9 @@ def test_negative_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py index c0ac983a1..aca8377bd 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py @@ -136,12 +136,14 @@ def _fund_issuer_mint_token( common.check_missing_utxos(cluster_obj=cluster_obj, utxos=out_utxos) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize("algorithm", ("ecdsa", "schnorr")) def test_use_secp_builtin_functions( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], algorithm: str, + plutus_version: str, ): """Test that is possible to use the two SECP256k1 builtin functions. @@ -152,9 +154,9 @@ def test_use_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( @@ -180,6 +182,7 @@ def test_use_secp_builtin_functions( raise @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize( "test_vector", ("invalid_sig", "invalid_pubkey", "no_msg", "no_pubkey", "no_sig"), @@ -191,6 +194,7 @@ def test_negative_secp_builtin_functions( payment_addrs: tp.List[clusterlib.AddressRecord], test_vector: str, algorithm: str, + plutus_version: str, ): """Try to mint a token with invalid test vectors. @@ -199,9 +203,9 @@ def test_negative_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = (