Skip to content

Commit

Permalink
Add integerToByteString and byteStringToInteger to V2.ParamName (#6065)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 authored and effectfully committed Aug 6, 2024
1 parent 2879359 commit 7a720e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions plutus-ledger-api/src/PlutusLedgerApi/V2/ParamName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions plutus-ledger-api/test/Spec/CostModelParams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ clearBuiltinCostModel r = r
{ paramSerialiseData = mempty
, paramVerifyEcdsaSecp256k1Signature = mempty
, paramVerifySchnorrSecp256k1Signature = mempty
, paramIntegerToByteString = mempty
, paramByteStringToInteger = mempty
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,4 @@ clearBuiltinCostModel r = r
, paramBls12_381_finalVerify = mempty
, paramKeccak_256 = mempty
, paramBlake2b_224 = mempty
, paramIntegerToByteString = mempty
, paramByteStringToInteger = mempty
}

0 comments on commit 7a720e3

Please sign in to comment.