Skip to content

Commit

Permalink
Add golden test for cost models file
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhammann committed Oct 26, 2023
1 parent eddfb93 commit 7d020a3
Show file tree
Hide file tree
Showing 3 changed files with 379 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,28 @@ hprop_golden_conway_governance_action_view_create_info_json_outfile =
, "--out-file", actionViewFile
]
H.diffFileVsGoldenFile actionViewFile goldenActionViewFile

hprop_golden_conway_governance_action_create_protocol_parameters_update :: Property
hprop_golden_conway_governance_action_create_protocol_parameters_update =
propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do
stakeAddressVKeyFile <- H.note "test/cardano-cli-golden/files/input/governance/stake-address.vkey"
costModelsFile <- H.note "test/cardano-cli-golden/files/input/governance/costmodels.json"

actionFile <- noteTempFile tempDir "action"

void $ execCardanoCLI
[ "conway", "governance", "action", "create-protocol-parameters-update"
, "--proposal-anchor-url", "example.com"
, "--proposal-anchor-metadata", "this the reasoning behing my proposal"
, "--mainnet"
, "--stake-verification-key-file", stakeAddressVKeyFile
, "--governance-action-deposit", "12345"
, "--new-governance-action-deposit", "123454321"
, "--new-max-tx-size", "1234"
, "--new-cost-model-file", costModelsFile
, "--out-file", actionFile
]

goldenActionFile <- H.note "test/cardano-cli-golden/files/golden/governance/action/conway-create-protocol-parameters-update.action"
H.diffFileVsGoldenFile actionFile goldenActionFile

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "Governance proposal",
"description": "",
"cborHex": "84193039581de18f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058300f6a3031904d212a2009f1a000302590001011a00060bc719026d00011a000249f01903e800011a000249f018201a0025cea81971f70419744d186419744d186419744d186419744d186419744d186419744d18641864186419744d18641a000249f018201a000249f018201a000249f018201a000249f01903e800011a000249f018201a000249f01903e800081a000242201a00067e2318760001011a000249f01903e800081a000249f01a0001b79818f7011a000249f0192710011a0002155e19052e011903e81a000249f01903e8011a000249f018201a000249f018201a000249f0182001011a000249f0011a000249f0041a000194af18f8011a000194af18f8011a0002377c190556011a0002bdea1901f1011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000242201a00067e23187600010119f04c192bd200011a000249f018201a000242201a00067e2318760001011a000242201a00067e2318760001011a0025cea81971f707001a000141bb041a000249f019138800011a000249f018201a000302590001011a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a000249f018201a00330da70101ff019f1a0003236119032c01011903e819023b00011903e8195e7104011903e818201a0001ca761928eb041959d818641959d818641959d818641959d818641959d818641959d81864186418641959d81864194c5118201a0002acfa182019b551041a000363151901ff00011a00015c3518201a000797751936f404021a0002ff941a0006ea7818dc0001011903e8196ff604021a0003bd081a00034ec5183e011a00102e0f19312a011a00032e801901a5011a0002da781903e819cf06011a00013a34182019a8f118201903e818201a00013aac0119e143041903e80a1a00030219189c011a00030219189c011a0003207c1901d9011a000330001901ff0119ccf3182019fd40182019ffd5182019581e18201940b318201a00012adf18201a0002ff941a0006ea7818dc0001011a00010f92192da7000119eabb18201a0002ff941a0006ea7818dc0001011a0002ff941a0006ea7818dc0001011a0011b22c1a0005fdde00021a000c504e197712041a001d6af61a0001425b041a00040c660004001a00014fab18201a0003236119032c010119a0de18201a00033d7618201979f41820197fb8182019a95d1820197df718201995aa18201a0223accc0a1a009063b91903fd0a1a02515e841980b30aff181e1a075bc371826b6578616d706c652e636f6d5820e5e8956bc33dcf528b6d54a1b8e450ab74ddfdc4c960a31a308d8f595d39495d"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,349 @@
{
"PlutusV1":
{
"sha2_256-memory-arguments": 7,
"equalsString-cpu-arguments-constant": 1000,
"cekDelayCost-exBudgetMemory": 100,
"lessThanEqualsByteString-cpu-arguments-intercept": 103599,
"divideInteger-memory-arguments-minimum": 1,
"appendByteString-cpu-arguments-slope": 621,
"blake2b-cpu-arguments-slope": 29175,
"iData-cpu-arguments": 150000,
"encodeUtf8-cpu-arguments-slope": 1000,
"unBData-cpu-arguments": 150000,
"multiplyInteger-cpu-arguments-intercept": 61516,
"cekConstCost-exBudgetMemory": 100,
"nullList-cpu-arguments": 150000,
"equalsString-cpu-arguments-intercept": 150000,
"trace-cpu-arguments": 150000,
"mkNilData-memory-arguments": 32,
"lengthOfByteString-cpu-arguments": 150000,
"cekBuiltinCost-exBudgetCPU": 29773,
"bData-cpu-arguments": 150000,
"subtractInteger-cpu-arguments-slope": 0,
"unIData-cpu-arguments": 150000,
"consByteString-memory-arguments-intercept": 0,
"divideInteger-memory-arguments-slope": 1,
"divideInteger-cpu-arguments-model-arguments-slope": 118,
"listData-cpu-arguments": 150000,
"headList-cpu-arguments": 150000,
"chooseData-memory-arguments": 32,
"equalsInteger-cpu-arguments-intercept": 136542,
"sha3_256-cpu-arguments-slope": 82363,
"sliceByteString-cpu-arguments-slope": 5000,
"unMapData-cpu-arguments": 150000,
"lessThanInteger-cpu-arguments-intercept": 179690,
"mkCons-cpu-arguments": 150000,
"appendString-memory-arguments-intercept": 0,
"modInteger-cpu-arguments-model-arguments-slope": 118,
"ifThenElse-cpu-arguments": 1,
"mkNilPairData-cpu-arguments": 150000,
"lessThanEqualsInteger-cpu-arguments-intercept": 145276,
"addInteger-memory-arguments-slope": 1,
"chooseList-memory-arguments": 32,
"constrData-memory-arguments": 32,
"decodeUtf8-cpu-arguments-intercept": 150000,
"equalsData-memory-arguments": 1,
"subtractInteger-memory-arguments-slope": 1,
"appendByteString-memory-arguments-intercept": 0,
"lengthOfByteString-memory-arguments": 4,
"headList-memory-arguments": 32,
"listData-memory-arguments": 32,
"consByteString-cpu-arguments-intercept": 150000,
"unIData-memory-arguments": 32,
"remainderInteger-memory-arguments-minimum": 1,
"bData-memory-arguments": 32,
"lessThanByteString-cpu-arguments-slope": 248,
"encodeUtf8-memory-arguments-intercept": 0,
"cekStartupCost-exBudgetCPU": 100,
"multiplyInteger-memory-arguments-intercept": 0,
"unListData-memory-arguments": 32,
"remainderInteger-cpu-arguments-model-arguments-slope": 118,
"cekVarCost-exBudgetCPU": 29773,
"remainderInteger-memory-arguments-slope": 1,
"cekForceCost-exBudgetCPU": 29773,
"sha2_256-cpu-arguments-slope": 29175,
"equalsInteger-memory-arguments": 1,
"indexByteString-memory-arguments": 1,
"addInteger-memory-arguments-intercept": 1,
"chooseUnit-cpu-arguments": 150000,
"sndPair-cpu-arguments": 150000,
"cekLamCost-exBudgetCPU": 29773,
"fstPair-cpu-arguments": 150000,
"quotientInteger-memory-arguments-minimum": 1,
"decodeUtf8-cpu-arguments-slope": 1000,
"lessThanInteger-memory-arguments": 1,
"lessThanEqualsInteger-cpu-arguments-slope": 1366,
"fstPair-memory-arguments": 32,
"modInteger-memory-arguments-intercept": 0,
"unConstrData-cpu-arguments": 150000,
"lessThanEqualsInteger-memory-arguments": 1,
"chooseUnit-memory-arguments": 32,
"sndPair-memory-arguments": 32,
"addInteger-cpu-arguments-intercept": 197209,
"decodeUtf8-memory-arguments-slope": 8,
"equalsData-cpu-arguments-intercept": 150000,
"mapData-cpu-arguments": 150000,
"mkPairData-cpu-arguments": 150000,
"quotientInteger-cpu-arguments-constant": 148000,
"consByteString-memory-arguments-slope": 1,
"cekVarCost-exBudgetMemory": 100,
"indexByteString-cpu-arguments": 150000,
"unListData-cpu-arguments": 150000,
"equalsInteger-cpu-arguments-slope": 1326,
"cekStartupCost-exBudgetMemory": 100,
"subtractInteger-cpu-arguments-intercept": 197209,
"divideInteger-cpu-arguments-model-arguments-intercept": 425507,
"divideInteger-memory-arguments-intercept": 0,
"cekForceCost-exBudgetMemory": 100,
"blake2b-cpu-arguments-intercept": 2477736,
"remainderInteger-cpu-arguments-constant": 148000,
"tailList-cpu-arguments": 150000,
"encodeUtf8-cpu-arguments-intercept": 150000,
"equalsString-cpu-arguments-slope": 1000,
"lessThanByteString-memory-arguments": 1,
"multiplyInteger-cpu-arguments-slope": 11218,
"appendByteString-cpu-arguments-intercept": 396231,
"lessThanEqualsByteString-cpu-arguments-slope": 248,
"modInteger-memory-arguments-slope": 1,
"addInteger-cpu-arguments-slope": 0,
"equalsData-cpu-arguments-slope": 10000,
"decodeUtf8-memory-arguments-intercept": 0,
"chooseList-cpu-arguments": 150000,
"constrData-cpu-arguments": 150000,
"equalsByteString-memory-arguments": 1,
"cekApplyCost-exBudgetCPU": 29773,
"quotientInteger-memory-arguments-slope": 1,
"verifySignature-cpu-arguments-intercept": 3345831,
"unMapData-memory-arguments": 32,
"mkCons-memory-arguments": 32,
"sliceByteString-memory-arguments-slope": 1,
"sha3_256-memory-arguments": 4,
"ifThenElse-memory-arguments": 1,
"mkNilPairData-memory-arguments": 32,
"equalsByteString-cpu-arguments-slope": 247,
"appendString-cpu-arguments-intercept": 150000,
"quotientInteger-cpu-arguments-model-arguments-slope": 118,
"cekApplyCost-exBudgetMemory": 100,
"equalsString-memory-arguments": 1,
"multiplyInteger-memory-arguments-slope": 1,
"cekBuiltinCost-exBudgetMemory": 100,
"remainderInteger-memory-arguments-intercept": 0,
"sha2_256-cpu-arguments-intercept": 2477736,
"remainderInteger-cpu-arguments-model-arguments-intercept": 425507,
"lessThanEqualsByteString-memory-arguments": 1,
"tailList-memory-arguments": 32,
"mkNilData-cpu-arguments": 150000,
"chooseData-cpu-arguments": 150000,
"unBData-memory-arguments": 32,
"blake2b-memory-arguments": 4,
"iData-memory-arguments": 32,
"nullList-memory-arguments": 32,
"cekDelayCost-exBudgetCPU": 29773,
"subtractInteger-memory-arguments-intercept": 1,
"lessThanByteString-cpu-arguments-intercept": 103599,
"consByteString-cpu-arguments-slope": 1000,
"appendByteString-memory-arguments-slope": 1,
"trace-memory-arguments": 32,
"divideInteger-cpu-arguments-constant": 148000,
"cekConstCost-exBudgetCPU": 29773,
"encodeUtf8-memory-arguments-slope": 8,
"quotientInteger-cpu-arguments-model-arguments-intercept": 425507,
"mapData-memory-arguments": 32,
"appendString-cpu-arguments-slope": 1000,
"modInteger-cpu-arguments-constant": 148000,
"verifySignature-cpu-arguments-slope": 1,
"unConstrData-memory-arguments": 32,
"quotientInteger-memory-arguments-intercept": 0,
"equalsByteString-cpu-arguments-constant": 150000,
"sliceByteString-memory-arguments-intercept": 0,
"mkPairData-memory-arguments": 32,
"equalsByteString-cpu-arguments-intercept": 112536,
"appendString-memory-arguments-slope": 1,
"lessThanInteger-cpu-arguments-slope": 497,
"modInteger-cpu-arguments-model-arguments-intercept": 425507,
"modInteger-memory-arguments-minimum": 1,
"sha3_256-cpu-arguments-intercept": 0,
"verifySignature-memory-arguments": 1,
"cekLamCost-exBudgetMemory": 100,
"sliceByteString-cpu-arguments-intercept": 150000
},
"PlutusV2": {
"addInteger-cpu-arguments-intercept": 205665,
"addInteger-cpu-arguments-slope": 812,
"addInteger-memory-arguments-intercept": 1,
"addInteger-memory-arguments-slope": 1,
"appendByteString-cpu-arguments-intercept": 1000,
"appendByteString-cpu-arguments-slope": 571,
"appendByteString-memory-arguments-intercept": 0,
"appendByteString-memory-arguments-slope": 1,
"appendString-cpu-arguments-intercept": 1000,
"appendString-cpu-arguments-slope": 24177,
"appendString-memory-arguments-intercept": 4,
"appendString-memory-arguments-slope": 1,
"bData-cpu-arguments": 1000,
"bData-memory-arguments": 32,
"blake2b_256-cpu-arguments-intercept": 117366,
"blake2b_256-cpu-arguments-slope": 10475,
"blake2b_256-memory-arguments": 4,
"cekApplyCost-exBudgetCPU": 23000,
"cekApplyCost-exBudgetMemory": 100,
"cekBuiltinCost-exBudgetCPU": 23000,
"cekBuiltinCost-exBudgetMemory": 100,
"cekConstCost-exBudgetCPU": 23000,
"cekConstCost-exBudgetMemory": 100,
"cekDelayCost-exBudgetCPU": 23000,
"cekDelayCost-exBudgetMemory": 100,
"cekForceCost-exBudgetCPU": 23000,
"cekForceCost-exBudgetMemory": 100,
"cekLamCost-exBudgetCPU": 23000,
"cekLamCost-exBudgetMemory": 100,
"cekStartupCost-exBudgetCPU": 100,
"cekStartupCost-exBudgetMemory": 100,
"cekVarCost-exBudgetCPU": 23000,
"cekVarCost-exBudgetMemory": 100,
"chooseData-cpu-arguments": 19537,
"chooseData-memory-arguments": 32,
"chooseList-cpu-arguments": 175354,
"chooseList-memory-arguments": 32,
"chooseUnit-cpu-arguments": 46417,
"chooseUnit-memory-arguments": 4,
"consByteString-cpu-arguments-intercept": 221973,
"consByteString-cpu-arguments-slope": 511,
"consByteString-memory-arguments-intercept": 0,
"consByteString-memory-arguments-slope": 1,
"constrData-cpu-arguments": 89141,
"constrData-memory-arguments": 32,
"decodeUtf8-cpu-arguments-intercept": 497525,
"decodeUtf8-cpu-arguments-slope": 14068,
"decodeUtf8-memory-arguments-intercept": 4,
"decodeUtf8-memory-arguments-slope": 2,
"divideInteger-cpu-arguments-constant": 196500,
"divideInteger-cpu-arguments-model-arguments-intercept": 453240,
"divideInteger-cpu-arguments-model-arguments-slope": 220,
"divideInteger-memory-arguments-intercept": 0,
"divideInteger-memory-arguments-minimum": 1,
"divideInteger-memory-arguments-slope": 1,
"encodeUtf8-cpu-arguments-intercept": 1000,
"encodeUtf8-cpu-arguments-slope": 28662,
"encodeUtf8-memory-arguments-intercept": 4,
"encodeUtf8-memory-arguments-slope": 2,
"equalsByteString-cpu-arguments-constant": 245000,
"equalsByteString-cpu-arguments-intercept": 216773,
"equalsByteString-cpu-arguments-slope": 62,
"equalsByteString-memory-arguments": 1,
"equalsData-cpu-arguments-intercept": 1060367,
"equalsData-cpu-arguments-slope": 12586,
"equalsData-memory-arguments": 1,
"equalsInteger-cpu-arguments-intercept": 208512,
"equalsInteger-cpu-arguments-slope": 421,
"equalsInteger-memory-arguments": 1,
"equalsString-cpu-arguments-constant": 187000,
"equalsString-cpu-arguments-intercept": 1000,
"equalsString-cpu-arguments-slope": 52998,
"equalsString-memory-arguments": 1,
"fstPair-cpu-arguments": 80436,
"fstPair-memory-arguments": 32,
"headList-cpu-arguments": 43249,
"headList-memory-arguments": 32,
"iData-cpu-arguments": 1000,
"iData-memory-arguments": 32,
"ifThenElse-cpu-arguments": 80556,
"ifThenElse-memory-arguments": 1,
"indexByteString-cpu-arguments": 57667,
"indexByteString-memory-arguments": 4,
"lengthOfByteString-cpu-arguments": 1000,
"lengthOfByteString-memory-arguments": 10,
"lessThanByteString-cpu-arguments-intercept": 197145,
"lessThanByteString-cpu-arguments-slope": 156,
"lessThanByteString-memory-arguments": 1,
"lessThanEqualsByteString-cpu-arguments-intercept": 197145,
"lessThanEqualsByteString-cpu-arguments-slope": 156,
"lessThanEqualsByteString-memory-arguments": 1,
"lessThanEqualsInteger-cpu-arguments-intercept": 204924,
"lessThanEqualsInteger-cpu-arguments-slope": 473,
"lessThanEqualsInteger-memory-arguments": 1,
"lessThanInteger-cpu-arguments-intercept": 208896,
"lessThanInteger-cpu-arguments-slope": 511,
"lessThanInteger-memory-arguments": 1,
"listData-cpu-arguments": 52467,
"listData-memory-arguments": 32,
"mapData-cpu-arguments": 64832,
"mapData-memory-arguments": 32,
"mkCons-cpu-arguments": 65493,
"mkCons-memory-arguments": 32,
"mkNilData-cpu-arguments": 22558,
"mkNilData-memory-arguments": 32,
"mkNilPairData-cpu-arguments": 16563,
"mkNilPairData-memory-arguments": 32,
"mkPairData-cpu-arguments": 76511,
"mkPairData-memory-arguments": 32,
"modInteger-cpu-arguments-constant": 196500,
"modInteger-cpu-arguments-model-arguments-intercept": 453240,
"modInteger-cpu-arguments-model-arguments-slope": 220,
"modInteger-memory-arguments-intercept": 0,
"modInteger-memory-arguments-minimum": 1,
"modInteger-memory-arguments-slope": 1,
"multiplyInteger-cpu-arguments-intercept": 69522,
"multiplyInteger-cpu-arguments-slope": 11687,
"multiplyInteger-memory-arguments-intercept": 0,
"multiplyInteger-memory-arguments-slope": 1,
"nullList-cpu-arguments": 60091,
"nullList-memory-arguments": 32,
"quotientInteger-cpu-arguments-constant": 196500,
"quotientInteger-cpu-arguments-model-arguments-intercept": 453240,
"quotientInteger-cpu-arguments-model-arguments-slope": 220,
"quotientInteger-memory-arguments-intercept": 0,
"quotientInteger-memory-arguments-minimum": 1,
"quotientInteger-memory-arguments-slope": 1,
"remainderInteger-cpu-arguments-constant": 196500,
"remainderInteger-cpu-arguments-model-arguments-intercept": 453240,
"remainderInteger-cpu-arguments-model-arguments-slope": 220,
"remainderInteger-memory-arguments-intercept": 0,
"remainderInteger-memory-arguments-minimum": 1,
"remainderInteger-memory-arguments-slope": 1,
"serialiseData-cpu-arguments-intercept": 1159724,
"serialiseData-cpu-arguments-slope": 392670,
"serialiseData-memory-arguments-intercept": 0,
"serialiseData-memory-arguments-slope": 2,
"sha2_256-cpu-arguments-intercept": 806990,
"sha2_256-cpu-arguments-slope": 30482,
"sha2_256-memory-arguments": 4,
"sha3_256-cpu-arguments-intercept": 1927926,
"sha3_256-cpu-arguments-slope": 82523,
"sha3_256-memory-arguments": 4,
"sliceByteString-cpu-arguments-intercept": 265318,
"sliceByteString-cpu-arguments-slope": 0,
"sliceByteString-memory-arguments-intercept": 4,
"sliceByteString-memory-arguments-slope": 0,
"sndPair-cpu-arguments": 85931,
"sndPair-memory-arguments": 32,
"subtractInteger-cpu-arguments-intercept": 205665,
"subtractInteger-cpu-arguments-slope": 812,
"subtractInteger-memory-arguments-intercept": 1,
"subtractInteger-memory-arguments-slope": 1,
"tailList-cpu-arguments": 41182,
"tailList-memory-arguments": 32,
"trace-cpu-arguments": 212342,
"trace-memory-arguments": 32,
"unBData-cpu-arguments": 31220,
"unBData-memory-arguments": 32,
"unConstrData-cpu-arguments": 32696,
"unConstrData-memory-arguments": 32,
"unIData-cpu-arguments": 43357,
"unIData-memory-arguments": 32,
"unListData-cpu-arguments": 32247,
"unListData-memory-arguments": 32,
"unMapData-cpu-arguments": 38314,
"unMapData-memory-arguments": 32,
"verifyEcdsaSecp256k1Signature-cpu-arguments": 35892428,
"verifyEcdsaSecp256k1Signature-memory-arguments": 10,
"verifyEd25519Signature-cpu-arguments-intercept": 9462713,
"verifyEd25519Signature-cpu-arguments-slope": 1021,
"verifyEd25519Signature-memory-arguments": 10,
"verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 38887044,
"verifySchnorrSecp256k1Signature-cpu-arguments-slope": 32947,
"verifySchnorrSecp256k1Signature-memory-arguments": 10
}
}

0 comments on commit 7d020a3

Please sign in to comment.