lorentz-0.15.1: EDSL for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lorentz.Pack

Description

Packing utilities.

Synopsis

Documentation

lUnpackValueRaw :: forall a. NiceUnpackedValue a => ByteString -> Either UnpackError a Source #

lPackValue :: forall a. NicePackedValue a => a -> Packed a Source #

lUnpackValue :: forall a. NiceUnpackedValue a => Packed a -> Either UnpackError a Source #

valueToScriptExpr :: forall t. NicePackedValue t => t -> ByteString Source #

This function transforms Lorentz values into script_expr.

script_expr is used in RPC as an argument in entrypoint designed for getting value by key from the big_map in Babylon. In order to convert value to the script_expr we have to pack it, take blake2b hash and add specific expr prefix. Take a look at https://gitlab.com/tezos/tezos/blob/6e25ae8eb385d9975a30388c7a7aa2a9a65bf184/src/proto_005_PsBabyM1/lib_protocol/script_expr_hash.ml and https://gitlab.com/tezos/tezos/blob/6e25ae8eb385d9975a30388c7a7aa2a9a65bf184/src/proto_005_PsBabyM1/lib_protocol/contract_services.ml#L136 for more information.

expressionToScriptExpr :: Expression -> ByteString Source #

Similar to valueToScriptExpr, but for values encoded as Expressions. This is only used in tests.