Skip to content

Commit

Permalink
Switch to HashableScriptData
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Mar 19, 2023
1 parent 98d722b commit c3a116e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api/ScriptData.hs
Expand Up @@ -270,7 +270,7 @@ validateScriptData d =
--
newtype ScriptDataRangeError =

-- | The number is outside the maximum range of @-2^64-1 .. 2^64-1@.
-- | The constructor number is outside the maximum range of @-2^64-1 .. 2^64-1@.
--
ScriptDataConstructorOutOfRange Integer
deriving (Eq, Show)
Expand Down
3 changes: 2 additions & 1 deletion cardano-api/test/Test/Cardano/Api/Typed/CBOR.hs
Expand Up @@ -149,7 +149,7 @@ prop_roundtrip_script_PlutusScriptV2_CBOR =

prop_roundtrip_ScriptData_CBOR :: Property
prop_roundtrip_ScriptData_CBOR =
roundtrip_CBOR AsScriptData genScriptData
roundtrip_CBOR AsHashableScriptData genHashableScriptData

prop_roundtrip_UpdateProposal_CBOR :: Property
prop_roundtrip_UpdateProposal_CBOR =
Expand Down Expand Up @@ -220,6 +220,7 @@ tests = testGroup "Test.Cardano.Api.Typed.CBOR"
, testPropertyNamed "roundtrip script PlutusScriptV1 CBOR" "roundtrip script PlutusScriptV1 CBOR" prop_roundtrip_script_PlutusScriptV1_CBOR
, testPropertyNamed "roundtrip script PlutusScriptV2 CBOR" "roundtrip script PlutusScriptV2 CBOR" prop_roundtrip_script_PlutusScriptV2_CBOR
, testPropertyNamed "roundtrip UpdateProposal CBOR" "roundtrip UpdateProposal CBOR" prop_roundtrip_UpdateProposal_CBOR
, testPropertyNamed "roundtrip ScriptData CBOR" "roundtrip ScriptData CBOR" prop_roundtrip_ScriptData_CBOR
, testGroup "roundtrip txbody CBOR" test_roundtrip_txbody_CBOR
, testGroup "roundtrip tx CBOR" test_roundtrip_tx_CBOR
, testGroup "roundtrip Tx Cddl" test_roundtrip_Tx_Cddl
Expand Down
7 changes: 4 additions & 3 deletions cardano-api/test/Test/Cardano/Api/Typed/Script.hs
Expand Up @@ -116,10 +116,10 @@ prop_roundtrip_ScriptData =
sData <- H.forAll genHashableScriptData
sData === fromAlonzoData (toAlonzoData sData)

prop_roundtrip_ScriptData_JSON :: Property
prop_roundtrip_ScriptData_JSON =
prop_roundtrip_HashableScriptData_JSON :: Property
prop_roundtrip_HashableScriptData_JSON =
H.property $ do
sData <- H.forAll genScriptData
sData <- H.forAll genHashableScriptData
H.tripping sData scriptDataToJsonDetailedSchema scriptDataFromJsonDetailedSchema

-- -----------------------------------------------------------------------------
Expand All @@ -134,4 +134,5 @@ tests = testGroup "Test.Cardano.Api.Typed.Script"
, testPropertyNamed "golden SimpleScriptV2 MofN" "golden SimpleScriptV2 MofN" prop_golden_SimpleScriptV2_MofN
, testPropertyNamed "roundtrip SimpleScript JSON" "roundtrip SimpleScript JSON" prop_roundtrip_SimpleScript_JSON
, testPropertyNamed "roundtrip ScriptData" "roundtrip ScriptData" prop_roundtrip_ScriptData
, testPropertyNamed "roundtrip HashableScriptData" "roundtrip HashableScriptData" prop_roundtrip_HashableScriptData_JSON
]

0 comments on commit c3a116e

Please sign in to comment.