From a357cd8243185f62af301f00ba8eb33d13ad07bb Mon Sep 17 00:00:00 2001 From: Ziyang Liu Date: Mon, 20 May 2024 17:08:00 -0700 Subject: [PATCH 1/2] Add integerToByteString and byteStringToInteger to V2.ParamName --- plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs b/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs index 292ea06f506..1f6ef6f5610 100644 --- a/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs +++ b/plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs @@ -190,5 +190,15 @@ data ParamName = | VerifySchnorrSecp256k1Signature'cpu'arguments'intercept | VerifySchnorrSecp256k1Signature'cpu'arguments'slope | VerifySchnorrSecp256k1Signature'memory'arguments + | IntegerToByteString'cpu'arguments'c0 + | IntegerToByteString'cpu'arguments'c1 + | IntegerToByteString'cpu'arguments'c2 + | IntegerToByteString'memory'arguments'intercept + | IntegerToByteString'memory'arguments'slope + | ByteStringToInteger'cpu'arguments'c0 + | ByteStringToInteger'cpu'arguments'c1 + | ByteStringToInteger'cpu'arguments'c2 + | ByteStringToInteger'memory'arguments'intercept + | ByteStringToInteger'memory'arguments'slope deriving stock (Eq, Ord, Enum, Ix, Bounded, Generic) deriving IsParamName via (GenericParamName ParamName) From daa47c5b8199e251cb669c95b7c060b4f6d25d9f Mon Sep 17 00:00:00 2001 From: Ziyang Liu Date: Mon, 20 May 2024 18:05:02 -0700 Subject: [PATCH 2/2] fix build --- plutus-ledger-api/test/Spec/CostModelParams.hs | 4 ++-- .../testlib/PlutusLedgerApi/Test/V2/EvaluationContext.hs | 2 ++ .../testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plutus-ledger-api/test/Spec/CostModelParams.hs b/plutus-ledger-api/test/Spec/CostModelParams.hs index 6cff19826ac..3edb933edc4 100644 --- a/plutus-ledger-api/test/Spec/CostModelParams.hs +++ b/plutus-ledger-api/test/Spec/CostModelParams.hs @@ -30,8 +30,8 @@ tests = [ testCase "length" $ do 166 @=? length v1_ParamNames 166 @=? length V1.costModelParamsForTesting - 175 @=? length v2_ParamNames - 175 @=? length V2.costModelParamsForTesting + 185 @=? length v2_ParamNames + 185 @=? length V2.costModelParamsForTesting 233 @=? length v3_ParamNames 233 @=? length V3.costModelParamsForTesting , testCase "tripping paramname" $ do diff --git a/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V2/EvaluationContext.hs b/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V2/EvaluationContext.hs index a95463039cd..e7bbec6cd2d 100644 --- a/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V2/EvaluationContext.hs +++ b/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V2/EvaluationContext.hs @@ -52,4 +52,6 @@ clearBuiltinCostModel r = r { paramSerialiseData = mempty , paramVerifyEcdsaSecp256k1Signature = mempty , paramVerifySchnorrSecp256k1Signature = mempty + , paramIntegerToByteString = mempty + , paramByteStringToInteger = mempty } diff --git a/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs b/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs index e4e7e74c3ed..62ae7ccab21 100644 --- a/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs +++ b/plutus-ledger-api/testlib/PlutusLedgerApi/Test/V3/EvaluationContext.hs @@ -67,6 +67,4 @@ clearBuiltinCostModel r = r , paramBls12_381_finalVerify = mempty , paramKeccak_256 = mempty , paramBlake2b_224 = mempty - , paramIntegerToByteString = mempty - , paramByteStringToInteger = mempty }