Documentation ¶
Index ¶
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, vm ValidatorManager) (panelty types.Coin)
- func ErrAccountNotFound() sdk.Error
- func ErrIllegalWithdraw() sdk.Error
- func ErrInsufficientDeposit() sdk.Error
- func ErrInvalidCoin() sdk.Error
- func ErrInvalidUsername() sdk.Error
- func ErrInvalidWebsite() sdk.Error
- func ErrUnbalancedAccount() sdk.Error
- func ErrValidatorPubKeyAlreadyExist() sdk.Error
- func FindAccountInList(me types.AccountKey, lst []types.AccountKey) int
- func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
- func NewHandler(am acc.AccountManager, valManager ValidatorManager, ...) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type ValidatorDepositMsg
- func (msg ValidatorDepositMsg) GetConsumeAmount() types.Coin
- func (msg ValidatorDepositMsg) GetPermission() types.Permission
- func (msg ValidatorDepositMsg) GetSignBytes() []byte
- func (msg ValidatorDepositMsg) GetSigners() []sdk.AccAddress
- func (msg ValidatorDepositMsg) String() string
- func (msg ValidatorDepositMsg) Type() string
- func (msg ValidatorDepositMsg) ValidateBasic() sdk.Error
- type ValidatorManager
- func (vm ValidatorManager) AdjustValidatorList(ctx sdk.Context) sdk.Error
- func (vm ValidatorManager) Deposit(ctx sdk.Context, username types.AccountKey, coin types.Coin, link string) sdk.Error
- func (vm ValidatorManager) DoesValidatorExist(ctx sdk.Context, accKey types.AccountKey) bool
- func (vm ValidatorManager) FireIncompetentValidator(ctx sdk.Context, byzantineValidators []abci.Evidence) (types.Coin, sdk.Error)
- func (vm ValidatorManager) GetUpdateValidatorList(ctx sdk.Context) ([]abci.Validator, sdk.Error)
- func (vm ValidatorManager) GetValidatorDeposit(ctx sdk.Context, accKey types.AccountKey) (types.Coin, sdk.Error)
- func (vm ValidatorManager) GetValidatorList(ctx sdk.Context) (*model.ValidatorList, sdk.Error)
- func (vm ValidatorManager) InitGenesis(ctx sdk.Context) error
- func (vm ValidatorManager) IsBalancedAccount(ctx sdk.Context, accKey types.AccountKey, votingDeposit types.Coin) bool
- func (vm ValidatorManager) IsLegalWithdraw(ctx sdk.Context, username types.AccountKey, coin types.Coin) bool
- func (vm ValidatorManager) PunishOncallValidator(ctx sdk.Context, username types.AccountKey, penalty types.Coin, ...) (types.Coin, sdk.Error)
- func (vm ValidatorManager) PunishValidatorsDidntVote(ctx sdk.Context, penaltyList []types.AccountKey) (types.Coin, sdk.Error)
- func (vm ValidatorManager) RegisterValidator(ctx sdk.Context, username types.AccountKey, pubKey crypto.PubKey, ...) sdk.Error
- func (vm ValidatorManager) RemoveValidatorFromAllLists(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (vm ValidatorManager) SetValidatorList(ctx sdk.Context, lst *model.ValidatorList) sdk.Error
- func (vm ValidatorManager) TryBecomeOncallValidator(ctx sdk.Context, username types.AccountKey) sdk.Error
- func (vm ValidatorManager) UpdateSigningValidator(ctx sdk.Context, signingValidators []abci.SigningValidator) sdk.Error
- func (vm ValidatorManager) ValidatorWithdraw(ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
- func (vm ValidatorManager) ValidatorWithdrawAll(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
- type ValidatorRevokeMsg
- func (msg ValidatorRevokeMsg) GetConsumeAmount() types.Coin
- func (msg ValidatorRevokeMsg) GetPermission() types.Permission
- func (msg ValidatorRevokeMsg) GetSignBytes() []byte
- func (msg ValidatorRevokeMsg) GetSigners() []sdk.AccAddress
- func (msg ValidatorRevokeMsg) String() string
- func (msg ValidatorRevokeMsg) Type() string
- func (msg ValidatorRevokeMsg) ValidateBasic() sdk.Error
- type ValidatorWithdrawMsg
- func (msg ValidatorWithdrawMsg) GetConsumeAmount() types.Coin
- func (msg ValidatorWithdrawMsg) GetPermission() types.Permission
- func (msg ValidatorWithdrawMsg) GetSignBytes() []byte
- func (msg ValidatorWithdrawMsg) GetSigners() []sdk.AccAddress
- func (msg ValidatorWithdrawMsg) String() string
- func (msg ValidatorWithdrawMsg) Type() string
- func (msg ValidatorWithdrawMsg) ValidateBasic() sdk.Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TestAccountKVStoreKey = sdk.NewKVStoreKey("account") TestValidatorKVStoreKey = sdk.NewKVStoreKey("validator") TestGlobalKVStoreKey = sdk.NewKVStoreKey("global") TestVoteKVStoreKey = sdk.NewKVStoreKey("vote") TestParamKVStoreKey = sdk.NewKVStoreKey("param") )
Functions ¶
func BeginBlocker ¶
func BeginBlocker( ctx sdk.Context, req abci.RequestBeginBlock, vm ValidatorManager) (panelty types.Coin)
func ErrAccountNotFound ¶
func ErrIllegalWithdraw ¶
func ErrInsufficientDeposit ¶
func ErrInvalidCoin ¶
func ErrInvalidUsername ¶
func ErrInvalidWebsite ¶
func ErrUnbalancedAccount ¶
func FindAccountInList ¶
func FindAccountInList(me types.AccountKey, lst []types.AccountKey) int
func InitGlobalManager ¶
func InitGlobalManager(ctx sdk.Context, gm global.GlobalManager) error
func NewHandler ¶
func NewHandler(am acc.AccountManager, valManager ValidatorManager, voteManager vote.VoteManager, gm global.GlobalManager) sdk.Handler
Types ¶
type ValidatorDepositMsg ¶
type ValidatorDepositMsg struct { Username types.AccountKey `json:"username"` Deposit types.LNO `json:"deposit"` ValPubKey crypto.PubKey `json:"validator_public_key"` Link string `json:"link"` }
func NewValidatorDepositMsg ¶
func NewValidatorDepositMsg(validator string, deposit types.LNO, pubKey crypto.PubKey, link string) ValidatorDepositMsg
ValidatorDepositMsg Msg Implementations
func (ValidatorDepositMsg) GetConsumeAmount ¶
func (msg ValidatorDepositMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (ValidatorDepositMsg) GetPermission ¶
func (msg ValidatorDepositMsg) GetPermission() types.Permission
func (ValidatorDepositMsg) GetSignBytes ¶
func (msg ValidatorDepositMsg) GetSignBytes() []byte
func (ValidatorDepositMsg) GetSigners ¶
func (msg ValidatorDepositMsg) GetSigners() []sdk.AccAddress
func (ValidatorDepositMsg) String ¶
func (msg ValidatorDepositMsg) String() string
func (ValidatorDepositMsg) Type ¶
func (msg ValidatorDepositMsg) Type() string
func (ValidatorDepositMsg) ValidateBasic ¶
func (msg ValidatorDepositMsg) ValidateBasic() sdk.Error
type ValidatorManager ¶
type ValidatorManager struct {
// contains filtered or unexported fields
}
func NewValidatorManager ¶
func NewValidatorManager(key sdk.StoreKey, holder param.ParamHolder) ValidatorManager
func (ValidatorManager) AdjustValidatorList ¶
func (vm ValidatorManager) AdjustValidatorList(ctx sdk.Context) sdk.Error
if any change happens in oncall validator(remove, punish), we should call this function to adjust validator list
func (ValidatorManager) Deposit ¶
func (vm ValidatorManager) Deposit( ctx sdk.Context, username types.AccountKey, coin types.Coin, link string) sdk.Error
func (ValidatorManager) DoesValidatorExist ¶
func (vm ValidatorManager) DoesValidatorExist(ctx sdk.Context, accKey types.AccountKey) bool
func (ValidatorManager) FireIncompetentValidator ¶
func (ValidatorManager) GetUpdateValidatorList ¶
func (ValidatorManager) GetValidatorDeposit ¶
func (vm ValidatorManager) GetValidatorDeposit(ctx sdk.Context, accKey types.AccountKey) (types.Coin, sdk.Error)
func (ValidatorManager) GetValidatorList ¶
func (vm ValidatorManager) GetValidatorList(ctx sdk.Context) (*model.ValidatorList, sdk.Error)
func (ValidatorManager) InitGenesis ¶
func (vm ValidatorManager) InitGenesis(ctx sdk.Context) error
func (ValidatorManager) IsBalancedAccount ¶
func (vm ValidatorManager) IsBalancedAccount( ctx sdk.Context, accKey types.AccountKey, votingDeposit types.Coin) bool
func (ValidatorManager) IsLegalWithdraw ¶
func (vm ValidatorManager) IsLegalWithdraw( ctx sdk.Context, username types.AccountKey, coin types.Coin) bool
func (ValidatorManager) PunishOncallValidator ¶
func (vm ValidatorManager) PunishOncallValidator( ctx sdk.Context, username types.AccountKey, penalty types.Coin, punishType types.PunishType) (types.Coin, sdk.Error)
func (ValidatorManager) PunishValidatorsDidntVote ¶
func (vm ValidatorManager) PunishValidatorsDidntVote( ctx sdk.Context, penaltyList []types.AccountKey) (types.Coin, sdk.Error)
func (ValidatorManager) RegisterValidator ¶
func (ValidatorManager) RemoveValidatorFromAllLists ¶
func (vm ValidatorManager) RemoveValidatorFromAllLists(ctx sdk.Context, username types.AccountKey) sdk.Error
remove the user from both oncall and allValidators lists
func (ValidatorManager) SetValidatorList ¶
func (vm ValidatorManager) SetValidatorList(ctx sdk.Context, lst *model.ValidatorList) sdk.Error
func (ValidatorManager) TryBecomeOncallValidator ¶
func (vm ValidatorManager) TryBecomeOncallValidator(ctx sdk.Context, username types.AccountKey) sdk.Error
try to join the oncall validator list, the action will success if either 1. the validator list is not full or 2. someone in the validator list has a lower power than current validator
func (ValidatorManager) UpdateSigningValidator ¶
func (vm ValidatorManager) UpdateSigningValidator( ctx sdk.Context, signingValidators []abci.SigningValidator) sdk.Error
func (ValidatorManager) ValidatorWithdraw ¶
func (vm ValidatorManager) ValidatorWithdraw(ctx sdk.Context, username types.AccountKey, coin types.Coin) sdk.Error
this method won't check if it is a legal withdraw, caller should check by itself
func (ValidatorManager) ValidatorWithdrawAll ¶
func (vm ValidatorManager) ValidatorWithdrawAll(ctx sdk.Context, username types.AccountKey) (types.Coin, sdk.Error)
type ValidatorRevokeMsg ¶
type ValidatorRevokeMsg struct {
Username types.AccountKey `json:"username"`
}
func NewValidatorRevokeMsg ¶
func NewValidatorRevokeMsg(validator string) ValidatorRevokeMsg
ValidatorRevokeMsg Msg Implementations
func (ValidatorRevokeMsg) GetConsumeAmount ¶
func (msg ValidatorRevokeMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (ValidatorRevokeMsg) GetPermission ¶
func (msg ValidatorRevokeMsg) GetPermission() types.Permission
func (ValidatorRevokeMsg) GetSignBytes ¶
func (msg ValidatorRevokeMsg) GetSignBytes() []byte
func (ValidatorRevokeMsg) GetSigners ¶
func (msg ValidatorRevokeMsg) GetSigners() []sdk.AccAddress
func (ValidatorRevokeMsg) String ¶
func (msg ValidatorRevokeMsg) String() string
func (ValidatorRevokeMsg) Type ¶
func (msg ValidatorRevokeMsg) Type() string
func (ValidatorRevokeMsg) ValidateBasic ¶
func (msg ValidatorRevokeMsg) ValidateBasic() sdk.Error
type ValidatorWithdrawMsg ¶
type ValidatorWithdrawMsg struct { Username types.AccountKey `json:"username"` Amount types.LNO `json:"amount"` }
func NewValidatorWithdrawMsg ¶
func NewValidatorWithdrawMsg(validator string, amount types.LNO) ValidatorWithdrawMsg
ValidatorWithdrawMsg Msg Implementations
func (ValidatorWithdrawMsg) GetConsumeAmount ¶
func (msg ValidatorWithdrawMsg) GetConsumeAmount() types.Coin
Implements Msg.
func (ValidatorWithdrawMsg) GetPermission ¶
func (msg ValidatorWithdrawMsg) GetPermission() types.Permission
func (ValidatorWithdrawMsg) GetSignBytes ¶
func (msg ValidatorWithdrawMsg) GetSignBytes() []byte
func (ValidatorWithdrawMsg) GetSigners ¶
func (msg ValidatorWithdrawMsg) GetSigners() []sdk.AccAddress
func (ValidatorWithdrawMsg) String ¶
func (msg ValidatorWithdrawMsg) String() string
func (ValidatorWithdrawMsg) Type ¶
func (msg ValidatorWithdrawMsg) Type() string
func (ValidatorWithdrawMsg) ValidateBasic ¶
func (msg ValidatorWithdrawMsg) ValidateBasic() sdk.Error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.