Mavryk_raw_protocol_alpha.Delegate_storage
This module groups everything related to delegate registration. For the invariants maintained, see the submodule Contract
.
It also groups "trivial" getters/setters related to delegates.
It is responsible for maintaining the following tables:
type Mavryk_protocol_environment_alpha.Error_monad.error +=
| Unregistered_delegate of Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t
module Contract : sig ... end
This module ensures the following invariants:
val registered :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
bool Mavryk_protocol_environment_alpha.Lwt.t
Has a delegate been registered in the delegate table?
val fold :
Raw_context.t ->
order:[ `Sorted | `Undefined ] ->
init:'a ->
f:
(Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
'a ->
'a Mavryk_protocol_environment_alpha.Lwt.t) ->
'a Mavryk_protocol_environment_alpha.Lwt.t
Iterate on all registered delegates.
val list :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t list
Mavryk_protocol_environment_alpha.Lwt.t
List all registered delegates.
val initial_frozen_deposits :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.public_key_hash ->
Tez_repr.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.t
Returns a delegate's initial frozen deposits at the beginning of cycle.
val initial_frozen_deposits_of_previous_cycle :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.public_key_hash ->
Tez_repr.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.t
Returns a delegate's initial frozen deposits at the beginning of the previous cycle.
Fails with No_previous_cycle
if there is no previous cycle.
val current_frozen_deposits :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.public_key_hash ->
Tez_repr.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.t
Returns a delegate's current frozen deposits, which is the sum of their own frozen funds and those of their stakers if applicable.
val frozen_deposits_limit :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t option Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.t
val set_frozen_deposits_limit :
Raw_context.t ->
Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
Tez_repr.t option ->
Raw_context.t Mavryk_protocol_environment_alpha.Lwt.t
val drain :
Raw_context.t ->
delegate:Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
destination:Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t ->
(Raw_context.t * bool * Tez_repr.t * Receipt_repr.balance_updates)
Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.t
module For_RPC : sig ... end
The functions in this module are considered too costly to be used in the protocol. They are meant to be used only to answer RPC calls.