package
0.1.0
Repository: https://github.com/brc20-collab/brczero.git
Documentation: pkg.go.dev

# Functions

AddressFromLastValidatorPowerKey gets the validator operator address from LastValidatorPowerKey.
Bech32ifyConsPub returns a Bech32 encoded string containing the Bech32PrefixConsPub prefixfor a given consensus node's PubKey.
No description provided by the author
DefaultGenesisState gets the default genesis state.
DefaultParams returns a default set of parameters.
DefaultUndelegation returns default entity for UndelegationInfo.
ErrAddSharesDuringProxy returns an error when a delegator who has bound tries to add shares to validators by itself.
ErrAddSharesToDismission returns an error when a zero-msd validator becomes the shares adding target.
ErrAlreadyAddedShares returns an error when a delegator tries to bind proxy after adding shares.
ErrAlreadyBound returns an error when a delegator keeps binding a proxy before proxy register.
ErrBadDelegationAmount returns an error when the amount of delegation isn't positive.
ErrBadDenom returns an error when the coin denomination is invalid.
ErrBadUnDelegationAmount returns an error when the amount of delegation is not positive.
ErrBadValidatorAddr returns an error when an invalid validator address appears.
ErrBondedPoolOrNotBondedIsNotExist returns an error when bonded pool or not bonded pool is empty.
No description provided by the author
No description provided by the author
ErrCommissionChangeRateGTMaxRate returns an error when the commission change rate is greater than the max rate.
ErrCommissionChangeRateNegative returns an error when the commission change rate is not positive.
ErrCommissionGTMaxChangeRate returns an error when the new rate % points change is greater than the max change rate.
ErrCommissionGTMaxRate returns an error when the commission rate is greater than the max rate.
ErrCommissionHuge returns an error when the commission is greater than 100%.
ErrCommissionNegative returns an error when the commission is not positive.
ErrCommissionUpdateTime returns an error when the commission is remodified within 24 hours.
ErrDelegatorEqualToProxyAddr returns an error when the address is not expected.
ErrDescriptionIsEmpty returns an error when description is empty.
ErrDescriptionLength returns an error when the description of validator has a wrong length.
ErrDoubleProxy returns an error when a delegator trys to bind more than one proxy.
ErrEmptyValidators returns an error when none of the validators in shares adding list is available.
ErrExceedValidatorAddrs returns an error when the number of target validators exceeds the max limit.
ErrGetConsPubKeyBech32 returns an error when get bech32 consensus public key failed.
ErrInsufficientDelegation returns an error when the delegation left is not enough for unbonding.
ErrInsufficientQuantity returns an error when the quantity is less than the min delegation limit.
ErrInvalidCommissionRate returns an error when commission rate not be between 0 and 1 (inclusive).
ErrInvalidDelegation returns an error when the delegation is invalid.
ErrInvalidProxyUpdating returns an error when the total delegated tokens on a proxy are going to be negative.
ErrInvalidProxyWithdrawTotal returns an error when proxy withdraws total tokens.
ErrMinSelfDelegationInvalid returns an error when the msd isn't positive.
ErrMoreMinSelfDelegation returns an error when the msd doesn't match the rest of shares on a validator.
ErrNilDelegatorAddr returns an error when the delegator address is nil.
ErrNilValidatorAddr returns an error when an empty validator address appears.
ErrNoDelegationToAddShares returns an error when there's no delegation to support adding shares to validators.
ErrNoDelegatorExisted returns an error when the info if a certain delegator doesn't exist.
ErrNoMinSelfDelegation returns an error when the msd has already been unbonded.
ErrNotInDelegating returns an error when the UndelegationInfo doesn't exist during it's unbonding period.
ErrNoUnbondingDelegation returns an error when the unbonding delegation doesn't exist.
ErrNoValidatorFound returns an error when a validator doesn't exist.
ErrProxyAlreadyExist returns an error when a proxy tries to reg the second time.
ErrProxyNotFound returns an error when a delegator who's not a proxy tries to unreg.
ErrTargetValsDuplicate returns an error when the target validators in voting list are duplicate.
ErrUnknownStakingQueryType returns an error when encounter unknown staking query type.
ErrValidatorOwnerExists returns an error when the validator address has been registered.
ErrValidatorPubKeyExists returns an error when the validator consensus pubkey has been registered.
ErrValidatorPubKeyTypeNotSupported returns an error when the type of pubkey was not supported.
GetCompleteTimeKey get the key for the prefix of time.
GetCompleteTimeWithAddrKey get the key for the complete time with delegator address.
GetConsPubKeyBech32 creates a PubKey for a consensus node with a given public key string using the Bech32 Bech32PrefixConsPub prefix.
GetDelegatorKey gets the key for Delegator.
GetLastValidatorPowerKey gets the bonded validator index key for an operator address.
GetProposeValidatorKey gets the propose validator key.
GetProxyDelegatorKey gets the key for the relationship between delegator and proxy.
GetSharesKey gets the whole key for an item of shares info.
GetSharesToValidatorsKey gets the first-prefix for an item of shares info.
GetUndelegationInfoKey gets the key for UndelegationInfo.
GetValidatorByConsAddrKey gets the key for the validator with pubkey VALUE: validator operator address ([]byte).
GetValidatorKey gets the key for the validator with address VALUE: staking/Validator.
GetValidatorQueueTimeKey gets the prefix for all unbonding delegations from a delegator.
GetValidatorsByPowerIndexKey gets the validator by power index Power index is the key used in the power-store, and represents the relative power ranking of the validator VALUE: validator operator address ([]byte).
No description provided by the author
No description provided by the author
MustGetConsPubKeyBech32 returns the result of GetConsPubKeyBech32 panicing on failure.
MustMarshalHistoricalInfo wll marshal historical info and panic on error.
MustMarshalValidator must return the marshaling bytes of a validator.
MustUnMarshalDelegator must return a delegator entity by unmarshalling.
MustUnmarshalHistoricalInfo wll unmarshal historical info and panic on error.
MustUnmarshalShares unmarshals the shares bytes and return it.
MustUnMarshalUndelegationInfo must return the UndelegationInfo object by unmarshaling.
MustUnmarshalValidator must return the validator entity by unmarshaling.
NewCommission returns an initialized validator commission.
NewCommissionRates returns an initialized validator commission rates.
NewCommissionWithTime returns an initialized validator commission with a specified update time which should be the current block BFT time.
NewDelegator creates a new Delegator object.
NewDescription returns a new Description with the provided values.
NewGenesisState creates a new object of GenesisState.
NewHistoricalInfo will create a historical information struct from header and valset it will first sort valset before inclusion into historical info.
NewLastValidatorPower creates a new instance of LastValidatorPower.
NewMsgAddShares creates a msg of adding shares to vals.
NewMsgBindProxy creates a msg of binding proxy.
NewMsgCreateValidator creates a msg of create-validator Delegator address and validator address are the same.
NewMsgDeposit creates a new instance of MsgDeposit.
NewMsgDepositMinSelfDelegation creates a msg of deposit-min-self-delegation.
NewMsgDestroyValidator creates a msg of destroy-validator.
NewMsgEditValidator creates a msg of edit-validator.
NewMsgEditValidatorCommissionRate creates a msg of edit-validator-commission-rate.
NewMsgRegProxy creates a msg of registering proxy.
NewMsgUnbindProxy creates a msg of unbinding proxy.
NewMsgWithdraw creates a new instance of MsgWithdraw.
NewMultiStakingHooks creates a new object of MultiStakingHooks.
NewParams creates a new Params instance.
NewPool creates a new Pool instance used for queries.
NewProposeValidatorProposal creates a new instance of ProposeValidatorProposal.
NewProxyDelegatorKeyExported creates a new object of ProxyDelegatorKeyExported.
NewQueryBondsParams creates a new instance of QueryBondsParams.
NewQueryDelegatorParams creates a new instance of QueryDelegatorParams.
NewQueryHistoricalInfoParams creates a new QueryHistoricalInfoParams instance.
NewQueryValidatorParams creates a new instance of QueryValidatorParams.
NewQueryValidatorsParams creates a new instance of QueryValidatorsParams.
NewSharesExported creates a new object of SharesExported.
NewSharesResponse creates a new instance of sharesResponse.
NewUndelegationInfo creates a new delegation object.
NewValidator initializes a new validator.
RegisterCodec registers concrete types for codec.
SplitCompleteTimeWithAddrKey splits the key and returns the endtime and delegator address.
UnmarshalHistoricalInfo will unmarshal historical info and return any error.
UnmarshalUndelegationInfo returns the UndelegationInfo object by unmarshaling.
UnmarshalValidator unmarshals a validator from a store value.
ValidateBasic will ensure HistoricalInfo is not nil and sorted.

# Constants

staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
names used as root for pool module accounts: - NotBondedPool -> "not_bonded_tokens_pool" - BondedPool -> "bonded_tokens_pool".
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Update the validator set every 252 blocks by default.
No description provided by the author
Staking params default values.
Staking params default values.
No description provided by the author
Default maximum number of bonded validators.
Staking params default values.
Default maximum number of validators to vote.
Default unbonding duration, 14 days.
Default validate rate update interval by hours.
DoNotModifyDesc is the constant used in flags to indicate that description field should not be updated.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
staking module event types.
nolint.
nolint.
TODO: Why can't we just have one string description which can be JSON by convention.
nolint.
ModuleName is the name of the staking module.
names used as root for pool module accounts: - NotBondedPool -> "not_bonded_tokens_pool" - BondedPool -> "bonded_tokens_pool".
No description provided by the author
QuerierRoute is the querier route for the staking module.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
query endpoints supported by the staking Querier.
RouterKey is the msg router key for the staking module.
StoreKey is the string store representation.
TStoreKey is the string transient store representation.

# Variables

No description provided by the author
DefaultMinDelegation is the limit value of delegation or undelegation.
DefaultMinSelfDelegation is the default value of each validator's msd (hard code).
nolint.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
nolint - Keys for parameter access.
nolint - Keys for parameter access.
how many blocks each epoch has.
nolint - Keys for parameter access.
nolint - Keys for parameter access.
nolint - Keys for parameter access.
nolint - Keys for parameter access.
nolint - Keys for parameter access.
a block height that is the end of last epoch.
nolint - Keys for parameter access.
prefix for the total power.
prefix for each key to a validator index, for bonded validators.
ModuleCdc is generic sealed codec to be used throughout this module.
nolint.
nolint.
nolint.
nolint.
nolint.
prefix key for vals info to enforce the update of validator-set.
prefix for the timestamps in validator queue.
prefix for each key to a validator index, by pubkey.
prefix for each key to a validator index, sorted by power.
prefix for each key to a validator.

# Structs

No description provided by the author
No description provided by the author
Delegator is the struct of delegator info.
Description - description fields for a validator.
GenesisState - all staking state that must be provided at genesis.
HistoricalInfo contains the historical information that gets stored at each height.
No description provided by the author
LastValidatorPower is needed for validator set update logic.
MsgAddShares - struct for adding-shares transaction.
MsgBindProxy - structure for bind proxy relationship between the delegator and the proxy.
MsgCreateValidator - struct for bonding transactions.
MsgDeposit - structure for depositing to the delegator account.
MsgDepositMinSelfDelegation - struct for depositing min self delegation.
MsgDestroyValidator - struct for transactions to deregister a validator.
MsgEditValidator - struct for editing a validator.
MsgEditValidatorCommissionRate - struct for editing a validator commission rate.
MsgRegProxy - register delegator as proxy or unregister proxy to delegator if Reg == true, action is reg, otherwise action is unreg.
MsgUnbindProxy - structure for unbinding proxy relationship between the delegator and the proxy.
MsgWithdraw - structure for withdrawing brc10 and the corresponding shares from all validators.
OVPair is designed for querying validators by rest.
Params defines the high level settings for staking.
Pool - tracking bonded and not-bonded token supply of the bond denomination.
No description provided by the author
ProposeValidatorProposal - structure for the proposal of proposing validator.
ProxyDelegatorKeyExported is designed for ProxyDelegatorKey export.
QueryBondsParams defines the params for the following queries: - 'custom/staking/delegation' - 'custom/staking/unbondingDelegation' - 'custom/staking/delegatorValidator'.
No description provided by the author
No description provided by the author
QueryDelegatorParams defines the params for the following queries: - 'custom/staking/delegatorDelegations' - 'custom/staking/delegatorUnbondingDelegations' - 'custom/staking/delegatorValidators'.
No description provided by the author
No description provided by the author
QueryHistoricalInfoParams defines the params for the following queries: - 'custom/staking/historicalInfo'.
No description provided by the author
No description provided by the author
QueryValidatorDelegationsResponse is response type for the Query/ValidatorDelegations RPC method.
QueryValidatorParams defines the params for the following queries: - 'custom/staking/validator' - 'custom/staking/validatorDelegations' - 'custom/staking/validatorUnbondingDelegations' - 'custom/staking/validatorRedelegations'.
QueryValidatorsParams defines the params for the following queries: - 'custom/staking/validators'.
SharesExported is designed for types.Shares export.
SharesResponse is the struct for query all the shares on a validator.
StandardizedValidator is just a copy of Validator in cosmos sdk The field "DelegatorShares"/"MinSelfDelegation" is treated by descending power 8 to decimal.
UndelegationInfo is the struct of the undelegation info.
Validator defines the total amount of bond shares and their exchange rate to coins.
ValidatorExported is designed for Validator export.

# Interfaces

AccountKeeper defines the expected account keeper (noalias).
StakingHooks event hooks for staking validator object (noalias).
SupplyKeeper defines the expected supply Keeper (noalias).
ValidatorSet expected properties for the set of all validators (noalias).

# Type aliases

MultiStakingHooks combines multiple staking hooks, all hook functions are run in array sequence TODO:need to trim the staking hooks as the brczero design.
OVPairs is the alias of the OVPair slice.
Shares is the alias of sdk.Dec to represent the amount of shares for adding shares to validators.
SharesResponses is the type alias of SharesResponse slice.
StandardizedValidators is the type alias of the StandardizedValidator slice.
Validators is a collection of Validator.