Safe Haskell | None |
---|---|
Language | Haskell2010 |
Packing utilities.
Synopsis
- lPackValue :: forall a. NicePackedValue a => a -> ByteString
- lUnpackValue :: forall a. NiceUnpackedValue a => ByteString -> Either UnpackError a
- lEncodeValue :: forall a. NicePrintedValue a => a -> ByteString
- valueToScriptExpr :: forall t. NicePackedValue t => t -> ByteString
- expressionToScriptExpr :: Expression -> ByteString
Documentation
lPackValue :: forall a. NicePackedValue a => a -> ByteString Source #
lUnpackValue :: forall a. NiceUnpackedValue a => ByteString -> Either UnpackError a Source #
lEncodeValue :: forall a. NicePrintedValue a => a -> ByteString 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 Expression
s.
This is only used in tests.