package tezos-protocol-015-PtLimaPt

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.0.tar.gz
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b

doc/tezos-protocol-015-PtLimaPt.raw/Tezos_raw_protocol_015_PtLimaPt/Local_gas_counter/index.html

Module Tezos_raw_protocol_015_PtLimaPt.Local_gas_counterSource

This module exposes an API for local gas counting. It provides a set of functions for updating a gas counter without applying it on an an Alpha_context.context.

Sourcetype local_gas_counter =
  1. | Local_gas_counter of int

A local_gas_counter is a wrapped int.

Sourcetype outdated_context

A type for describing a context that is not up to date with respect to gas consumption.

Sourceval local_gas_counter_and_outdated_context : Alpha_context.context -> local_gas_counter * outdated_context

local_gas_counter_and_outdated_context ctxt returns the gas counter value corresponding to the remaining gas in the given context ctxt along with an outdated_context value.

use_gas_counter_in_context outdated_ctxt gas_counter f first applies the gas_counter on the outdated context outdated_ctxt, then invokes f on the resulting context, and returns a new outdated_context and a local_gas_counter value.

consume_opt amt cost attempts to consume an amt of gas and returns the new remaining value wrapped in Some. If the resulting gas is negative None is returned.

consume amt cost attempts to consume an amt of gas and returns the new remaining value as a result. If the resulting gas is negative, an error Gas.Operation_quota_exceeded is instead returned.

OCaml

Innovation. Community. Security.