package tezos-protocol-012-Psithaca

  1. Overview
  2. Docs
Module type
Class type
val node_too_large : Script_repr.node -> bool

node_too_large node returns true if:

  • The number of sub-nodes in the node exceeds Global_constants_storage.node_size_limit.
  • The sum of the bytes in String, Int, and Bytes sub-nodes of node exceeds Global_constants_storage.bytes_size_limit.

Otherwise returns false.

val bottom_up_fold_cps : 'accumulator -> 'loc Script_repr.michelson_node -> ('accumulator -> 'loc Script_repr.michelson_node -> 'return) -> ('accumulator -> 'loc Script_repr.michelson_node -> ('accumulator -> 'loc Script_repr.michelson_node -> 'return) -> 'return) -> 'return

bottom_up_fold_cps initial_accumulator node initial_k f folds node and all its sub-nodes if any, starting from initial_accumulator, using an initial continuation initial_k. At each node, f is called to transform the continuation k into the next one. This explicit manipulation of the continuation is typically useful to short-circuit.

Notice that a common source of bug is to forget to properly call the continuation in `f`.

See Global_constants_storage.expand for an example.

TODO: Move function to lib_micheline.

On our next opportunity to update the environment, we should move this function to lib_micheline.

val expr_to_address_in_context : Raw_context.t -> Script_repr.expr -> (Raw_context.t * Script_expr_hash.t, Tezos_protocol_environment_012_Psithaca__Environment.Error_monad.error Tezos_protocol_environment_012_Psithaca__Environment.Error_monad.trace) result

Innovation. Community. Security.