Documentation ¶
Index ¶
- Constants
- func BeginBlocker(ctx context.Context, req abci.RequestBeginBlock)
- func BuildCurrentValidatorAddressKey() []byte
- func BuildInactiveValidatorKey(sec uint64, valAddress btypes.Address) []byte
- func BuildInactiveValidatorKeyByTime(inactiveTime time.Time, valAddress btypes.Address) []byte
- func BuildOwnerWithValidatorKey(ownerAddress btypes.Address) []byte
- func BuildValidatorByVotePower(votePower uint64, valAddress btypes.Address) []byte
- func BuildValidatorKey(valAddress btypes.Address) []byte
- func BuildValidatorStoreQueryPath() []byte
- func BuildValidatorVoteInfoInWindowKey(index uint64, valAddress btypes.Address) []byte
- func BuildValidatorVoteInfoKey(valAddress btypes.Address) []byte
- func BuildVoteInfoStoreQueryPath() []byte
- func BulidValidatorPrefixKey() []byte
- func EndBlocker(ctx context.Context) (res abci.ResponseEndBlock)
- func GetUpdatedValidators(ctx context.Context, maxValidatorCount uint64) []abci.Validator
- func RegisterCodec(cdc *amino.Codec)
- type TxActiveValidator
- func (tx *TxActiveValidator) CalcGas() btypes.BigInt
- func (tx *TxActiveValidator) Exec(ctx context.Context) (result btypes.Result, crossTxQcp *txs.TxQcp)
- func (tx *TxActiveValidator) GetGasPayer() btypes.Address
- func (tx *TxActiveValidator) GetSignData() (ret []byte)
- func (tx *TxActiveValidator) GetSigner() []btypes.Address
- func (tx *TxActiveValidator) ValidateData(ctx context.Context) error
- type TxCreateValidator
- func (tx *TxCreateValidator) CalcGas() btypes.BigInt
- func (tx *TxCreateValidator) Exec(ctx context.Context) (result btypes.Result, crossTxQcp *txs.TxQcp)
- func (tx *TxCreateValidator) GetGasPayer() btypes.Address
- func (tx *TxCreateValidator) GetSignData() (ret []byte)
- func (tx *TxCreateValidator) GetSigner() []btypes.Address
- func (tx *TxCreateValidator) ValidateData(ctx context.Context) error
- type TxRevokeValidator
- func (tx *TxRevokeValidator) CalcGas() btypes.BigInt
- func (tx *TxRevokeValidator) Exec(ctx context.Context) (result btypes.Result, crossTxQcp *txs.TxQcp)
- func (tx *TxRevokeValidator) GetGasPayer() btypes.Address
- func (tx *TxRevokeValidator) GetSignData() (ret []byte)
- func (tx *TxRevokeValidator) GetSigner() []btypes.Address
- func (tx *TxRevokeValidator) ValidateData(ctx context.Context) error
- type ValidatorMapper
- func (mapper *ValidatorMapper) Copy() mapper.IMapper
- func (mapper *ValidatorMapper) CreateValidator(validator types.Validator)
- func (mapper *ValidatorMapper) Exists(valAddress btypes.Address) bool
- func (mapper *ValidatorMapper) ExistsWithOwner(owner btypes.Address) bool
- func (mapper *ValidatorMapper) GetValidator(valAddress btypes.Address) (validator types.Validator, exsits bool)
- func (mapper *ValidatorMapper) GetValidatorByOwner(owner btypes.Address) (validator types.Validator, exsits bool)
- func (mapper *ValidatorMapper) IteratorInactiveValidator(fromSecond, endSecond uint64) store.Iterator
- func (mapper *ValidatorMapper) IteratorInactiveValidatorByTime(fromTime, endTime time.Time) store.Iterator
- func (mapper *ValidatorMapper) IteratorValidatrorByVoterPower(ascending bool) store.Iterator
- func (mapper *ValidatorMapper) KickValidator(valAddress btypes.Address) (validator types.Validator, ok bool)
- func (mapper *ValidatorMapper) MakeValidatorActive(valAddress btypes.Address)
- func (mapper *ValidatorMapper) MakeValidatorInactive(valAddress btypes.Address, inactiveHeight uint64, inactiveTime time.Time, ...)
- type VoteInfoMapper
- func (mapper *VoteInfoMapper) ClearValidatorVoteInfoInWindow(valAddr btypes.Address)
- func (mapper *VoteInfoMapper) Copy() mapper.IMapper
- func (mapper *VoteInfoMapper) DelValidatorVoteInfo(valAddr btypes.Address)
- func (mapper *VoteInfoMapper) GetValidatorVoteInfo(valAddr btypes.Address) (VoteInfo types.ValidatorVoteInfo, exsits bool)
- func (mapper *VoteInfoMapper) GetVoteInfoInWindow(valAddr btypes.Address, index uint64) (vote bool)
- func (mapper *VoteInfoMapper) ResetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)
- func (mapper *VoteInfoMapper) SetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)
- func (mapper *VoteInfoMapper) SetVoteInfoInWindow(valAddr btypes.Address, index uint64, vote bool)
Constants ¶
View Source
const (
ValidatorMapperName = "validator"
)
View Source
const (
VoteInfoMapperName = "voteInfo"
)
Variables ¶
This section is empty.
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx context.Context, req abci.RequestBeginBlock)
1. 统计validator投票信息, 将不活跃的validator转成Inactive状态
func BuildCurrentValidatorAddressKey ¶
func BuildCurrentValidatorAddressKey() []byte
func BuildValidatorKey ¶
func BuildValidatorStoreQueryPath ¶
func BuildValidatorStoreQueryPath() []byte
func BuildVoteInfoStoreQueryPath ¶
func BuildVoteInfoStoreQueryPath() []byte
func BulidValidatorPrefixKey ¶
func BulidValidatorPrefixKey() []byte
func EndBlocker ¶
func EndBlocker(ctx context.Context) (res abci.ResponseEndBlock)
1. 将所有Inactive到一定期限的validator删除 2. 统计新的validator
func GetUpdatedValidators ¶
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
Types ¶
type TxActiveValidator ¶
func NewActiveValidatorTx ¶
func NewActiveValidatorTx(owner btypes.Address) *TxActiveValidator
func (*TxActiveValidator) CalcGas ¶
func (tx *TxActiveValidator) CalcGas() btypes.BigInt
func (*TxActiveValidator) GetGasPayer ¶
func (tx *TxActiveValidator) GetGasPayer() btypes.Address
func (*TxActiveValidator) GetSignData ¶
func (tx *TxActiveValidator) GetSignData() (ret []byte)
func (*TxActiveValidator) GetSigner ¶
func (tx *TxActiveValidator) GetSigner() []btypes.Address
func (*TxActiveValidator) ValidateData ¶
func (tx *TxActiveValidator) ValidateData(ctx context.Context) error
type TxCreateValidator ¶
type TxCreateValidator struct { Name string Owner btypes.Address //操作者 PubKey crypto.PubKey //validator公钥 BondTokens uint64 //绑定Token数量 Description string }
func NewCreateValidatorTx ¶
func (*TxCreateValidator) CalcGas ¶
func (tx *TxCreateValidator) CalcGas() btypes.BigInt
func (*TxCreateValidator) GetGasPayer ¶
func (tx *TxCreateValidator) GetGasPayer() btypes.Address
func (*TxCreateValidator) GetSignData ¶
func (tx *TxCreateValidator) GetSignData() (ret []byte)
func (*TxCreateValidator) GetSigner ¶
func (tx *TxCreateValidator) GetSigner() []btypes.Address
func (*TxCreateValidator) ValidateData ¶
func (tx *TxCreateValidator) ValidateData(ctx context.Context) error
type TxRevokeValidator ¶
func NewRevokeValidatorTx ¶
func NewRevokeValidatorTx(owner btypes.Address) *TxRevokeValidator
func (*TxRevokeValidator) CalcGas ¶
func (tx *TxRevokeValidator) CalcGas() btypes.BigInt
func (*TxRevokeValidator) GetGasPayer ¶
func (tx *TxRevokeValidator) GetGasPayer() btypes.Address
func (*TxRevokeValidator) GetSignData ¶
func (tx *TxRevokeValidator) GetSignData() (ret []byte)
func (*TxRevokeValidator) GetSigner ¶
func (tx *TxRevokeValidator) GetSigner() []btypes.Address
func (*TxRevokeValidator) ValidateData ¶
func (tx *TxRevokeValidator) ValidateData(ctx context.Context) error
type ValidatorMapper ¶
type ValidatorMapper struct {
*mapper.BaseMapper
}
func GetValidatorMapper ¶
func GetValidatorMapper(ctx context.Context) *ValidatorMapper
func NewValidatorMapper ¶
func NewValidatorMapper() *ValidatorMapper
func (*ValidatorMapper) Copy ¶
func (mapper *ValidatorMapper) Copy() mapper.IMapper
func (*ValidatorMapper) CreateValidator ¶
func (mapper *ValidatorMapper) CreateValidator(validator types.Validator)
func (*ValidatorMapper) Exists ¶
func (mapper *ValidatorMapper) Exists(valAddress btypes.Address) bool
func (*ValidatorMapper) ExistsWithOwner ¶
func (mapper *ValidatorMapper) ExistsWithOwner(owner btypes.Address) bool
func (*ValidatorMapper) GetValidator ¶
func (*ValidatorMapper) GetValidatorByOwner ¶
func (*ValidatorMapper) IteratorInactiveValidator ¶
func (mapper *ValidatorMapper) IteratorInactiveValidator(fromSecond, endSecond uint64) store.Iterator
func (*ValidatorMapper) IteratorInactiveValidatorByTime ¶
func (mapper *ValidatorMapper) IteratorInactiveValidatorByTime(fromTime, endTime time.Time) store.Iterator
func (*ValidatorMapper) IteratorValidatrorByVoterPower ¶
func (mapper *ValidatorMapper) IteratorValidatrorByVoterPower(ascending bool) store.Iterator
func (*ValidatorMapper) KickValidator ¶
func (*ValidatorMapper) MakeValidatorActive ¶
func (mapper *ValidatorMapper) MakeValidatorActive(valAddress btypes.Address)
func (*ValidatorMapper) MakeValidatorInactive ¶
func (mapper *ValidatorMapper) MakeValidatorInactive(valAddress btypes.Address, inactiveHeight uint64, inactiveTime time.Time, code types.InactiveCode)
type VoteInfoMapper ¶
type VoteInfoMapper struct {
*mapper.BaseMapper
}
func GetVoteInfoMapper ¶
func GetVoteInfoMapper(ctx context.Context) *VoteInfoMapper
func NewVoteInfoMapper ¶
func NewVoteInfoMapper() *VoteInfoMapper
func (*VoteInfoMapper) ClearValidatorVoteInfoInWindow ¶
func (mapper *VoteInfoMapper) ClearValidatorVoteInfoInWindow(valAddr btypes.Address)
func (*VoteInfoMapper) Copy ¶
func (mapper *VoteInfoMapper) Copy() mapper.IMapper
func (*VoteInfoMapper) DelValidatorVoteInfo ¶
func (mapper *VoteInfoMapper) DelValidatorVoteInfo(valAddr btypes.Address)
func (*VoteInfoMapper) GetValidatorVoteInfo ¶
func (mapper *VoteInfoMapper) GetValidatorVoteInfo(valAddr btypes.Address) (VoteInfo types.ValidatorVoteInfo, exsits bool)
func (*VoteInfoMapper) GetVoteInfoInWindow ¶
func (mapper *VoteInfoMapper) GetVoteInfoInWindow(valAddr btypes.Address, index uint64) (vote bool)
func (*VoteInfoMapper) ResetValidatorVoteInfo ¶
func (mapper *VoteInfoMapper) ResetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)
func (*VoteInfoMapper) SetValidatorVoteInfo ¶
func (mapper *VoteInfoMapper) SetValidatorVoteInfo(valAddr btypes.Address, info types.ValidatorVoteInfo)
func (*VoteInfoMapper) SetVoteInfoInWindow ¶
func (mapper *VoteInfoMapper) SetVoteInfoInWindow(valAddr btypes.Address, index uint64, vote bool)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.