Versions in this module Expand all Collapse all v1 v1.3.1 Jul 31, 2021 Changes in this version + const EPOCH_NOT_EXIST + const EPOCH_PROPOSED_NOT_VOTED + const EPOCH_SAVED + const EPOCH_VOTED_NOT_SAVED + const ForbiddenDuration + const MaximumValidatorsSize + const MinimumValidatorsSize + const TimeForForbidden + var ForbiddenEpoch = big.NewInt(2) + var NextEpochNotEXPECTED = errors.New("next epoch parameters are not excepted, fatal error") + var NextEpochNotExist = errors.New("next epoch parameters do not exist, fatal error") + func DryRunUpdateEpochValidatorSet(state *state.StateDB, validators *tmTypes.ValidatorSet, ...) error + func SaveEpochVoteSet(epochDB db.DB, epochNumber uint64, voteSet *EpochValidatorVoteSet) + func UpdateEpochEndTime(db dbm.DB, epNumber uint64, endTime time.Time) + type Epoch struct + BlockGenerated int + EndBlock uint64 + EndTime time.Time + Number uint64 + RewardPerBlock *big.Int + StartBlock uint64 + StartTime time.Time + Status int + Validators *tmTypes.ValidatorSet + func FromBytes(buf []byte) *Epoch + func InitEpoch(db dbm.DB, genDoc *tmTypes.GenesisDoc, logger log.Logger) *Epoch + func LoadOneEpoch(db dbm.DB, epochNumber uint64, logger log.Logger) *Epoch + func MakeOneEpoch(db dbm.DB, oneEpoch *tmTypes.OneEpochDoc, logger log.Logger) *Epoch + func (epoch *Epoch) Bytes() []byte + func (epoch *Epoch) Copy() *Epoch + func (epoch *Epoch) EnterNewEpoch(newValidators *tmTypes.ValidatorSet) (*Epoch, error) + func (epoch *Epoch) Equals(other *Epoch, checkPrevNext bool) bool + func (epoch *Epoch) GetDB() dbm.DB + func (epoch *Epoch) GetEpochByBlockNumber(blockNumber uint64) *Epoch + func (epoch *Epoch) GetEpochValidatorVoteSet() *EpochValidatorVoteSet + func (epoch *Epoch) GetForbiddenDuration() time.Duration + func (epoch *Epoch) GetNextEpoch() *Epoch + func (epoch *Epoch) GetPreviousEpoch() *Epoch + func (epoch *Epoch) GetRewardScheme() *RewardScheme + func (epoch *Epoch) ProposeNextEpoch(lastBlockHeight uint64, lastBlockTime time.Time) *Epoch + func (epoch *Epoch) Save() + func (epoch *Epoch) SetNextEpoch(next *Epoch) + func (epoch *Epoch) SetRewardScheme(rs *RewardScheme) + func (epoch *Epoch) ShouldEnterNewEpoch(height uint64, state *state.StateDB) (bool, *tmTypes.ValidatorSet, error) + func (epoch *Epoch) ShouldProposeNextEpoch(curBlockHeight uint64) bool + func (epoch *Epoch) String() string + func (epoch *Epoch) UpdateForbiddenState(header *types.Header, prevHeader *types.Header, commit *tmTypes.Commit, ...) + func (epoch *Epoch) ValidateNextEpoch(next *Epoch, lastHeight uint64, lastBlockTime time.Time) error + type EpochValidatorVote struct + Address common.Address + Amount *big.Int + PubKey crypto.PubKey + Salt string + TxHash common.Hash + VoteHash common.Hash + func (vote *EpochValidatorVote) Copy() *EpochValidatorVote + type EpochValidatorVoteSet struct + Votes []*EpochValidatorVote + func LoadEpochVoteSet(epochDB db.DB, epochNumber uint64) *EpochValidatorVoteSet + func NewEpochValidatorVoteSet() *EpochValidatorVoteSet + func (voteSet *EpochValidatorVoteSet) Copy() *EpochValidatorVoteSet + func (voteSet *EpochValidatorVoteSet) GetVoteByAddress(address common.Address) (vote *EpochValidatorVote, exist bool) + func (voteSet *EpochValidatorVoteSet) IsEmpty() bool + func (voteSet *EpochValidatorVoteSet) StoreVote(vote *EpochValidatorVote) + type RewardScheme struct + EpochNumberPerYear uint64 + RewardFirstYear *big.Int + TotalReward *big.Int + TotalYear uint64 + func LoadRewardScheme(db dbm.DB) *RewardScheme + func MakeRewardScheme(db dbm.DB, rsDoc *tmTypes.RewardSchemeDoc) *RewardScheme + func (rs *RewardScheme) Save() + func (rs *RewardScheme) String() string v1.3.0 Jul 31, 2021