package tezos-protocol-011-PtHangz2
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b
doc/tezos-protocol-011-PtHangz2.raw/Tezos_raw_protocol_011_PtHangz2/Roll_storage/Delegate/index.html
Module Roll_storage.Delegate
Source
val add_amount :
Raw_context.t ->
Tezos_protocol_environment_011_PtHangz2.Signature.Public_key_hash.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_011_PtHangz2.Error_monad.tzresult
Tezos_protocol_environment_011_PtHangz2.Lwt.t
add_amount ctxt dlg am
performs the following actions:
1. if the delegate dlg
is inactive, increase its change chg
by am
, 2. if the dlg
is active, update dlg
's number of rolls nr
, and change chg
so that dlg
's number of tokens is increased by am
, and equal to nr * tokens_per_roll + chg
, where chg < tokens_per_roll
.
val remove_amount :
Raw_context.t ->
Tezos_protocol_environment_011_PtHangz2.Signature.Public_key_hash.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_011_PtHangz2.Error_monad.tzresult
Tezos_protocol_environment_011_PtHangz2.Lwt.t
remove_amount ctxt dlg am
performs the following actions:
1. if the delegate dlg
is inactive, decrease its change chg
by am
, 2. if the dlg
is active, update dlg
's number of rolls nr
, and change chg
so that dlg
's number of tokens is decreased by am
, and equal to nr * tokens_per_roll + chg
, where chg < tokens_per_roll
.
val set_inactive :
Raw_context.t ->
Tezos_protocol_environment_011_PtHangz2.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_011_PtHangz2.Error_monad.tzresult
Tezos_protocol_environment_011_PtHangz2.Lwt.t
set_inactive ctxt dlg
renders delegate dlg
inactive and performs the following actions:
1. empty the list of rolls of dlg
, 2. increase the change of dlg
by nr * tokens_per_roll
, where nr
is dlg
's number of rolls prior to inactivation.
val set_active :
Raw_context.t ->
Tezos_protocol_environment_011_PtHangz2.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_011_PtHangz2.Error_monad.tzresult
Tezos_protocol_environment_011_PtHangz2.Lwt.t
If the delegate dlg
is already active then set_active ctxt dlg
performs the following sequence of actions:
1. if the delegate is not scheduled to become inactive, then schedule the delegate to become inactive after (preserved_cycles * 2) + 1
cycles, 2. if the delegate is already scheduled to become inactive at cycle ic
, then re-schedule it to become inactive at cycle max ic (cc + preserved_cycles + 1)
, where cc
is the current cycle.
If dlg
is inactive then this function puts dlg
in active state and performs the following actions:
1. if dlg
is not scheduled to become inactive, schedule dlg
to become inactive after (preserved_cycles * 2) + 1
cycles, 2. if the dlg
is already scheduled to become inactive at cycle ic
, then re-schedule it to become inactive at cycle max ic (cc + (preserved_cycles * 2) + 1)
, where cc
is the current cycle, 3. dispatch dlg
's change chg
into nr
rolls of size tokens_per_roll
so that the total amount managed by dlg
is unchanged and equal to (nr * tokens_per_roll) + chg
, where chg < tokens_per_roll
.