Skip to content

Commit f5d1992

Browse files
committed
Switch to HashableScriptData
1 parent 7efc527 commit f5d1992

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cardano-api/src/Cardano/Api/ScriptData.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ validateScriptData d =
270270
--
271271
newtype ScriptDataRangeError =
272272

273-
-- | The number is outside the maximum range of @-2^64-1 .. 2^64-1@.
273+
-- | The constructor number is outside the maximum range of @-2^64-1 .. 2^64-1@.
274274
--
275275
ScriptDataConstructorOutOfRange Integer
276276
deriving (Eq, Show)

cardano-api/test/Test/Cardano/Api/Typed/CBOR.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ prop_roundtrip_script_PlutusScriptV2_CBOR =
149149

150150
prop_roundtrip_ScriptData_CBOR :: Property
151151
prop_roundtrip_ScriptData_CBOR =
152-
roundtrip_CBOR AsScriptData genScriptData
152+
roundtrip_CBOR AsHashableScriptData genHashableScriptData
153153

154154
prop_roundtrip_UpdateProposal_CBOR :: Property
155155
prop_roundtrip_UpdateProposal_CBOR =
@@ -220,6 +220,7 @@ tests = testGroup "Test.Cardano.Api.Typed.CBOR"
220220
, testPropertyNamed "roundtrip script PlutusScriptV1 CBOR" "roundtrip script PlutusScriptV1 CBOR" prop_roundtrip_script_PlutusScriptV1_CBOR
221221
, testPropertyNamed "roundtrip script PlutusScriptV2 CBOR" "roundtrip script PlutusScriptV2 CBOR" prop_roundtrip_script_PlutusScriptV2_CBOR
222222
, testPropertyNamed "roundtrip UpdateProposal CBOR" "roundtrip UpdateProposal CBOR" prop_roundtrip_UpdateProposal_CBOR
223+
, testPropertyNamed "roundtrip ScriptData CBOR" "roundtrip ScriptData CBOR" prop_roundtrip_ScriptData_CBOR
223224
, testGroup "roundtrip txbody CBOR" test_roundtrip_txbody_CBOR
224225
, testGroup "roundtrip tx CBOR" test_roundtrip_tx_CBOR
225226
, testGroup "roundtrip Tx Cddl" test_roundtrip_Tx_Cddl

cardano-api/test/Test/Cardano/Api/Typed/Script.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ prop_roundtrip_ScriptData =
116116
sData <- H.forAll genHashableScriptData
117117
sData === fromAlonzoData (toAlonzoData sData)
118118

119-
prop_roundtrip_ScriptData_JSON :: Property
120-
prop_roundtrip_ScriptData_JSON =
119+
prop_roundtrip_HashableScriptData_JSON :: Property
120+
prop_roundtrip_HashableScriptData_JSON =
121121
H.property $ do
122-
sData <- H.forAll genScriptData
122+
sData <- H.forAll genHashableScriptData
123123
H.tripping sData scriptDataToJsonDetailedSchema scriptDataFromJsonDetailedSchema
124124

125125
-- -----------------------------------------------------------------------------
@@ -134,4 +134,5 @@ tests = testGroup "Test.Cardano.Api.Typed.Script"
134134
, testPropertyNamed "golden SimpleScriptV2 MofN" "golden SimpleScriptV2 MofN" prop_golden_SimpleScriptV2_MofN
135135
, testPropertyNamed "roundtrip SimpleScript JSON" "roundtrip SimpleScript JSON" prop_roundtrip_SimpleScript_JSON
136136
, testPropertyNamed "roundtrip ScriptData" "roundtrip ScriptData" prop_roundtrip_ScriptData
137+
, testPropertyNamed "roundtrip HashableScriptData" "roundtrip HashableScriptData" prop_roundtrip_HashableScriptData_JSON
137138
]

0 commit comments

Comments
 (0)