Skip to content

Commit

Permalink
SCP-3522 Reduced validator sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbush committed Sep 22, 2022
1 parent ef95737 commit 55d2180
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Expand Up @@ -26,8 +26,8 @@ data MarloweScripts = MarloweScripts
-- been published).
currentV1Scripts :: MarloweScripts
currentV1Scripts = MarloweScripts
"44377808ec69200314c2601b096f9009734ae4f741888f67ad61d941"
"6db99855e93e8fda9e917692bc746c9f6db73e9e9234a3abeeea971c"
"e3d45305a82b6817e120a29cfc1b6cd7c1535b6640e49a99dc267e57"
"49076eab20243dc9462511fb98a9cfb719f86e9692288139b7c91df3"

-- | The set of known script hash sets for Marlowe V1.
v1Scripts :: Set MarloweScripts
Expand Down
1 change: 0 additions & 1 deletion marlowe/src/Language/Marlowe/Scripts.hs
Expand Up @@ -118,7 +118,6 @@ closeInterval _ = Nothing


{-# INLINABLE mkMarloweValidator #-}
{-# OPTIONS_GHC -Wno-deferred-out-of-scope-variables #-}
mkMarloweValidator
:: ValidatorHash
-> MarloweData
Expand Down
4 changes: 2 additions & 2 deletions marlowe/test/Spec/Marlowe/Marlowe.hs
Expand Up @@ -147,14 +147,14 @@ marloweValidatorSize :: IO ()
marloweValidatorSize = do
let validator = Scripts.validatorScript marloweValidator
let vsize = SBS.length . SBS.toShort . LB.toStrict $ Serialise.serialise validator
assertBool ("smallTypedValidator is too large " <> show vsize) (vsize < 15180)
assertBool ("smallTypedValidator is too large " <> show vsize) (vsize < 15040)

-- | Test that the untyped validator is not too large.
smallMarloweValidatorSize :: IO ()
smallMarloweValidatorSize = do
let validator = Scripts.validatorScript smallMarloweValidator
let vsize = SBS.length . SBS.toShort . LB.toStrict $ Serialise.serialise validator
assertBool ("smallUntypedValidator is too large " <> show vsize) (vsize < 12675)
assertBool ("smallUntypedValidator is too large " <> show vsize) (vsize < 12515)


-- | Test `extractNonMerkleizedContractRoles`.
Expand Down

0 comments on commit 55d2180

Please sign in to comment.