Skip to content

Commit 89675d4

Browse files
committed
test: update conformance and ledger API tests for Value builtins
Update test expectations across the codebase to reflect refined cost models: conformance test budgets (8 cases), ParamName additions for V1/V2/V3 ledger APIs (11 new params per version), param count tests, cost model registrations, and generator support. All updates reflect the transition from placeholder costs to fitted models.
1 parent 3d205bd commit 89675d4

File tree

22 files changed

+105
-47
lines changed

22 files changed

+105
-47
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000112100
2-
| mem: 100000000800})
1+
({cpu: 378875
2+
| mem: 801})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000112100
2-
| mem: 100000000800})
1+
({cpu: 378875
2+
| mem: 801})
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 269638
2+
| mem: 601})
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 269638
2+
| mem: 601})
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 269638
2+
| mem: 601})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 81100
2+
| mem: 601})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 269638
2+
| mem: 601})
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
({cpu: 100000080100
2-
| mem: 100000000600})
1+
({cpu: 175369
2+
| mem: 601})

plutus-core/cost-model/test/TestCostModels.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ main =
387387
, $(genTest 1 "listToArray")
388388
, $(genTest 2 "indexArray") Everywhere
389389

390+
-- Builtin Values
391+
, $(genTest 3 "lookupCoin")
392+
, $(genTest 2 "valueContains") Everywhere
393+
, $(genTest 1 "valueData")
394+
, $(genTest 1 "unValueData")
395+
390396
-- Data
391397
, $(genTest 6 "chooseData")
392398
, $(genTest 2 "constrData") Everywhere

plutus-core/plutus-core/test/CostModelSafety/Spec.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ import PlutusCore.Crypto.BLS12_381.G1 qualified as BLS12_381.G1
3232
import PlutusCore.Crypto.BLS12_381.G2 qualified as BLS12_381.G2
3333
import PlutusCore.Crypto.BLS12_381.Pairing qualified as BLS12_381.Pairing
3434
import PlutusCore.Data (Data (..))
35+
import PlutusCore.Default ()
3536
import PlutusCore.Default.Builtins
3637
import PlutusCore.Evaluation.Machine.BuiltinCostModel (BuiltinCostModel)
3738
import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget))
3839
import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (cekCostModelForVariant)
3940
import PlutusCore.Evaluation.Machine.ExBudgetStream (sumExBudgetStream)
4041
import PlutusCore.Evaluation.Machine.ExMemoryUsage (IntegerCostedLiterally,
41-
NumBytesCostedAsNumWords)
42+
NumBytesCostedAsNumWords,
43+
ValueLogOuterSizeAddLogMaxInnerSize,
44+
ValueTotalSize)
4245
import PlutusCore.Evaluation.Machine.MachineParameters (CostModel (..))
4346
import PlutusCore.Value (Value)
4447
import PlutusCore.Value qualified as Value
@@ -129,7 +132,9 @@ smallConstant tr
129132
| Just HRefl <- eqTypeRep tr (typeRep @BLS12_381.Pairing.MlResult) =
130133
SomeConst $ BLS12_381.Pairing.millerLoop
131134
BLS12_381.G1.offchain_zero BLS12_381.G2.offchain_zero
132-
| Just HRefl <- eqTypeRep tr (typeRep @Value) = SomeConst $ Value.empty
135+
| Just HRefl <- eqTypeRep tr (typeRep @Value) = SomeConst Value.empty
136+
| Just HRefl <- eqTypeRep tr (typeRep @ValueTotalSize) = SomeConst Value.empty
137+
| Just HRefl <- eqTypeRep tr (typeRep @ValueLogOuterSizeAddLogMaxInnerSize) = SomeConst Value.empty
133138
| trPair `App` tr1 `App` tr2 <- tr
134139
, Just HRefl <- eqTypeRep trPair (typeRep @(,)) =
135140
case (smallConstant tr1, smallConstant tr2) of

0 commit comments

Comments
 (0)