package tezos-protocol-013-PtJakart
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-013-PtJakart.raw/Tezos_raw_protocol_013_PtJakart/Stake_storage/index.html
Module Tezos_raw_protocol_013_PtJakart.Stake_storageSource
This library provides basic operations (accessors and setters) on staking tokens.
val deactivate_only_call_from_delegate_storage :
Raw_context.t ->
Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Lwt.tval activate_only_call_from_delegate_storage :
Raw_context.t ->
Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval fold :
Raw_context.t ->
f:
((Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t
* Tez_repr.t) ->
'a ->
'a Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.t) ->
order:[ `Sorted | `Undefined ] ->
'a ->
'a Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tfold ctxt ~f ~order init folds f on the list of active delegates with at least one roll. The folding process starts with init. Each element of the list is a pair pkh, stake, where pkh is the public key hash of the delegate and stake is the staking balance of the delegate.
val fold_snapshot :
Raw_context.t ->
index:int ->
f:
((Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t
* Tez_repr.t) ->
'a ->
'a Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.t) ->
init:'a ->
'a Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tfold_snapshot ctxt ~index ~f ~init folds f on the list of active delegates with at least one roll for the given snapshot index. The folding process starts with init. Each element of the list is a pair pkh, stake, where pkh is the public key hash of the delegate and stake is the staking balance of the delegate for the given snapshot index.
val max_snapshot_index :
Raw_context.t ->
int Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tmax_snapshot_index ctxt returns the index of the last snapshot taken of staking balances and active delegates.
val set_selected_distribution_for_cycle :
Raw_context.t ->
Cycle_repr.t ->
(Tezos_protocol_environment_013_PtJakart.Signature.public_key_hash
* Tez_repr.t)
list ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tset_selected_distribution_for_cycle ctxt cycle distrib total_stake saves the selected distribution distrib of the total_stake for the given cycle.
val clear_at_cycle_end :
Raw_context.t ->
new_cycle:Cycle_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval fold_on_active_delegates_with_rolls :
Raw_context.t ->
order:[ `Sorted | `Undefined ] ->
init:'a ->
f:
(Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t ->
unit ->
'a ->
'a Tezos_protocol_environment_013_PtJakart.Lwt.t) ->
'a Tezos_protocol_environment_013_PtJakart.Lwt.tval find_selected_distribution :
Raw_context.t ->
Cycle_repr.t ->
(Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t
* Tez_repr.t)
list
option
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval prepare_stake_distribution :
Raw_context.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tCopy the stake distribution for the current cycle (from Storage.Stake.Selected_distribution_for_cycle) in the raw context.
val get_total_active_stake :
Raw_context.t ->
Cycle_repr.t ->
Tez_repr.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tget_total_active_stake ctxt cycle retrieves the amount in Tez of the active stake at cycle from ctxt.
val add_contract_stake :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tadd_contract_stake ctxt contract amount calls Stake_storage.add_stake ctxt delegate amount if contract has a delegate. Otherwise this function does nothing.
val remove_contract_stake :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tremove_contract_stake ctxt contract amount calls Stake_storage.remove_stake ctxt delegate amount if contract has a delegate. Otherwise this function does nothing.