Documentation ¶
Index ¶
- Constants
- Variables
- func CalcUnstakeLockPeriod(lMin *big.Int, lMax *big.Int, totalStake *big.Int, totalSupply *big.Int) int64
- func NewObjectImpl(tag icobject.Tag) (icobject.Impl, error)
- func NewRewardFund2Allocation(param []interface{}) (map[RFundKey]icmodule.Rate, error)
- func NewStringPtr(s string) *string
- func NewVotingIterator(votings []Voting) *votingIterator
- func ScheduleTimerJob(t *TimerState, info TimerJobInfo, address module.Address)
- func SortByPower(sc icmodule.StateContext, preps []*PRep)
- func ValidatePRepCountConfig(main, sub, extra int64) error
- type AccountCache
- type AccountSnapshot
- func (a *AccountSnapshot) Bond() *big.Int
- func (a *AccountSnapshot) Bonds() Bonds
- func (a *AccountSnapshot) Delegating() *big.Int
- func (a *AccountSnapshot) Delegations() Delegations
- func (a *AccountSnapshot) Equal(object icobject.Impl) bool
- func (a *AccountSnapshot) Format(f fmt.State, c rune)
- func (a *AccountSnapshot) GetBondInJSON() map[string]interface{}
- func (a AccountSnapshot) GetDelegationInJSON() map[string]interface{}
- func (a AccountSnapshot) GetStakeInJSON(blockHeight int64) map[string]interface{}
- func (a AccountSnapshot) GetTotalStake() *big.Int
- func (a *AccountSnapshot) GetUnbondsInJSON() []interface{}
- func (a AccountSnapshot) GetUnstakeAmount() *big.Int
- func (a *AccountSnapshot) GetVoting() *big.Int
- func (a *AccountSnapshot) GetVotingPower() *big.Int
- func (a AccountSnapshot) IsEmpty() bool
- func (a *AccountSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (a *AccountSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (a AccountSnapshot) Stake() *big.Int
- func (a *AccountSnapshot) String() string
- func (a AccountSnapshot) UnStakes() Unstakes
- func (a *AccountSnapshot) Unbond() *big.Int
- func (a *AccountSnapshot) Unbonds() Unbonds
- func (a *AccountSnapshot) UsingStake() *big.Int
- func (a *AccountSnapshot) Version() int
- type AccountState
- func (a *AccountState) Bond() *big.Int
- func (a *AccountState) Bonds() Bonds
- func (a *AccountState) Clear()
- func (a *AccountState) DecreaseUnstake(stakeInc *big.Int, expireHeight int64, revision int) ([]TimerJobInfo, error)
- func (a *AccountState) Delegating() *big.Int
- func (a *AccountState) Delegations() Delegations
- func (a *AccountState) Format(f fmt.State, c rune)
- func (a *AccountState) GetBondInJSON() map[string]interface{}
- func (a AccountState) GetDelegationInJSON() map[string]interface{}
- func (a *AccountState) GetSnapshot() *AccountSnapshot
- func (a AccountState) GetStakeInJSON(blockHeight int64) map[string]interface{}
- func (a AccountState) GetTotalStake() *big.Int
- func (a *AccountState) GetUnbondsInJSON() []interface{}
- func (a AccountState) GetUnstakeAmount() *big.Int
- func (a *AccountState) GetVoting() *big.Int
- func (a *AccountState) GetVotingPower() *big.Int
- func (a *AccountState) IncreaseUnstake(stakeInc *big.Int, expireHeight int64, slotMax, revision int) ([]TimerJobInfo, error)
- func (a AccountState) IsEmpty() bool
- func (a *AccountState) RemoveUnbond(height int64) error
- func (a *AccountState) RemoveUnstake(height int64) (ra *big.Int, err error)
- func (a *AccountState) Reset(s *AccountSnapshot)
- func (a *AccountState) SetBonds(bonds Bonds)
- func (a *AccountState) SetDelegation(ds Delegations)
- func (a *AccountState) SetStake(v *big.Int) error
- func (a *AccountState) SlashBond(address module.Address, rate icmodule.Rate) *big.Int
- func (a *AccountState) SlashStake(amount *big.Int) error
- func (a *AccountState) SlashUnbond(address module.Address, rate icmodule.Rate) (*big.Int, int64)
- func (a AccountState) Stake() *big.Int
- func (a *AccountState) String() string
- func (a AccountState) UnStakes() Unstakes
- func (a *AccountState) Unbond() *big.Int
- func (a *AccountState) Unbonds() Unbonds
- func (a *AccountState) UpdateUnbonds(bondDelta map[string]*big.Int, expireHeight int64) ([]TimerJobInfo, error)
- func (a *AccountState) UsingStake() *big.Int
- type AllPRepCache
- type BlockVotersSnapshot
- func (bvs *BlockVotersSnapshot) Equal(object icobject.Impl) bool
- func (bvs *BlockVotersSnapshot) Format(f fmt.State, verb rune)
- func (bvd BlockVotersSnapshot) Get(i int) module.Address
- func (bvd BlockVotersSnapshot) IndexOf(owner module.Address) int
- func (bvd BlockVotersSnapshot) Len() int
- func (bvs *BlockVotersSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (bvs *BlockVotersSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (bvs *BlockVotersSnapshot) Version() int
- type Bond
- func (b *Bond) Amount() *big.Int
- func (b *Bond) Clone() *Bond
- func (b *Bond) Equal(b2 *Bond) bool
- func (b *Bond) Format(f fmt.State, c rune)
- func (b *Bond) Slash(rate icmodule.Rate) *big.Int
- func (b *Bond) String() string
- func (b *Bond) To() module.Address
- func (b *Bond) ToJSON() map[string]interface{}
- type BonderList
- type Bonds
- func (bs *Bonds) Clone() Bonds
- func (bs Bonds) Contains(addr module.Address) bool
- func (bs *Bonds) Delete(i int) error
- func (bs Bonds) Delta(bs2 Bonds) map[string]*big.Int
- func (bs *Bonds) Equal(bl2 Bonds) bool
- func (bs *Bonds) GetBondAmount() *big.Int
- func (bs *Bonds) Has() bool
- func (bs *Bonds) Iterator() VotingIterator
- func (bs *Bonds) Slash(address module.Address, rate icmodule.Rate) (Bonds, *big.Int)
- func (bs *Bonds) ToJSON(v module.JSONVersion) []interface{}
- func (bs *Bonds) ToMap() map[string]*Bond
- type CommissionInfo
- func (ci *CommissionInfo) Clone() *CommissionInfo
- func (ci *CommissionInfo) Equal(other *CommissionInfo) bool
- func (ci *CommissionInfo) MaxChangeRate() icmodule.Rate
- func (ci *CommissionInfo) MaxRate() icmodule.Rate
- func (ci *CommissionInfo) RLPDecodeSelf(d codec.Decoder) error
- func (ci *CommissionInfo) RLPEncodeSelf(e codec.Encoder) error
- func (ci *CommissionInfo) Rate() icmodule.Rate
- func (ci *CommissionInfo) SetRate(rate icmodule.Rate) error
- func (ci *CommissionInfo) String() string
- func (ci *CommissionInfo) ToJSON(jso map[string]interface{}) map[string]interface{}
- type Delegation
- func (dg *Delegation) Amount() *big.Int
- func (dg *Delegation) Clone() *Delegation
- func (dg *Delegation) Equal(d2 *Delegation) bool
- func (dg *Delegation) Format(f fmt.State, c rune)
- func (dg *Delegation) String() string
- func (dg *Delegation) To() module.Address
- func (dg *Delegation) ToJSON() map[string]interface{}
- type Delegations
- func (ds Delegations) Clone() Delegations
- func (ds *Delegations) Delete(i int) error
- func (ds Delegations) Delta(ds2 Delegations) map[string]*big.Int
- func (ds Delegations) Equal(ds2 Delegations) bool
- func (ds Delegations) GetDelegationAmount() *big.Int
- func (ds Delegations) Has() bool
- func (ds *Delegations) Iterator() VotingIterator
- func (ds Delegations) ToJSON(_ module.JSONVersion) []interface{}
- func (ds *Delegations) ToMap() map[string]*Delegation
- type Grade
- type IllegalDelegation
- func (d *IllegalDelegation) Address() module.Address
- func (d *IllegalDelegation) Clone() *IllegalDelegation
- func (d *IllegalDelegation) Delegations() Delegations
- func (d *IllegalDelegation) Equal(o icobject.Impl) bool
- func (d *IllegalDelegation) Format(f fmt.State, c rune)
- func (d *IllegalDelegation) RLPDecodeFields(decoder codec.Decoder) error
- func (d *IllegalDelegation) RLPEncodeFields(encoder codec.Encoder) error
- func (d *IllegalDelegation) SetDelegations(ds Delegations)
- func (d *IllegalDelegation) Version() int
- type Issue
- func (i *Issue) Clone() *Issue
- func (i *Issue) Equal(o icobject.Impl) bool
- func (i *Issue) Format(f fmt.State, c rune)
- func (i *Issue) GetOverIssuedICX() *big.Int
- func (i *Issue) OverIssuedIScore() *big.Int
- func (i *Issue) PrevBlockFee() *big.Int
- func (i *Issue) PrevTotalReward() *big.Int
- func (i *Issue) RLPDecodeFields(decoder codec.Decoder) error
- func (i *Issue) RLPEncodeFields(encoder codec.Encoder) error
- func (i *Issue) ResetTotalReward()
- func (i *Issue) SetOverIssuedIScore(v *big.Int)
- func (i *Issue) SetPrevBlockFee(v *big.Int)
- func (i *Issue) SetPrevTotalReward(v *big.Int)
- func (i *Issue) SetTotalReward(v *big.Int)
- func (i *Issue) TotalReward() *big.Int
- func (i *Issue) Update(totalReward *big.Int, byFee *big.Int, byOverIssued *big.Int) *Issue
- func (i *Issue) Version() int
- type JailInfo
- func (ji *JailInfo) Flags() int
- func (ji *JailInfo) Format(f fmt.State, c rune)
- func (ji *JailInfo) IsElectable() bool
- func (ji *JailInfo) IsEmpty() bool
- func (ji *JailInfo) IsInJail() bool
- func (ji *JailInfo) IsUnjailable() bool
- func (ji *JailInfo) IsUnjailing() bool
- func (ji *JailInfo) MinDoubleSignHeight() int64
- func (ji *JailInfo) OnMainPRepIn(sc icmodule.StateContext) error
- func (ji *JailInfo) OnPenaltyImposed(sc icmodule.StateContext, pt icmodule.PenaltyType) error
- func (ji *JailInfo) OnUnjailRequested(sc icmodule.StateContext) error
- func (ji *JailInfo) RLPDecodeSelf(d codec.Decoder) error
- func (ji *JailInfo) RLPEncodeSelf(e codec.Encoder) error
- func (ji JailInfo) String() string
- func (ji *JailInfo) ToJSON(sc icmodule.StateContext, jso map[string]interface{}) map[string]interface{}
- func (ji *JailInfo) UnjailRequestHeight() int64
- type JobType
- type NodeOwnerCache
- type OwnerToNodeMappable
- type PRep
- func (ps PRep) Bonded() *big.Int
- func (ps PRep) Delegated() *big.Int
- func (ps PRep) EffectiveDelegated() *big.Int
- func (ps PRep) Format(f fmt.State, c rune)
- func (ps PRep) GetBondedDelegation(br icmodule.Rate) *big.Int
- func (ps PRep) GetDSAMask() int64
- func (ps PRep) GetPower(bondRequirement icmodule.Rate) *big.Int
- func (ps PRep) GetVFail(blockHeight int64) int64
- func (ps PRep) GetVFailCont(blockHeight int64) int64
- func (ps PRep) GetVPenaltyCount() int
- func (ps PRep) GetVTotal(blockHeight int64) int64
- func (ps PRep) Grade() Grade
- func (p *PRep) HasPubKey(dsaMask int64) bool
- func (p *PRep) IRep() *big.Int
- func (p *PRep) Info() *PRepInfo
- func (ps PRep) IsActive() bool
- func (ps PRep) IsAlreadyPenalized() bool
- func (ps PRep) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
- func (p *PRep) IsElectable(sc icmodule.StateContext) bool
- func (ps PRep) IsEmpty() bool
- func (ps PRep) IsInJail() bool
- func (ps PRep) IsJailInfoElectable() bool
- func (ps PRep) IsUnjailable() bool
- func (ps PRep) IsUnjailing() bool
- func (ps PRep) JailFlags() int
- func (ps PRep) LastHeight() int64
- func (ps PRep) LastState() VoteState
- func (ps PRep) MinDoubleSignHeight() int64
- func (p *PRep) NodeAddress() module.Address
- func (p *PRep) Owner() module.Address
- func (ps PRep) Status() Status
- func (ps PRep) String() string
- func (p *PRep) ToJSON(sc icmodule.StateContext) map[string]interface{}
- func (ps PRep) UnjailRequestHeight() int64
- func (ps PRep) VFail() int64
- func (ps PRep) VTotal() int64
- type PRepBaseCache
- type PRepBaseData
- func (p *PRepBaseData) BonderList() BonderList
- func (p *PRepBaseData) CommissionRate() icmodule.Rate
- func (p *PRepBaseData) Format(f fmt.State, c rune)
- func (p *PRepBaseData) GetBonderListInJSON() []interface{}
- func (p *PRepBaseData) GetNode(owner module.Address) module.Address
- func (p *PRepBaseData) IRep() *big.Int
- func (p *PRepBaseData) IRepHeight() int64
- func (p *PRepBaseData) IsEmpty() bool
- func (p *PRepBaseData) MaxCommissionChangeRate() icmodule.Rate
- func (p *PRepBaseData) MaxCommissionRate() icmodule.Rate
- func (p *PRepBaseData) Name() string
- func (p *PRepBaseData) P2PEndpoint() string
- func (p *PRepBaseData) String() string
- func (p *PRepBaseData) ToJSON(owner module.Address) map[string]interface{}
- func (p *PRepBaseData) Version() int
- type PRepBaseSnapshot
- type PRepBaseState
- func (p *PRepBaseState) Clear()
- func (p *PRepBaseState) CommissionInfoExists() bool
- func (p *PRepBaseState) GetSnapshot() *PRepBaseSnapshot
- func (p *PRepBaseState) InitCommissionInfo(ci *CommissionInfo) error
- func (p *PRepBaseState) Reset(snapshot *PRepBaseSnapshot) *PRepBaseState
- func (p *PRepBaseState) SetBonderList(bonderList BonderList)
- func (p *PRepBaseState) SetCommissionRate(rate icmodule.Rate) error
- func (p *PRepBaseState) SetIrep(irep *big.Int, irepHeight int64)
- func (p *PRepBaseState) UpdateInfo(info *PRepInfo)
- type PRepCountConfig
- type PRepCountType
- type PRepInfo
- type PRepSet
- type PRepSnapshot
- func (pss *PRepSnapshot) Equal(other *PRepSnapshot) bool
- func (pss *PRepSnapshot) Owner() module.Address
- func (pss *PRepSnapshot) Power() *big.Int
- func (pss *PRepSnapshot) RLPDecodeSelf(d codec.Decoder) error
- func (pss *PRepSnapshot) RLPEncodeSelf(e codec.Encoder) error
- func (pss *PRepSnapshot) String() string
- func (pss *PRepSnapshot) ToJSON() map[string]interface{}
- type PRepSnapshots
- type PRepStatusCache
- type PRepStatusSnapshot
- func (ps *PRepStatusSnapshot) Bonded() *big.Int
- func (ps *PRepStatusSnapshot) Delegated() *big.Int
- func (ps *PRepStatusSnapshot) EffectiveDelegated() *big.Int
- func (ps *PRepStatusSnapshot) Equal(o icobject.Impl) bool
- func (ps *PRepStatusSnapshot) Format(f fmt.State, c rune)
- func (ps *PRepStatusSnapshot) GetBondedDelegation(br icmodule.Rate) *big.Int
- func (ps *PRepStatusSnapshot) GetDSAMask() int64
- func (ps *PRepStatusSnapshot) GetPower(bondRequirement icmodule.Rate) *big.Int
- func (ps *PRepStatusSnapshot) GetStatsInJSON(blockHeight int64) map[string]interface{}
- func (ps *PRepStatusSnapshot) GetVFail(blockHeight int64) int64
- func (ps *PRepStatusSnapshot) GetVFailCont(blockHeight int64) int64
- func (ps *PRepStatusSnapshot) GetVPenaltyCount() int
- func (ps *PRepStatusSnapshot) GetVTotal(blockHeight int64) int64
- func (ps *PRepStatusSnapshot) Grade() Grade
- func (ps *PRepStatusSnapshot) IsActive() bool
- func (ps *PRepStatusSnapshot) IsAlreadyPenalized() bool
- func (ps *PRepStatusSnapshot) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
- func (ps *PRepStatusSnapshot) IsEmpty() bool
- func (ps *PRepStatusSnapshot) IsInJail() bool
- func (ps *PRepStatusSnapshot) IsJailInfoElectable() bool
- func (ps *PRepStatusSnapshot) IsUnjailable() bool
- func (ps *PRepStatusSnapshot) IsUnjailing() bool
- func (ps *PRepStatusSnapshot) JailFlags() int
- func (ps *PRepStatusSnapshot) LastHeight() int64
- func (ps *PRepStatusSnapshot) LastState() VoteState
- func (ps *PRepStatusSnapshot) MinDoubleSignHeight() int64
- func (ps *PRepStatusSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (ps *PRepStatusSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (ps *PRepStatusSnapshot) Status() Status
- func (ps *PRepStatusSnapshot) String() string
- func (ps *PRepStatusSnapshot) ToJSON(sc icmodule.StateContext) map[string]interface{}
- func (ps *PRepStatusSnapshot) UnjailRequestHeight() int64
- func (ps *PRepStatusSnapshot) VFail() int64
- func (ps *PRepStatusSnapshot) VTotal() int64
- func (ps *PRepStatusSnapshot) Version() int
- type PRepStatusState
- func (ps *PRepStatusState) Activate() error
- func (ps *PRepStatusState) Bonded() *big.Int
- func (ps *PRepStatusState) Clear()
- func (ps *PRepStatusState) Delegated() *big.Int
- func (ps *PRepStatusState) DisableAs(status Status) (Grade, error)
- func (ps *PRepStatusState) EffectiveDelegated() *big.Int
- func (ps *PRepStatusState) Format(f fmt.State, c rune)
- func (ps *PRepStatusState) GetBondedDelegation(br icmodule.Rate) *big.Int
- func (ps *PRepStatusState) GetDSAMask() int64
- func (ps *PRepStatusState) GetPower(bondRequirement icmodule.Rate) *big.Int
- func (ps *PRepStatusState) GetSnapshot() *PRepStatusSnapshot
- func (ps *PRepStatusState) GetStatsInJSON(sc icmodule.StateContext) map[string]interface{}
- func (ps *PRepStatusState) GetVFail(blockHeight int64) int64
- func (ps *PRepStatusState) GetVFailCont(blockHeight int64) int64
- func (ps *PRepStatusState) GetVPenaltyCount() int
- func (ps *PRepStatusState) GetVTotal(blockHeight int64) int64
- func (ps *PRepStatusState) Grade() Grade
- func (ps *PRepStatusState) IsActive() bool
- func (ps *PRepStatusState) IsAlreadyPenalized() bool
- func (ps *PRepStatusState) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
- func (ps *PRepStatusState) IsEmpty() bool
- func (ps *PRepStatusState) IsInJail() bool
- func (ps *PRepStatusState) IsJailInfoElectable() bool
- func (ps *PRepStatusState) IsUnjailable() bool
- func (ps *PRepStatusState) IsUnjailing() bool
- func (ps *PRepStatusState) JailFlags() int
- func (ps *PRepStatusState) LastHeight() int64
- func (ps *PRepStatusState) LastState() VoteState
- func (ps *PRepStatusState) MinDoubleSignHeight() int64
- func (ps *PRepStatusState) OnEvent(sc icmodule.StateContext, event icmodule.PRepEvent, data ...interface{}) error
- func (ps *PRepStatusState) Owner() module.Address
- func (ps *PRepStatusState) Reset(ss *PRepStatusSnapshot) *PRepStatusState
- func (ps *PRepStatusState) SetBonded(v *big.Int)
- func (ps *PRepStatusState) SetDSAMask(m int64)
- func (ps *PRepStatusState) SetDelegated(delegated *big.Int)
- func (ps *PRepStatusState) SetEffectiveDelegated(value *big.Int)
- func (ps *PRepStatusState) SetStatus(s Status)
- func (ps *PRepStatusState) SetVTotal(t int64)
- func (ps *PRepStatusState) Status() Status
- func (ps *PRepStatusState) String() string
- func (ps *PRepStatusState) ToJSON(sc icmodule.StateContext) map[string]interface{}
- func (ps *PRepStatusState) UnjailRequestHeight() int64
- func (ps *PRepStatusState) VFail() int64
- func (ps *PRepStatusState) VTotal() int64
- type RFundKey
- type RewardCalcInfo
- func (rc *RewardCalcInfo) Clone() *RewardCalcInfo
- func (rc *RewardCalcInfo) Equal(o icobject.Impl) bool
- func (rc *RewardCalcInfo) Format(f fmt.State, c rune)
- func (rc *RewardCalcInfo) GetResultInJSON() map[string]interface{}
- func (rc *RewardCalcInfo) PrevCalcReward() *big.Int
- func (rc *RewardCalcInfo) PrevHash() []byte
- func (rc *RewardCalcInfo) PrevHeight() int64
- func (rc *RewardCalcInfo) PrevPeriod() int64
- func (rc *RewardCalcInfo) RLPDecodeFields(decoder codec.Decoder) error
- func (rc *RewardCalcInfo) RLPEncodeFields(encoder codec.Encoder) error
- func (rc *RewardCalcInfo) SetPrevCalcReward(v *big.Int)
- func (rc *RewardCalcInfo) SetPrevHash(hash []byte)
- func (rc *RewardCalcInfo) SetPrevHeight(height int64)
- func (rc *RewardCalcInfo) SetStartHeight(height int64)
- func (rc *RewardCalcInfo) StartHeight() int64
- func (rc *RewardCalcInfo) Update(blockHeight int64, reward *big.Int, hash []byte)
- func (rc *RewardCalcInfo) Version() int
- type RewardFund
- func NewRewardFund(version int) *RewardFund
- func NewRewardFundFromByte(bs []byte) (*RewardFund, error)
- func NewSafeRewardFundV1(iglobal *big.Int, iprep, icps, irelay, ivoter icmodule.Rate) (*RewardFund, error)
- func NewSafeRewardFundV2(iglobal *big.Int, iprep, iwage, icps, irelay icmodule.Rate) (*RewardFund, error)
- func (r *RewardFund) Bytes() []byte
- func (r *RewardFund) Clone() *RewardFund
- func (r *RewardFund) Equal(r2 *RewardFund) bool
- func (r *RewardFund) Format(f fmt.State, c rune)
- func (r *RewardFund) GetAllocationByKey(key RFundKey) icmodule.Rate
- func (r *RewardFund) GetAmount(key RFundKey) *big.Int
- func (r *RewardFund) GetOrderAllocationKeys() []RFundKey
- func (r *RewardFund) ICps() icmodule.Rate
- func (r *RewardFund) IGlobal() *big.Int
- func (r *RewardFund) IPrep() icmodule.Rate
- func (r *RewardFund) IRelay() icmodule.Rate
- func (r *RewardFund) IVoter() icmodule.Rate
- func (r *RewardFund) Iwage() icmodule.Rate
- func (r *RewardFund) RLPDecodeSelf(d codec.Decoder) error
- func (r *RewardFund) RLPEncodeSelf(encoder codec.Encoder) error
- func (r *RewardFund) SetAllocation(alloc map[RFundKey]icmodule.Rate) error
- func (r *RewardFund) SetIGlobal(value *big.Int) error
- func (r *RewardFund) ToJSON() map[string]interface{}
- func (r *RewardFund) ToRewardFundV2() *RewardFund
- type Snapshot
- type State
- func (s *State) CheckConsistentValidationPenalty(revision int, ps *PRepStatusState) bool
- func (s *State) CheckValidationPenalty(ps *PRepStatusState, blockHeight int64) bool
- func (s *State) ClearCache()
- func (s *State) DeleteIllegalDelegation(addr module.Address) error
- func (s *State) DisablePRep(sc icmodule.StateContext, owner module.Address, status Status) error
- func (s *State) Flush() error
- func (s *State) GetAccountSnapshot(addr module.Address) *AccountSnapshot
- func (s *State) GetAccountState(addr module.Address) *AccountState
- func (s *State) GetBondRequirement(revision int) icmodule.Rate
- func (s *State) GetConsistentValidationPenaltyCondition() int64
- func (s *State) GetConsistentValidationPenaltyMask() int
- func (s *State) GetDelegationSlotMax() int
- func (s *State) GetExtraMainPRepCount() int64
- func (s *State) GetIISSVersion() int
- func (s *State) GetIRep() *big.Int
- func (s *State) GetIllegalDelegation(addr module.Address) *IllegalDelegation
- func (s *State) GetIssue() (*Issue, error)
- func (s *State) GetLastBlockVotersSnapshot() *BlockVotersSnapshot
- func (s *State) GetLockMaxMultiplier() *big.Int
- func (s *State) GetLockMinMultiplier() *big.Int
- func (s *State) GetMainPRepCount() int64
- func (s *State) GetMinimumBond() *big.Int
- func (s *State) GetNetworkInfoInJSON(revision int) (map[string]interface{}, error)
- func (s *State) GetNetworkScoreTimerSnapshot(height int64) *TimerSnapshot
- func (s *State) GetNetworkScoreTimerState(height int64) *TimerState
- func (s *State) GetNetworkScores(cc icmodule.CallContext) map[string]module.Address
- func (s *State) GetNodeByOwner(owner module.Address) module.Address
- func (s *State) GetOwnerByNode(node module.Address) module.Address
- func (s *State) GetPRepBaseByOwner(owner module.Address, createIfNotExist bool) *PRepBaseState
- func (s *State) GetPRepByOwner(owner module.Address) *PRep
- func (s *State) GetPRepCountConfig(revision int) PRepCountConfig
- func (s *State) GetPRepIllegalDelegated(address module.Address) *big.Int
- func (s *State) GetPRepStatsInJSON(sc icmodule.StateContext) (map[string]interface{}, error)
- func (s *State) GetPRepStatsOfInJSON(sc icmodule.StateContext, address module.Address) (map[string]interface{}, error)
- func (s *State) GetPRepStatusByOwner(owner module.Address, createIfNotExist bool) *PRepStatusState
- func (s *State) GetPRepStatuses() ([]*PRepStatusState, error)
- func (s *State) GetPReps(activeOnly bool) []*PRep
- func (s *State) GetPRepsInJSON(sc icmodule.StateContext, start, end int) (map[string]interface{}, error)
- func (s *State) GetRRep() *big.Int
- func (s *State) GetRewardCalcInfo() (*RewardCalcInfo, error)
- func (s *State) GetRewardFund(revision int) *RewardFund
- func (s *State) GetRewardFundV1() *RewardFund
- func (s *State) GetRewardFundV2() *RewardFund
- func (s *State) GetSlashingRate(revision int, penaltyType icmodule.PenaltyType) (icmodule.Rate, error)
- func (s *State) GetSnapshot() *Snapshot
- func (s *State) GetSubPRepCount() int64
- func (s *State) GetTermPeriod() int64
- func (s *State) GetTermSnapshot() *TermSnapshot
- func (s *State) GetTotalBond() *big.Int
- func (s *State) GetTotalDelegation() *big.Int
- func (s *State) GetTotalStake() *big.Int
- func (s *State) GetUnbondingMax() int64
- func (s *State) GetUnbondingPeriodMultiplier() int64
- func (s *State) GetUnbondingTimerSnapshot(height int64) *TimerSnapshot
- func (s *State) GetUnbondingTimerState(height int64) *TimerState
- func (s *State) GetUnstakeLockPeriod(revision int, totalSupply *big.Int) int64
- func (s *State) GetUnstakeSlotMax() int64
- func (s *State) GetUnstakingTimerSnapshot(height int64) *TimerSnapshot
- func (s *State) GetUnstakingTimerState(height int64) *TimerState
- func (s *State) GetValidationPenaltyCondition() int64
- func (s *State) GetValidatorsSnapshot() *ValidatorsSnapshot
- func (s *State) ImposePenalty(sc icmodule.StateContext, pt icmodule.PenaltyType, ps *PRepStatusState) error
- func (s *State) InitCommissionInfo(owner module.Address, ci *CommissionInfo) error
- func (s *State) IsDecentralizationConditionMet(revision int, totalSupply *big.Int, preps PRepSet) bool
- func (s *State) MigrateBondRequirement(revision int) error
- func (s *State) OnBlockVote(sc icmodule.StateContext, owner module.Address, voted bool) error
- func (s *State) OnMainPRepReplaced(sc icmodule.StateContext, oldOwner, newOwner module.Address) error
- func (s *State) OnValidatorOut(sc icmodule.StateContext, owner module.Address) error
- func (s *State) ReducePRepBonded(owner module.Address, amount *big.Int) error
- func (s *State) RegisterPRep(owner module.Address, ri *PRepInfo, irep *big.Int, irepHeight int64) error
- func (s *State) Reset(ss *Snapshot) error
- func (s *State) SetBondRequirement(revision int, br icmodule.Rate) error
- func (s *State) SetConsistentValidationPenaltyCondition(value int64) error
- func (s *State) SetConsistentValidationPenaltyMask(value int64) error
- func (s *State) SetDelegationSlotMax(value int64) error
- func (s *State) SetExtraMainPRepCount(value int64) error
- func (s *State) SetIISSVersion(value int) error
- func (s *State) SetIRep(value *big.Int) error
- func (s *State) SetIllegalDelegation(id *IllegalDelegation) error
- func (s *State) SetIssue(issue *Issue) error
- func (s *State) SetLastBlockVotersSnapshot(value *BlockVotersSnapshot) error
- func (s *State) SetLockVariables(lockMin *big.Int, lockMax *big.Int) error
- func (s *State) SetMainPRepCount(value int64) error
- func (s *State) SetMinimumBond(bond *big.Int) error
- func (s *State) SetNetworkScore(role string, address module.Address) error
- func (s *State) SetPRep(blockHeight int64, owner module.Address, info *PRepInfo) (bool, error)
- func (s *State) SetPRepIllegalDelegated(address module.Address, value *big.Int) error
- func (s *State) SetRRep(value *big.Int) error
- func (s *State) SetRewardCalcInfo(rc *RewardCalcInfo) error
- func (s *State) SetRewardFund(r *RewardFund) error
- func (s *State) SetSlashingRate(revision int, penaltyType icmodule.PenaltyType, rate icmodule.Rate) error
- func (s *State) SetSubPRepCount(value int64) error
- func (s *State) SetTermPeriod(value int64) error
- func (s *State) SetTermSnapshot(term *TermSnapshot) error
- func (s *State) SetTotalBond(value *big.Int) error
- func (s *State) SetTotalDelegation(value *big.Int) error
- func (s *State) SetTotalStake(value *big.Int) error
- func (s *State) SetUnbondingMax(value int64) error
- func (s *State) SetUnbondingPeriodMultiplier(value int64) error
- func (s *State) SetUnstakeSlotMax(v int64) error
- func (s *State) SetValidationPenaltyCondition(value int) error
- func (s *State) SetValidatorsSnapshot(vss *ValidatorsSnapshot) error
- type Status
- type TermSnapshot
- func (term *TermSnapshot) Equal(o icobject.Impl) bool
- func (term *TermSnapshot) Format(f fmt.State, c rune)
- func (term *TermSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (term *TermSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (term *TermSnapshot) String() string
- func (term *TermSnapshot) ToJSON(sc icmodule.StateContext, state *State) map[string]interface{}
- type TermState
- func (term *TermState) Format(f fmt.State, c rune)
- func (term *TermState) GetSnapshot() *TermSnapshot
- func (term *TermState) SetIrep(irep *big.Int)
- func (term *TermState) SetRrep(rrep *big.Int)
- func (term *TermState) String() string
- func (term *TermState) ToJSON(sc icmodule.StateContext, state *State) map[string]interface{}
- type TimerCache
- type TimerIterator
- type TimerJobInfo
- type TimerSnapshot
- func (t TimerSnapshot) Contains(addr module.Address) bool
- func (t *TimerSnapshot) Equal(object icobject.Impl) bool
- func (t *TimerSnapshot) Format(f fmt.State, c rune)
- func (t TimerSnapshot) IndexOf(addr module.Address) int
- func (t TimerSnapshot) IsEmpty() bool
- func (t TimerSnapshot) Iterator() TimerIterator
- func (t *TimerSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (t *TimerSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (t *TimerSnapshot) Version() int
- type TimerState
- func (t *TimerState) Add(address module.Address)
- func (t TimerState) Contains(addr module.Address) bool
- func (t *TimerState) Delete(address module.Address)
- func (t *TimerState) Format(f fmt.State, c rune)
- func (t *TimerState) GetSnapshot() *TimerSnapshot
- func (t TimerState) IndexOf(addr module.Address) int
- func (t TimerState) IsEmpty() bool
- func (t TimerState) Iterator() TimerIterator
- func (t *TimerState) Reset(ts *TimerSnapshot) *TimerState
- type Unbond
- func (u *Unbond) Address() *common.Address
- func (u *Unbond) Clone() *Unbond
- func (u *Unbond) Equal(o *Unbond) bool
- func (u *Unbond) Expire() int64
- func (u *Unbond) Format(f fmt.State, c rune)
- func (u *Unbond) RLPDecodeSelf(decoder codec.Decoder) error
- func (u *Unbond) RLPEncodeSelf(encoder codec.Encoder) error
- func (u *Unbond) SetExpire(e int64)
- func (u *Unbond) SetValue(v *big.Int)
- func (u *Unbond) Slash(rate icmodule.Rate) *big.Int
- func (u *Unbond) ToJSON() map[string]interface{}
- func (u *Unbond) Value() *big.Int
- type Unbonds
- func (ul *Unbonds) Add(address module.Address, value *big.Int, expireHeight int64)
- func (ul Unbonds) Clone() Unbonds
- func (ul Unbonds) Contains(addr module.Address) bool
- func (ul *Unbonds) Delete(i int) error
- func (ul *Unbonds) DeleteByAddress(address module.Address) error
- func (ul Unbonds) Equal(ul2 Unbonds) bool
- func (ul Unbonds) ExpireRefCount() map[int64]int
- func (ul Unbonds) GetUnbondAmount() *big.Int
- func (ul Unbonds) GetUnbondByAddress(address module.Address) (*Unbond, int)
- func (ul Unbonds) IsEmpty() bool
- func (ul Unbonds) MapByAddr() map[string]*Unbond
- func (ul *Unbonds) Slash(address module.Address, rate icmodule.Rate) (Unbonds, *big.Int, int64)
- func (ul Unbonds) ToJSON(_ module.JSONVersion) []interface{}
- type Unstake
- func (u *Unstake) Clone() *Unstake
- func (u *Unstake) Equal(u2 *Unstake) bool
- func (u Unstake) Format(f fmt.State, c rune)
- func (u *Unstake) GetExpire() int64
- func (u *Unstake) GetValue() *big.Int
- func (u *Unstake) RLPDecodeSelf(decoder codec.Decoder) error
- func (u *Unstake) RLPEncodeSelf(encoder codec.Encoder) error
- func (u Unstake) String() string
- func (u Unstake) ToJSON(_ module.JSONVersion, blockHeight int64) interface{}
- type Unstakes
- type ValidatorsSnapshot
- func (vss *ValidatorsSnapshot) Equal(object icobject.Impl) bool
- func (vd *ValidatorsSnapshot) Format(f fmt.State, verb rune)
- func (vd *ValidatorsSnapshot) Get(i int) module.Address
- func (vd *ValidatorsSnapshot) IndexOf(node module.Address) int
- func (vss *ValidatorsSnapshot) IsUpdated(blockHeight int64) bool
- func (vd *ValidatorsSnapshot) Len() int
- func (vd *ValidatorsSnapshot) NewValidatorSet() []module.Validator
- func (vd *ValidatorsSnapshot) NextPRepSnapshotIndex() int
- func (vss *ValidatorsSnapshot) RLPDecodeFields(decoder codec.Decoder) error
- func (vss *ValidatorsSnapshot) RLPEncodeFields(encoder codec.Encoder) error
- func (vd *ValidatorsSnapshot) String() string
- func (vss *ValidatorsSnapshot) Version() int
- type ValidatorsState
- func (vd *ValidatorsState) Format(f fmt.State, verb rune)
- func (vd *ValidatorsState) Get(i int) module.Address
- func (vs *ValidatorsState) GetSnapshot() *ValidatorsSnapshot
- func (vd *ValidatorsState) IndexOf(node module.Address) int
- func (vs *ValidatorsState) IsDirty() bool
- func (vd *ValidatorsState) Len() int
- func (vd *ValidatorsState) NewValidatorSet() []module.Validator
- func (vd *ValidatorsState) NextPRepSnapshotIndex() int
- func (vs *ValidatorsState) Reset(vss *ValidatorsSnapshot)
- func (vs *ValidatorsState) Set(blockHeight int64, i, nextPssIdx int, node module.Address)
- func (vd *ValidatorsState) String() string
- type VoteState
- type Voting
- type VotingIterator
Constants ¶
const ( JFlagInJail = 1 << iota JFlagUnjailing JFlagAccumulatedValidationFailure JFlagDoubleSign JFlagMax )
const ( VarIRep = "irep" VarRRep = "rrep" VarMainPRepCount = "main_prep_count" VarSubPRepCount = "sub_prep_count" VarExtraMainPRepCount = "extra_main_prep_count" VarTotalStake = "total_stake" VarIISSVersion = "iiss_version" VarTermPeriod = "term_period" VarBondRequirement = "bond_requirement" VarUnbondingPeriodMultiplier = "unbonding_period_multiplier" VarLockMinMultiplier = "lockMinMultiplier" VarLockMaxMultiplier = "lockMaxMultiplier" VarRewardFund = "reward_fund" VarRewardFund2 = "reward_fund2" VarUnbondingMax = "unbonding_max" VarValidationPenaltyCondition = "validation_penalty_condition" VarConsistentValidationPenaltyCondition = "consistent_validation_penalty_condition" VarConsistentValidationPenaltyMask = "consistent_validation_penalty_mask" VarConsistentValidationPenaltySlashRate = "consistent_validation_penalty_slashRatio" VarDelegationSlotMax = "delegation_slot_max" DictNetworkScores = "network_scores" VarNonVotePenaltySlashRate = "nonvote_penalty_slashRatio" DictSlashingRate = "slashing_rate" VarMinBond = "minimum_bond" )
const ( IISSVersion2 int = iota + 2 IISSVersion3 IISSVersion4 )
const ( CPSKey = "cps" RelayKey = "relay" GovernanceKey = "governance" )
const ( TypeAccount int = iota TypePRepBase TypePRepStatus TypeTimer TypeIssue TypeTerm TypeRewardCalcInfo TypeValidators TypeBlockVoters TypeIllegalDelegation )
const ( PRepBaseVersion1 = iota + 1 PRepBaseVersion2 )
const ( RFVersion1 = iota RFVersion2 RFVersionReserved KeyIglobal = "Iglobal" )
Variables ¶
var ( IssueKey = containerdb.ToKey(containerdb.HashBuilder, "issue_icx").Build() RewardCalcInfoKey = containerdb.ToKey(containerdb.HashBuilder, "reward_calc_info").Build() ValidatorsKey = containerdb.ToKey( containerdb.HashBuilder, scoredb.VarDBPrefix, "validators", ) UnstakeSlotMaxKey = containerdb.ToKey( containerdb.HashBuilder, scoredb.VarDBPrefix, "unstake_slot_max", ) TotalDelegationKey = containerdb.ToKey( containerdb.HashBuilder, scoredb.VarDBPrefix, "total_delegation", ) TotalBondKey = containerdb.ToKey( containerdb.HashBuilder, scoredb.VarDBPrefix, "total_bond", ) LastBlockVotersKey = containerdb.ToKey( containerdb.HashBuilder, scoredb.VarDBPrefix, "lastBlockVoters", ) )
var AccountDictPrefix = containerdb.ToKey( containerdb.HashBuilder, scoredb.DictDBPrefix, "account_db", )
var AdditionalNetworkScoreKeys = []string{CPSKey, RelayKey}
var IllegalDelegationPrefix = containerdb.ToKey( containerdb.HashBuilder, scoredb.DictDBPrefix, "illegal_delegation", )
Functions ¶
func CalcUnstakeLockPeriod ¶ added in v0.9.10
func NewRewardFund2Allocation ¶ added in v1.4.0
func NewStringPtr ¶ added in v0.9.8
func NewVotingIterator ¶
func NewVotingIterator(votings []Voting) *votingIterator
func ScheduleTimerJob ¶
func ScheduleTimerJob(t *TimerState, info TimerJobInfo, address module.Address)
func SortByPower ¶ added in v1.4.0
func SortByPower(sc icmodule.StateContext, preps []*PRep)
SortByPower sorts given preps to classify active PReps into 3 grades; main, sub, candidate
func ValidatePRepCountConfig ¶ added in v1.4.0
Types ¶
type AccountCache ¶
type AccountCache struct {
// contains filtered or unexported fields
}
func (*AccountCache) Clear ¶
func (c *AccountCache) Clear()
func (*AccountCache) Flush ¶
func (c *AccountCache) Flush()
func (*AccountCache) Get ¶
func (c *AccountCache) Get(owner module.Address, createIfNotExist bool) *AccountState
func (*AccountCache) GetSnapshot ¶ added in v0.9.7
func (c *AccountCache) GetSnapshot(owner module.Address) *AccountSnapshot
func (*AccountCache) Reset ¶
func (c *AccountCache) Reset()
type AccountSnapshot ¶ added in v0.9.7
type AccountSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func GetEmptyAccountSnapshot ¶ added in v0.9.7
func GetEmptyAccountSnapshot() *AccountSnapshot
func ToAccount ¶
func ToAccount(object trie.Object) *AccountSnapshot
func (*AccountSnapshot) Delegating ¶ added in v0.9.7
func (*AccountSnapshot) Delegations ¶ added in v0.9.7
func (a *AccountSnapshot) Delegations() Delegations
func (*AccountSnapshot) Equal ¶ added in v0.9.7
func (a *AccountSnapshot) Equal(object icobject.Impl) bool
func (*AccountSnapshot) GetBondInJSON ¶ added in v1.1.1
func (a *AccountSnapshot) GetBondInJSON() map[string]interface{}
func (AccountSnapshot) GetDelegationInJSON ¶ added in v0.9.7
func (a AccountSnapshot) GetDelegationInJSON() map[string]interface{}
func (AccountSnapshot) GetStakeInJSON ¶ added in v0.9.7
func (AccountSnapshot) GetTotalStake ¶ added in v0.9.7
func (*AccountSnapshot) GetUnbondsInJSON ¶ added in v0.9.7
func (a *AccountSnapshot) GetUnbondsInJSON() []interface{}
func (AccountSnapshot) GetUnstakeAmount ¶ added in v0.9.7
func (*AccountSnapshot) GetVotingPower ¶ added in v0.9.7
func (*AccountSnapshot) RLPDecodeFields ¶ added in v0.9.7
func (a *AccountSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*AccountSnapshot) RLPEncodeFields ¶ added in v0.9.7
func (a *AccountSnapshot) RLPEncodeFields(encoder codec.Encoder) error
func (*AccountSnapshot) UsingStake ¶ added in v0.9.7
func (*AccountSnapshot) Version ¶ added in v0.9.7
func (a *AccountSnapshot) Version() int
type AccountState ¶ added in v0.9.7
type AccountState struct {
// contains filtered or unexported fields
}
func (*AccountState) Clear ¶ added in v0.9.7
func (a *AccountState) Clear()
func (*AccountState) DecreaseUnstake ¶ added in v0.9.7
func (a *AccountState) DecreaseUnstake(stakeInc *big.Int, expireHeight int64, revision int) ([]TimerJobInfo, error)
func (*AccountState) Delegating ¶ added in v0.9.7
func (*AccountState) Delegations ¶ added in v0.9.7
func (a *AccountState) Delegations() Delegations
func (*AccountState) GetBondInJSON ¶ added in v1.1.1
func (a *AccountState) GetBondInJSON() map[string]interface{}
func (AccountState) GetDelegationInJSON ¶ added in v0.9.7
func (a AccountState) GetDelegationInJSON() map[string]interface{}
func (*AccountState) GetSnapshot ¶ added in v0.9.7
func (a *AccountState) GetSnapshot() *AccountSnapshot
func (AccountState) GetStakeInJSON ¶ added in v0.9.7
func (AccountState) GetTotalStake ¶ added in v0.9.7
func (*AccountState) GetUnbondsInJSON ¶ added in v0.9.7
func (a *AccountState) GetUnbondsInJSON() []interface{}
func (AccountState) GetUnstakeAmount ¶ added in v0.9.7
func (*AccountState) GetVotingPower ¶ added in v0.9.7
func (*AccountState) IncreaseUnstake ¶ added in v0.9.7
func (a *AccountState) IncreaseUnstake(stakeInc *big.Int, expireHeight int64, slotMax, revision int) ([]TimerJobInfo, error)
func (*AccountState) RemoveUnbond ¶ added in v0.9.7
func (a *AccountState) RemoveUnbond(height int64) error
func (*AccountState) RemoveUnstake ¶ added in v0.9.7
func (a *AccountState) RemoveUnstake(height int64) (ra *big.Int, err error)
func (*AccountState) Reset ¶ added in v0.9.7
func (a *AccountState) Reset(s *AccountSnapshot)
func (*AccountState) SetBonds ¶ added in v0.9.7
func (a *AccountState) SetBonds(bonds Bonds)
func (*AccountState) SetDelegation ¶ added in v0.9.7
func (a *AccountState) SetDelegation(ds Delegations)
func (*AccountState) SlashStake ¶ added in v0.9.7
func (a *AccountState) SlashStake(amount *big.Int) error
func (*AccountState) SlashUnbond ¶ added in v0.9.7
func (*AccountState) UpdateUnbonds ¶ added in v0.9.7
func (a *AccountState) UpdateUnbonds(bondDelta map[string]*big.Int, expireHeight int64) ([]TimerJobInfo, error)
func (*AccountState) UsingStake ¶ added in v0.9.7
type AllPRepCache ¶ added in v0.9.8
type AllPRepCache struct {
// contains filtered or unexported fields
}
func NewAllPRepCache ¶ added in v0.9.8
func NewAllPRepCache(store containerdb.ObjectStoreState) *AllPRepCache
func (*AllPRepCache) Add ¶ added in v0.9.8
func (c *AllPRepCache) Add(owner module.Address) error
Add adds a new active PRep to State Duplicated address check MUST BE done before adding
func (*AllPRepCache) Size ¶ added in v0.9.8
func (c *AllPRepCache) Size() int
type BlockVotersSnapshot ¶ added in v0.9.8
type BlockVotersSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func NewBlockVotersSnapshot ¶ added in v0.9.8
func NewBlockVotersSnapshot(voters []module.Address) *BlockVotersSnapshot
func NewBlockVotersWithTag ¶ added in v0.9.8
func NewBlockVotersWithTag(_ icobject.Tag) *BlockVotersSnapshot
func ToBlockVoters ¶ added in v0.9.8
func ToBlockVoters(object trie.Object) *BlockVotersSnapshot
func (*BlockVotersSnapshot) Equal ¶ added in v0.9.8
func (bvs *BlockVotersSnapshot) Equal(object icobject.Impl) bool
func (*BlockVotersSnapshot) Format ¶ added in v0.9.8
func (bvs *BlockVotersSnapshot) Format(f fmt.State, verb rune)
func (*BlockVotersSnapshot) RLPDecodeFields ¶ added in v0.9.8
func (bvs *BlockVotersSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*BlockVotersSnapshot) RLPEncodeFields ¶ added in v0.9.8
func (bvs *BlockVotersSnapshot) RLPEncodeFields(encoder codec.Encoder) error
func (*BlockVotersSnapshot) Version ¶ added in v0.9.8
func (bvs *BlockVotersSnapshot) Version() int
type BonderList ¶
func NewBonderList ¶
func NewBonderList(param []interface{}) (BonderList, error)
func (BonderList) Clone ¶
func (bl BonderList) Clone() BonderList
func (BonderList) Equal ¶
func (bl BonderList) Equal(bl2 BonderList) bool
func (BonderList) IsEmpty ¶ added in v0.9.8
func (bl BonderList) IsEmpty() bool
func (BonderList) ToJSON ¶
func (bl BonderList) ToJSON() []interface{}
type Bonds ¶
type Bonds []*Bond
func (*Bonds) GetBondAmount ¶
func (*Bonds) Iterator ¶
func (bs *Bonds) Iterator() VotingIterator
func (*Bonds) ToJSON ¶
func (bs *Bonds) ToJSON(v module.JSONVersion) []interface{}
type CommissionInfo ¶ added in v1.4.0
type CommissionInfo struct {
// contains filtered or unexported fields
}
func NewCommissionInfo ¶ added in v1.4.0
func NewCommissionInfo(rate, maxRate, maxChangeRate icmodule.Rate) (*CommissionInfo, error)
func NewEmptyCommissionInfo ¶ added in v1.4.0
func NewEmptyCommissionInfo() *CommissionInfo
func (*CommissionInfo) Clone ¶ added in v1.4.0
func (ci *CommissionInfo) Clone() *CommissionInfo
func (*CommissionInfo) Equal ¶ added in v1.4.0
func (ci *CommissionInfo) Equal(other *CommissionInfo) bool
func (*CommissionInfo) MaxChangeRate ¶ added in v1.4.0
func (ci *CommissionInfo) MaxChangeRate() icmodule.Rate
func (*CommissionInfo) MaxRate ¶ added in v1.4.0
func (ci *CommissionInfo) MaxRate() icmodule.Rate
func (*CommissionInfo) RLPDecodeSelf ¶ added in v1.4.0
func (ci *CommissionInfo) RLPDecodeSelf(d codec.Decoder) error
func (*CommissionInfo) RLPEncodeSelf ¶ added in v1.4.0
func (ci *CommissionInfo) RLPEncodeSelf(e codec.Encoder) error
func (*CommissionInfo) Rate ¶ added in v1.4.0
func (ci *CommissionInfo) Rate() icmodule.Rate
func (*CommissionInfo) SetRate ¶ added in v1.4.0
func (ci *CommissionInfo) SetRate(rate icmodule.Rate) error
func (*CommissionInfo) String ¶ added in v1.4.0
func (ci *CommissionInfo) String() string
func (*CommissionInfo) ToJSON ¶ added in v1.4.0
func (ci *CommissionInfo) ToJSON(jso map[string]interface{}) map[string]interface{}
type Delegation ¶
type Delegation struct { Address *common.Address `json:"address"` Value *common.HexInt `json:"value"` }
func NewDelegation ¶
func NewDelegation(addr *common.Address, v *big.Int) *Delegation
func (*Delegation) Amount ¶
func (dg *Delegation) Amount() *big.Int
func (*Delegation) Clone ¶
func (dg *Delegation) Clone() *Delegation
func (*Delegation) Equal ¶
func (dg *Delegation) Equal(d2 *Delegation) bool
func (*Delegation) String ¶ added in v0.9.7
func (dg *Delegation) String() string
func (*Delegation) To ¶
func (dg *Delegation) To() module.Address
func (*Delegation) ToJSON ¶
func (dg *Delegation) ToJSON() map[string]interface{}
type Delegations ¶
type Delegations []*Delegation
func NewDelegations ¶
func NewDelegations(param []interface{}, max int) (Delegations, error)
func (Delegations) Clone ¶
func (ds Delegations) Clone() Delegations
func (*Delegations) Delete ¶
func (ds *Delegations) Delete(i int) error
func (Delegations) Delta ¶ added in v0.9.10
func (ds Delegations) Delta(ds2 Delegations) map[string]*big.Int
func (Delegations) Equal ¶
func (ds Delegations) Equal(ds2 Delegations) bool
func (Delegations) GetDelegationAmount ¶
func (ds Delegations) GetDelegationAmount() *big.Int
func (Delegations) Has ¶
func (ds Delegations) Has() bool
func (*Delegations) Iterator ¶
func (ds *Delegations) Iterator() VotingIterator
func (Delegations) ToJSON ¶
func (ds Delegations) ToJSON(_ module.JSONVersion) []interface{}
func (*Delegations) ToMap ¶ added in v0.9.7
func (ds *Delegations) ToMap() map[string]*Delegation
type IllegalDelegation ¶ added in v0.9.10
type IllegalDelegation struct { icobject.NoDatabase // contains filtered or unexported fields }
func NewIllegalDelegation ¶ added in v0.9.10
func NewIllegalDelegation(addr module.Address, ds Delegations) *IllegalDelegation
func NewIllegalDelegationWithTag ¶ added in v0.9.10
func NewIllegalDelegationWithTag(_ icobject.Tag) *IllegalDelegation
func ToIllegalDelegation ¶ added in v0.9.10
func ToIllegalDelegation(object trie.Object) *IllegalDelegation
func (*IllegalDelegation) Address ¶ added in v0.9.10
func (d *IllegalDelegation) Address() module.Address
func (*IllegalDelegation) Clone ¶ added in v0.9.10
func (d *IllegalDelegation) Clone() *IllegalDelegation
func (*IllegalDelegation) Delegations ¶ added in v0.9.10
func (d *IllegalDelegation) Delegations() Delegations
func (*IllegalDelegation) Equal ¶ added in v0.9.10
func (d *IllegalDelegation) Equal(o icobject.Impl) bool
func (*IllegalDelegation) Format ¶ added in v0.9.10
func (d *IllegalDelegation) Format(f fmt.State, c rune)
func (*IllegalDelegation) RLPDecodeFields ¶ added in v0.9.10
func (d *IllegalDelegation) RLPDecodeFields(decoder codec.Decoder) error
func (*IllegalDelegation) RLPEncodeFields ¶ added in v0.9.10
func (d *IllegalDelegation) RLPEncodeFields(encoder codec.Encoder) error
func (*IllegalDelegation) SetDelegations ¶ added in v0.9.10
func (d *IllegalDelegation) SetDelegations(ds Delegations)
func (*IllegalDelegation) Version ¶ added in v0.9.10
func (d *IllegalDelegation) Version() int
type Issue ¶
type Issue struct { icobject.NoDatabase // contains filtered or unexported fields }
func (*Issue) GetOverIssuedICX ¶ added in v0.9.8
func (*Issue) OverIssuedIScore ¶ added in v0.9.8
func (*Issue) PrevBlockFee ¶
func (*Issue) PrevTotalReward ¶ added in v0.9.8
func (*Issue) ResetTotalReward ¶ added in v0.9.8
func (i *Issue) ResetTotalReward()
func (*Issue) SetOverIssuedIScore ¶ added in v0.9.8
func (*Issue) SetPrevBlockFee ¶ added in v0.9.7
func (*Issue) SetPrevTotalReward ¶ added in v0.9.8
func (*Issue) SetTotalReward ¶ added in v0.9.8
func (*Issue) TotalReward ¶ added in v0.9.8
type JailInfo ¶ added in v1.4.0
type JailInfo struct {
// contains filtered or unexported fields
}
func (*JailInfo) IsElectable ¶ added in v1.4.0
func (*JailInfo) IsUnjailable ¶ added in v1.4.0
func (*JailInfo) IsUnjailing ¶ added in v1.4.0
func (*JailInfo) MinDoubleSignHeight ¶ added in v1.4.0
func (*JailInfo) OnMainPRepIn ¶ added in v1.4.0
func (ji *JailInfo) OnMainPRepIn(sc icmodule.StateContext) error
func (*JailInfo) OnPenaltyImposed ¶ added in v1.4.0
func (ji *JailInfo) OnPenaltyImposed(sc icmodule.StateContext, pt icmodule.PenaltyType) error
func (*JailInfo) OnUnjailRequested ¶ added in v1.4.0
func (ji *JailInfo) OnUnjailRequested(sc icmodule.StateContext) error
func (*JailInfo) RLPDecodeSelf ¶ added in v1.4.0
func (*JailInfo) RLPEncodeSelf ¶ added in v1.4.0
func (*JailInfo) ToJSON ¶ added in v1.4.0
func (ji *JailInfo) ToJSON(sc icmodule.StateContext, jso map[string]interface{}) map[string]interface{}
func (*JailInfo) UnjailRequestHeight ¶ added in v1.4.0
type NodeOwnerCache ¶
type NodeOwnerCache struct {
// contains filtered or unexported fields
}
TODO: Remove old nodes which is not used anymore
func (*NodeOwnerCache) Add ¶
func (c *NodeOwnerCache) Add(node, owner module.Address) error
Add adds alias, node-to-owner. It doesn't record alias to self. If there is same alias, it ignores the request.
func (*NodeOwnerCache) Clear ¶
func (c *NodeOwnerCache) Clear()
func (*NodeOwnerCache) Contains ¶ added in v0.9.7
func (c *NodeOwnerCache) Contains(node module.Address) bool
func (*NodeOwnerCache) Flush ¶
func (c *NodeOwnerCache) Flush()
func (*NodeOwnerCache) Reset ¶
func (c *NodeOwnerCache) Reset()
type OwnerToNodeMappable ¶ added in v0.9.7
type PRep ¶ added in v0.9.7
type PRep struct { *PRepStatusState // contains filtered or unexported fields }
func (PRep) EffectiveDelegated ¶ added in v0.9.10
func (PRep) GetBondedDelegation ¶ added in v0.9.7
GetBondedDelegation return amount of bonded delegation Bonded delegation formula totalVoted = bond + delegation bondRatio = bond / totalVoted * 100 bondedDelegation = totalVoted * (bondRatio / bondRequirement)
= bond * 100 / bondRequirement
if bondedDelegation > totalVoted
bondedDelegation = totalVoted
func (PRep) GetDSAMask ¶ added in v1.3.0
func (ps PRep) GetDSAMask() int64
func (PRep) GetPower ¶ added in v1.1.0
GetPower returns the power score of a PRep. Power is the same as delegated of a given PRep before rev 14 and will be bondedDelegation since rev 14. But the calculation formula for power can be changed in the future.
func (PRep) GetVFail ¶ added in v0.9.7
GetVFail returns the calculated number of validation failures
func (PRep) GetVFailCont ¶ added in v0.9.7
GetVFailCont returns the number of consecutive validation failures
func (PRep) GetVPenaltyCount ¶ added in v0.9.7
func (ps PRep) GetVPenaltyCount() int
func (PRep) IsAlreadyPenalized ¶ added in v0.9.7
func (ps PRep) IsAlreadyPenalized() bool
IsAlreadyPenalized returns true if this PRep got penalized during this term
func (PRep) IsDoubleSignReportable ¶ added in v1.4.0
func (ps PRep) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
func (*PRep) IsElectable ¶ added in v1.4.0
func (p *PRep) IsElectable(sc icmodule.StateContext) bool
func (PRep) IsJailInfoElectable ¶ added in v1.4.0
func (ps PRep) IsJailInfoElectable() bool
func (PRep) IsUnjailable ¶ added in v1.4.0
func (ps PRep) IsUnjailable() bool
func (PRep) IsUnjailing ¶ added in v1.4.0
func (ps PRep) IsUnjailing() bool
func (PRep) LastHeight ¶ added in v0.9.7
func (ps PRep) LastHeight() int64
func (PRep) MinDoubleSignHeight ¶ added in v1.4.0
func (ps PRep) MinDoubleSignHeight() int64
func (*PRep) NodeAddress ¶ added in v1.3.0
func (*PRep) ToJSON ¶ added in v0.9.7
func (p *PRep) ToJSON(sc icmodule.StateContext) map[string]interface{}
func (PRep) UnjailRequestHeight ¶ added in v1.4.0
func (ps PRep) UnjailRequestHeight() int64
type PRepBaseCache ¶
type PRepBaseCache struct {
// contains filtered or unexported fields
}
func (*PRepBaseCache) Clear ¶
func (c *PRepBaseCache) Clear()
func (*PRepBaseCache) Flush ¶
func (c *PRepBaseCache) Flush()
func (*PRepBaseCache) Get ¶
func (c *PRepBaseCache) Get(owner module.Address, createIfNotExist bool) *PRepBaseState
func (*PRepBaseCache) Reset ¶
func (c *PRepBaseCache) Reset()
type PRepBaseData ¶ added in v0.9.8
type PRepBaseData struct {
// contains filtered or unexported fields
}
func (*PRepBaseData) BonderList ¶ added in v0.9.8
func (p *PRepBaseData) BonderList() BonderList
func (*PRepBaseData) CommissionRate ¶ added in v1.4.0
func (p *PRepBaseData) CommissionRate() icmodule.Rate
func (*PRepBaseData) GetBonderListInJSON ¶ added in v0.9.8
func (p *PRepBaseData) GetBonderListInJSON() []interface{}
func (*PRepBaseData) GetNode ¶ added in v0.9.8
func (p *PRepBaseData) GetNode(owner module.Address) module.Address
func (*PRepBaseData) IRep ¶ added in v0.9.8
func (p *PRepBaseData) IRep() *big.Int
func (*PRepBaseData) IRepHeight ¶ added in v0.9.8
func (p *PRepBaseData) IRepHeight() int64
func (*PRepBaseData) IsEmpty ¶ added in v0.9.8
func (p *PRepBaseData) IsEmpty() bool
func (*PRepBaseData) MaxCommissionChangeRate ¶ added in v1.4.0
func (p *PRepBaseData) MaxCommissionChangeRate() icmodule.Rate
func (*PRepBaseData) MaxCommissionRate ¶ added in v1.4.0
func (p *PRepBaseData) MaxCommissionRate() icmodule.Rate
func (*PRepBaseData) Name ¶ added in v0.9.8
func (p *PRepBaseData) Name() string
func (*PRepBaseData) P2PEndpoint ¶ added in v0.9.8
func (p *PRepBaseData) P2PEndpoint() string
func (*PRepBaseData) String ¶ added in v0.9.8
func (p *PRepBaseData) String() string
func (*PRepBaseData) ToJSON ¶ added in v0.9.8
func (p *PRepBaseData) ToJSON(owner module.Address) map[string]interface{}
func (*PRepBaseData) Version ¶ added in v1.4.0
func (p *PRepBaseData) Version() int
type PRepBaseSnapshot ¶ added in v0.9.8
type PRepBaseSnapshot struct { icobject.NoDatabase PRepBaseData }
func NewPRepBaseSnapshot ¶ added in v1.4.0
func NewPRepBaseSnapshot(version int) *PRepBaseSnapshot
func ToPRepBase ¶
func ToPRepBase(object trie.Object) *PRepBaseSnapshot
func (*PRepBaseSnapshot) Equal ¶ added in v0.9.8
func (p *PRepBaseSnapshot) Equal(object icobject.Impl) bool
func (*PRepBaseSnapshot) RLPDecodeFields ¶ added in v0.9.8
func (p *PRepBaseSnapshot) RLPDecodeFields(d codec.Decoder) error
func (*PRepBaseSnapshot) RLPEncodeFields ¶ added in v0.9.8
func (p *PRepBaseSnapshot) RLPEncodeFields(e codec.Encoder) error
type PRepBaseState ¶ added in v0.9.8
type PRepBaseState struct { PRepBaseData // contains filtered or unexported fields }
func NewPRepBaseState ¶ added in v0.9.8
func NewPRepBaseState() *PRepBaseState
func (*PRepBaseState) Clear ¶ added in v0.9.8
func (p *PRepBaseState) Clear()
func (*PRepBaseState) CommissionInfoExists ¶ added in v1.4.0
func (p *PRepBaseState) CommissionInfoExists() bool
func (*PRepBaseState) GetSnapshot ¶ added in v0.9.8
func (p *PRepBaseState) GetSnapshot() *PRepBaseSnapshot
func (*PRepBaseState) InitCommissionInfo ¶ added in v1.4.0
func (p *PRepBaseState) InitCommissionInfo(ci *CommissionInfo) error
func (*PRepBaseState) Reset ¶ added in v0.9.8
func (p *PRepBaseState) Reset(snapshot *PRepBaseSnapshot) *PRepBaseState
func (*PRepBaseState) SetBonderList ¶ added in v0.9.8
func (p *PRepBaseState) SetBonderList(bonderList BonderList)
func (*PRepBaseState) SetCommissionRate ¶ added in v1.4.0
func (p *PRepBaseState) SetCommissionRate(rate icmodule.Rate) error
func (*PRepBaseState) SetIrep ¶ added in v0.9.8
func (p *PRepBaseState) SetIrep(irep *big.Int, irepHeight int64)
func (*PRepBaseState) UpdateInfo ¶ added in v0.9.8
func (p *PRepBaseState) UpdateInfo(info *PRepInfo)
type PRepCountConfig ¶ added in v1.4.0
type PRepCountConfig interface { MainPReps() int ExtraMainPReps() int SubPReps() int ElectedPReps() int }
func NewPRepCountConfig ¶ added in v1.4.0
func NewPRepCountConfig(mainPReps, subPReps, extraMainPReps int) PRepCountConfig
type PRepCountType ¶ added in v1.4.0
type PRepCountType int
const ( PRepCountMain PRepCountType = iota PRepCountSub PRepCountExtra )
func StringToPRepCountType ¶ added in v1.4.0
func StringToPRepCountType(name string) (PRepCountType, bool)
func (PRepCountType) String ¶ added in v1.4.0
func (pct PRepCountType) String() string
type PRepInfo ¶ added in v0.9.8
type PRepInfo struct { City *string Country *string Details *string Email *string Name *string P2PEndpoint *string WebSite *string Node module.Address }
type PRepSet ¶ added in v0.9.8
type PRepSet interface { OnTermEnd(sc icmodule.StateContext, limit int) error GetPRepSize(grade Grade) int Size() int GetByIndex(i int) *PRep ToPRepSnapshots(br icmodule.Rate) PRepSnapshots }
func NewPRepSet ¶ added in v1.3.0
func NewPRepSet(sc icmodule.StateContext, preps []*PRep, cfg PRepCountConfig) PRepSet
type PRepSnapshot ¶
type PRepSnapshot struct {
// contains filtered or unexported fields
}
func NewPRepSnapshot ¶ added in v0.9.7
func NewPRepSnapshot(owner module.Address, power *big.Int) *PRepSnapshot
func (*PRepSnapshot) Equal ¶
func (pss *PRepSnapshot) Equal(other *PRepSnapshot) bool
func (*PRepSnapshot) Owner ¶
func (pss *PRepSnapshot) Owner() module.Address
func (*PRepSnapshot) Power ¶ added in v1.1.0
func (pss *PRepSnapshot) Power() *big.Int
func (*PRepSnapshot) RLPDecodeSelf ¶
func (pss *PRepSnapshot) RLPDecodeSelf(d codec.Decoder) error
func (*PRepSnapshot) RLPEncodeSelf ¶
func (pss *PRepSnapshot) RLPEncodeSelf(e codec.Encoder) error
func (*PRepSnapshot) String ¶ added in v1.2.1
func (pss *PRepSnapshot) String() string
func (*PRepSnapshot) ToJSON ¶
func (pss *PRepSnapshot) ToJSON() map[string]interface{}
type PRepSnapshots ¶
type PRepSnapshots []*PRepSnapshot
func (PRepSnapshots) Clone ¶
func (p PRepSnapshots) Clone() PRepSnapshots
func (PRepSnapshots) Equal ¶
func (p PRepSnapshots) Equal(other PRepSnapshots) bool
func (PRepSnapshots) String ¶ added in v1.2.1
func (p PRepSnapshots) String() string
type PRepStatusCache ¶
type PRepStatusCache struct {
// contains filtered or unexported fields
}
func (*PRepStatusCache) Clear ¶
func (c *PRepStatusCache) Clear()
func (*PRepStatusCache) Flush ¶
func (c *PRepStatusCache) Flush()
func (*PRepStatusCache) Get ¶
func (c *PRepStatusCache) Get(owner module.Address, createIfNotExist bool) *PRepStatusState
func (*PRepStatusCache) Reset ¶
func (c *PRepStatusCache) Reset()
type PRepStatusSnapshot ¶ added in v0.9.7
type PRepStatusSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func ToPRepStatus ¶
func ToPRepStatus(object trie.Object) *PRepStatusSnapshot
func (*PRepStatusSnapshot) EffectiveDelegated ¶ added in v0.9.10
func (*PRepStatusSnapshot) Equal ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) Equal(o icobject.Impl) bool
func (*PRepStatusSnapshot) GetBondedDelegation ¶ added in v0.9.7
GetBondedDelegation return amount of bonded delegation Bonded delegation formula totalVoted = bond + delegation bondRatio = bond / totalVoted * 100 bondedDelegation = totalVoted * (bondRatio / bondRequirement)
= bond * 100 / bondRequirement
if bondedDelegation > totalVoted
bondedDelegation = totalVoted
func (*PRepStatusSnapshot) GetDSAMask ¶ added in v1.3.0
func (ps *PRepStatusSnapshot) GetDSAMask() int64
func (*PRepStatusSnapshot) GetPower ¶ added in v1.1.0
GetPower returns the power score of a PRep. Power is the same as delegated of a given PRep before rev 14 and will be bondedDelegation since rev 14. But the calculation formula for power can be changed in the future.
func (*PRepStatusSnapshot) GetStatsInJSON ¶ added in v0.9.7
func (*PRepStatusSnapshot) GetVFail ¶ added in v0.9.7
GetVFail returns the calculated number of validation failures
func (*PRepStatusSnapshot) GetVFailCont ¶ added in v0.9.7
GetVFailCont returns the number of consecutive validation failures
func (*PRepStatusSnapshot) GetVPenaltyCount ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) GetVPenaltyCount() int
func (*PRepStatusSnapshot) GetVTotal ¶ added in v0.9.7
GetVTotal returns the calculated number of validation
func (*PRepStatusSnapshot) IsAlreadyPenalized ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) IsAlreadyPenalized() bool
IsAlreadyPenalized returns true if this PRep got penalized during this term
func (*PRepStatusSnapshot) IsDoubleSignReportable ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
func (*PRepStatusSnapshot) IsJailInfoElectable ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) IsJailInfoElectable() bool
func (*PRepStatusSnapshot) IsUnjailable ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) IsUnjailable() bool
func (*PRepStatusSnapshot) IsUnjailing ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) IsUnjailing() bool
func (*PRepStatusSnapshot) JailFlags ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) JailFlags() int
func (*PRepStatusSnapshot) LastHeight ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) LastHeight() int64
func (*PRepStatusSnapshot) LastState ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) LastState() VoteState
func (*PRepStatusSnapshot) MinDoubleSignHeight ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) MinDoubleSignHeight() int64
func (*PRepStatusSnapshot) RLPDecodeFields ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*PRepStatusSnapshot) RLPEncodeFields ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) RLPEncodeFields(encoder codec.Encoder) error
func (*PRepStatusSnapshot) ToJSON ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) ToJSON(sc icmodule.StateContext) map[string]interface{}
func (*PRepStatusSnapshot) UnjailRequestHeight ¶ added in v1.4.0
func (ps *PRepStatusSnapshot) UnjailRequestHeight() int64
func (*PRepStatusSnapshot) Version ¶ added in v0.9.7
func (ps *PRepStatusSnapshot) Version() int
type PRepStatusState ¶ added in v0.9.7
type PRepStatusState struct {
// contains filtered or unexported fields
}
func NewPRepStatus ¶
func NewPRepStatus(owner module.Address) *PRepStatusState
func NewPRepStatusWithSnapshot ¶ added in v0.9.7
func NewPRepStatusWithSnapshot(owner module.Address, snapshot *PRepStatusSnapshot) *PRepStatusState
func (*PRepStatusState) Activate ¶ added in v0.9.8
func (ps *PRepStatusState) Activate() error
func (*PRepStatusState) Clear ¶ added in v0.9.7
func (ps *PRepStatusState) Clear()
func (*PRepStatusState) DisableAs ¶ added in v0.9.8
func (ps *PRepStatusState) DisableAs(status Status) (Grade, error)
func (*PRepStatusState) EffectiveDelegated ¶ added in v0.9.10
func (*PRepStatusState) GetBondedDelegation ¶ added in v0.9.7
GetBondedDelegation return amount of bonded delegation Bonded delegation formula totalVoted = bond + delegation bondRatio = bond / totalVoted * 100 bondedDelegation = totalVoted * (bondRatio / bondRequirement)
= bond * 100 / bondRequirement
if bondedDelegation > totalVoted
bondedDelegation = totalVoted
func (*PRepStatusState) GetDSAMask ¶ added in v1.3.0
func (ps *PRepStatusState) GetDSAMask() int64
func (*PRepStatusState) GetPower ¶ added in v1.1.0
GetPower returns the power score of a PRep. Power is the same as delegated of a given PRep before rev 14 and will be bondedDelegation since rev 14. But the calculation formula for power can be changed in the future.
func (*PRepStatusState) GetSnapshot ¶ added in v0.9.7
func (ps *PRepStatusState) GetSnapshot() *PRepStatusSnapshot
func (*PRepStatusState) GetStatsInJSON ¶ added in v0.9.7
func (ps *PRepStatusState) GetStatsInJSON(sc icmodule.StateContext) map[string]interface{}
func (*PRepStatusState) GetVFail ¶ added in v0.9.7
GetVFail returns the calculated number of validation failures
func (*PRepStatusState) GetVFailCont ¶ added in v0.9.7
GetVFailCont returns the number of consecutive validation failures
func (*PRepStatusState) GetVPenaltyCount ¶ added in v0.9.7
func (ps *PRepStatusState) GetVPenaltyCount() int
func (*PRepStatusState) GetVTotal ¶ added in v0.9.7
GetVTotal returns the calculated number of validation
func (*PRepStatusState) IsAlreadyPenalized ¶ added in v0.9.7
func (ps *PRepStatusState) IsAlreadyPenalized() bool
IsAlreadyPenalized returns true if this PRep got penalized during this term
func (*PRepStatusState) IsDoubleSignReportable ¶ added in v1.4.0
func (ps *PRepStatusState) IsDoubleSignReportable(sc icmodule.StateContext, dsBlockHeight int64) bool
func (*PRepStatusState) IsJailInfoElectable ¶ added in v1.4.0
func (ps *PRepStatusState) IsJailInfoElectable() bool
func (*PRepStatusState) IsUnjailable ¶ added in v1.4.0
func (ps *PRepStatusState) IsUnjailable() bool
func (*PRepStatusState) IsUnjailing ¶ added in v1.4.0
func (ps *PRepStatusState) IsUnjailing() bool
func (*PRepStatusState) LastHeight ¶ added in v0.9.7
func (ps *PRepStatusState) LastHeight() int64
func (*PRepStatusState) LastState ¶ added in v0.9.7
func (ps *PRepStatusState) LastState() VoteState
func (*PRepStatusState) MinDoubleSignHeight ¶ added in v1.4.0
func (ps *PRepStatusState) MinDoubleSignHeight() int64
func (*PRepStatusState) OnEvent ¶ added in v1.4.0
func (ps *PRepStatusState) OnEvent( sc icmodule.StateContext, event icmodule.PRepEvent, data ...interface{}) error
func (*PRepStatusState) Owner ¶ added in v1.4.0
func (ps *PRepStatusState) Owner() module.Address
func (*PRepStatusState) Reset ¶ added in v0.9.7
func (ps *PRepStatusState) Reset(ss *PRepStatusSnapshot) *PRepStatusState
func (*PRepStatusState) SetBonded ¶ added in v0.9.7
func (ps *PRepStatusState) SetBonded(v *big.Int)
func (*PRepStatusState) SetDSAMask ¶ added in v1.3.0
func (ps *PRepStatusState) SetDSAMask(m int64)
func (*PRepStatusState) SetDelegated ¶ added in v0.9.7
func (ps *PRepStatusState) SetDelegated(delegated *big.Int)
func (*PRepStatusState) SetEffectiveDelegated ¶ added in v0.9.10
func (ps *PRepStatusState) SetEffectiveDelegated(value *big.Int)
func (*PRepStatusState) SetStatus ¶ added in v0.9.7
func (ps *PRepStatusState) SetStatus(s Status)
func (*PRepStatusState) SetVTotal ¶ added in v0.9.7
func (ps *PRepStatusState) SetVTotal(t int64)
func (*PRepStatusState) ToJSON ¶ added in v0.9.7
func (ps *PRepStatusState) ToJSON(sc icmodule.StateContext) map[string]interface{}
func (*PRepStatusState) UnjailRequestHeight ¶ added in v1.4.0
func (ps *PRepStatusState) UnjailRequestHeight() int64
type RewardCalcInfo ¶
type RewardCalcInfo struct { icobject.NoDatabase // contains filtered or unexported fields }
func NewRewardCalcInfo ¶
func NewRewardCalcInfo() *RewardCalcInfo
func ToRewardCalcInfo ¶
func ToRewardCalcInfo(object trie.Object) *RewardCalcInfo
func (*RewardCalcInfo) Clone ¶
func (rc *RewardCalcInfo) Clone() *RewardCalcInfo
func (*RewardCalcInfo) Format ¶ added in v0.9.7
func (rc *RewardCalcInfo) Format(f fmt.State, c rune)
func (*RewardCalcInfo) GetResultInJSON ¶ added in v0.9.7
func (rc *RewardCalcInfo) GetResultInJSON() map[string]interface{}
func (*RewardCalcInfo) PrevCalcReward ¶
func (rc *RewardCalcInfo) PrevCalcReward() *big.Int
func (*RewardCalcInfo) PrevHash ¶ added in v0.9.7
func (rc *RewardCalcInfo) PrevHash() []byte
func (*RewardCalcInfo) PrevHeight ¶
func (rc *RewardCalcInfo) PrevHeight() int64
func (*RewardCalcInfo) PrevPeriod ¶ added in v0.9.7
func (rc *RewardCalcInfo) PrevPeriod() int64
func (*RewardCalcInfo) RLPDecodeFields ¶
func (rc *RewardCalcInfo) RLPDecodeFields(decoder codec.Decoder) error
func (*RewardCalcInfo) RLPEncodeFields ¶
func (rc *RewardCalcInfo) RLPEncodeFields(encoder codec.Encoder) error
func (*RewardCalcInfo) SetPrevCalcReward ¶ added in v0.9.7
func (rc *RewardCalcInfo) SetPrevCalcReward(v *big.Int)
func (*RewardCalcInfo) SetPrevHash ¶ added in v0.9.7
func (rc *RewardCalcInfo) SetPrevHash(hash []byte)
func (*RewardCalcInfo) SetPrevHeight ¶ added in v0.9.7
func (rc *RewardCalcInfo) SetPrevHeight(height int64)
func (*RewardCalcInfo) SetStartHeight ¶ added in v0.9.7
func (rc *RewardCalcInfo) SetStartHeight(height int64)
func (*RewardCalcInfo) StartHeight ¶
func (rc *RewardCalcInfo) StartHeight() int64
func (*RewardCalcInfo) Update ¶ added in v0.9.7
func (rc *RewardCalcInfo) Update(blockHeight int64, reward *big.Int, hash []byte)
func (*RewardCalcInfo) Version ¶
func (rc *RewardCalcInfo) Version() int
type RewardFund ¶
type RewardFund struct {
// contains filtered or unexported fields
}
func NewRewardFund ¶
func NewRewardFund(version int) *RewardFund
func NewRewardFundFromByte ¶ added in v1.4.0
func NewRewardFundFromByte(bs []byte) (*RewardFund, error)
func NewSafeRewardFundV1 ¶ added in v1.4.0
func NewSafeRewardFundV2 ¶ added in v1.4.0
func (*RewardFund) Bytes ¶
func (r *RewardFund) Bytes() []byte
func (*RewardFund) Clone ¶
func (r *RewardFund) Clone() *RewardFund
func (*RewardFund) Equal ¶
func (r *RewardFund) Equal(r2 *RewardFund) bool
func (*RewardFund) GetAllocationByKey ¶ added in v1.4.0
func (r *RewardFund) GetAllocationByKey(key RFundKey) icmodule.Rate
func (*RewardFund) GetAmount ¶ added in v1.4.0
func (r *RewardFund) GetAmount(key RFundKey) *big.Int
func (*RewardFund) GetOrderAllocationKeys ¶ added in v1.4.0
func (r *RewardFund) GetOrderAllocationKeys() []RFundKey
func (*RewardFund) ICps ¶ added in v1.4.0
func (r *RewardFund) ICps() icmodule.Rate
func (*RewardFund) IGlobal ¶ added in v1.4.0
func (r *RewardFund) IGlobal() *big.Int
func (*RewardFund) IPrep ¶ added in v1.4.0
func (r *RewardFund) IPrep() icmodule.Rate
func (*RewardFund) IRelay ¶ added in v1.4.0
func (r *RewardFund) IRelay() icmodule.Rate
func (*RewardFund) IVoter ¶ added in v1.4.0
func (r *RewardFund) IVoter() icmodule.Rate
func (*RewardFund) Iwage ¶ added in v1.4.0
func (r *RewardFund) Iwage() icmodule.Rate
func (*RewardFund) RLPDecodeSelf ¶
func (r *RewardFund) RLPDecodeSelf(d codec.Decoder) error
func (*RewardFund) RLPEncodeSelf ¶
func (r *RewardFund) RLPEncodeSelf(encoder codec.Encoder) error
func (*RewardFund) SetAllocation ¶ added in v1.4.0
func (r *RewardFund) SetAllocation(alloc map[RFundKey]icmodule.Rate) error
func (*RewardFund) SetIGlobal ¶ added in v1.4.0
func (r *RewardFund) SetIGlobal(value *big.Int) error
func (*RewardFund) ToJSON ¶
func (r *RewardFund) ToJSON() map[string]interface{}
func (*RewardFund) ToRewardFundV2 ¶ added in v1.4.0
func (r *RewardFund) ToRewardFundV2() *RewardFund
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnapshotWithBuilder ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
func NewStateFromSnapshot ¶
func NewStateFromTrie ¶
func (*State) CheckConsistentValidationPenalty ¶ added in v0.9.7
func (s *State) CheckConsistentValidationPenalty(revision int, ps *PRepStatusState) bool
func (*State) CheckValidationPenalty ¶ added in v0.9.7
func (s *State) CheckValidationPenalty(ps *PRepStatusState, blockHeight int64) bool
func (*State) ClearCache ¶ added in v0.9.7
func (s *State) ClearCache()
func (*State) DeleteIllegalDelegation ¶ added in v0.9.10
func (*State) DisablePRep ¶ added in v0.9.7
func (*State) GetAccountSnapshot ¶ added in v0.9.7
func (s *State) GetAccountSnapshot(addr module.Address) *AccountSnapshot
func (*State) GetAccountState ¶ added in v0.9.7
func (s *State) GetAccountState(addr module.Address) *AccountState
func (*State) GetConsistentValidationPenaltyCondition ¶
func (*State) GetConsistentValidationPenaltyMask ¶
func (*State) GetDelegationSlotMax ¶ added in v0.9.7
func (*State) GetExtraMainPRepCount ¶ added in v0.9.8
GetExtraMainPRepCount returns # of extra main preps Extra MainPRep means the PRep which plays a validator least recently
func (*State) GetIISSVersion ¶
func (*State) GetIllegalDelegation ¶ added in v0.9.10
func (s *State) GetIllegalDelegation(addr module.Address) *IllegalDelegation
func (*State) GetLastBlockVotersSnapshot ¶ added in v0.9.8
func (s *State) GetLastBlockVotersSnapshot() *BlockVotersSnapshot
func (*State) GetLockMaxMultiplier ¶
func (*State) GetLockMinMultiplier ¶
func (*State) GetMainPRepCount ¶
GetMainPRepCount returns the number of main preps excluding extra main preps This value is the number of main preps as configuration If you want to get the actual number of main preps in this term, use termData.MainPRepCount() instead.
func (*State) GetMinimumBond ¶ added in v1.4.0
GetMinimumBond returns the minimum bond related to minimum wage It returns nil before RevisionIISS4R0
func (*State) GetNetworkInfoInJSON ¶ added in v1.0.0
func (*State) GetNetworkScoreTimerSnapshot ¶ added in v1.1.0
func (s *State) GetNetworkScoreTimerSnapshot(height int64) *TimerSnapshot
func (*State) GetNetworkScoreTimerState ¶ added in v1.1.0
func (s *State) GetNetworkScoreTimerState(height int64) *TimerState
func (*State) GetNetworkScores ¶ added in v1.1.0
func (*State) GetNodeByOwner ¶ added in v0.9.7
func (*State) GetPRepBaseByOwner ¶ added in v0.9.7
func (s *State) GetPRepBaseByOwner(owner module.Address, createIfNotExist bool) *PRepBaseState
func (*State) GetPRepByOwner ¶ added in v0.9.7
func (*State) GetPRepCountConfig ¶ added in v1.4.0
func (s *State) GetPRepCountConfig(revision int) PRepCountConfig
func (*State) GetPRepIllegalDelegated ¶ added in v0.9.10
func (*State) GetPRepStatsInJSON ¶ added in v0.9.7
func (s *State) GetPRepStatsInJSON(sc icmodule.StateContext) (map[string]interface{}, error)
func (*State) GetPRepStatsOfInJSON ¶ added in v1.3.7
func (*State) GetPRepStatusByOwner ¶ added in v0.9.7
func (s *State) GetPRepStatusByOwner(owner module.Address, createIfNotExist bool) *PRepStatusState
func (*State) GetPRepStatuses ¶ added in v0.9.7
func (s *State) GetPRepStatuses() ([]*PRepStatusState, error)
func (*State) GetPRepsInJSON ¶ added in v0.9.7
func (*State) GetRewardCalcInfo ¶
func (s *State) GetRewardCalcInfo() (*RewardCalcInfo, error)
func (*State) GetRewardFund ¶
func (s *State) GetRewardFund(revision int) *RewardFund
func (*State) GetRewardFundV1 ¶ added in v1.4.0
func (s *State) GetRewardFundV1() *RewardFund
func (*State) GetRewardFundV2 ¶ added in v1.4.0
func (s *State) GetRewardFundV2() *RewardFund
func (*State) GetSlashingRate ¶ added in v1.4.0
func (*State) GetSnapshot ¶
func (*State) GetSubPRepCount ¶
GetSubPRepCount returns the number of sub preps including extra main preps
func (*State) GetTermPeriod ¶
func (*State) GetTermSnapshot ¶ added in v0.9.8
func (s *State) GetTermSnapshot() *TermSnapshot
func (*State) GetTotalBond ¶ added in v0.9.7
func (*State) GetTotalDelegation ¶ added in v0.9.7
func (*State) GetTotalStake ¶
func (*State) GetUnbondingMax ¶
func (*State) GetUnbondingPeriodMultiplier ¶
func (*State) GetUnbondingTimerSnapshot ¶ added in v0.9.7
func (s *State) GetUnbondingTimerSnapshot(height int64) *TimerSnapshot
func (*State) GetUnbondingTimerState ¶ added in v0.9.7
func (s *State) GetUnbondingTimerState(height int64) *TimerState
func (*State) GetUnstakeLockPeriod ¶ added in v0.9.10
func (*State) GetUnstakeSlotMax ¶
func (*State) GetUnstakingTimerSnapshot ¶ added in v0.9.7
func (s *State) GetUnstakingTimerSnapshot(height int64) *TimerSnapshot
func (*State) GetUnstakingTimerState ¶ added in v0.9.7
func (s *State) GetUnstakingTimerState(height int64) *TimerState
func (*State) GetValidationPenaltyCondition ¶
func (*State) GetValidatorsSnapshot ¶ added in v0.9.7
func (s *State) GetValidatorsSnapshot() *ValidatorsSnapshot
func (*State) ImposePenalty ¶ added in v0.9.7
func (s *State) ImposePenalty( sc icmodule.StateContext, pt icmodule.PenaltyType, ps *PRepStatusState) error
ImposePenalty changes grade and set LastState to icstate.None
func (*State) InitCommissionInfo ¶ added in v1.4.0
func (s *State) InitCommissionInfo(owner module.Address, ci *CommissionInfo) error
func (*State) IsDecentralizationConditionMet ¶ added in v0.9.7
func (*State) MigrateBondRequirement ¶ added in v1.4.3
func (*State) OnBlockVote ¶ added in v0.9.8
func (*State) OnMainPRepReplaced ¶ added in v0.9.8
func (*State) OnValidatorOut ¶ added in v0.9.8
func (*State) ReducePRepBonded ¶ added in v1.2.9
ReducePRepBonded handles to reduce PRepStatus.bonded Do not change PRep grade here Caution: amount should not include the amount from unbonded
func (*State) RegisterPRep ¶ added in v0.9.7
func (*State) SetBondRequirement ¶
func (*State) SetConsistentValidationPenaltyCondition ¶
func (*State) SetConsistentValidationPenaltyMask ¶
func (*State) SetDelegationSlotMax ¶ added in v0.9.7
func (*State) SetExtraMainPRepCount ¶ added in v0.9.8
func (*State) SetIISSVersion ¶
func (*State) SetIllegalDelegation ¶ added in v0.9.10
func (s *State) SetIllegalDelegation(id *IllegalDelegation) error
func (*State) SetLastBlockVotersSnapshot ¶ added in v0.9.8
func (s *State) SetLastBlockVotersSnapshot(value *BlockVotersSnapshot) error
func (*State) SetLockVariables ¶
func (*State) SetMainPRepCount ¶
func (*State) SetNetworkScore ¶ added in v1.1.0
func (*State) SetPRepIllegalDelegated ¶ added in v0.9.10
func (*State) SetRewardCalcInfo ¶
func (s *State) SetRewardCalcInfo(rc *RewardCalcInfo) error
func (*State) SetRewardFund ¶
func (s *State) SetRewardFund(r *RewardFund) error
func (*State) SetSlashingRate ¶ added in v1.4.0
func (*State) SetSubPRepCount ¶
func (*State) SetTermPeriod ¶
func (*State) SetTermSnapshot ¶ added in v0.9.8
func (s *State) SetTermSnapshot(term *TermSnapshot) error
func (*State) SetTotalDelegation ¶ added in v0.9.7
func (*State) SetUnbondingMax ¶
func (*State) SetUnbondingPeriodMultiplier ¶
func (*State) SetUnstakeSlotMax ¶
func (*State) SetValidationPenaltyCondition ¶
func (*State) SetValidatorsSnapshot ¶ added in v0.9.7
func (s *State) SetValidatorsSnapshot(vss *ValidatorsSnapshot) error
type TermSnapshot ¶ added in v0.9.8
type TermSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func NewTermWithTag ¶ added in v0.9.7
func NewTermWithTag(tag icobject.Tag) *TermSnapshot
func ToTerm ¶
func ToTerm(object trie.Object) *TermSnapshot
func (*TermSnapshot) RLPDecodeFields ¶ added in v0.9.8
func (term *TermSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*TermSnapshot) RLPEncodeFields ¶ added in v0.9.8
func (term *TermSnapshot) RLPEncodeFields(encoder codec.Encoder) error
type TermState ¶ added in v0.9.8
type TermState struct {
// contains filtered or unexported fields
}
func NewNextTerm ¶
func NewNextTerm(sc icmodule.StateContext, state *State, totalSupply *big.Int, preps PRepSet) *TermState
NewNextTerm returns the next term It assumes that state and totalSupply are not nil.
func (*TermState) GetSnapshot ¶ added in v0.9.8
func (term *TermState) GetSnapshot() *TermSnapshot
type TimerCache ¶
type TimerCache struct {
// contains filtered or unexported fields
}
func (*TimerCache) Clear ¶
func (c *TimerCache) Clear()
func (*TimerCache) Flush ¶
func (c *TimerCache) Flush()
func (*TimerCache) Get ¶
func (c *TimerCache) Get(height int64) *TimerState
func (*TimerCache) GetSnapshot ¶ added in v0.9.7
func (c *TimerCache) GetSnapshot(height int64) *TimerSnapshot
func (*TimerCache) Reset ¶
func (c *TimerCache) Reset()
type TimerIterator ¶ added in v0.9.7
type TimerJobInfo ¶
type TimerSnapshot ¶ added in v0.9.7
type TimerSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func ToTimer ¶
func ToTimer(object trie.Object) *TimerSnapshot
func (*TimerSnapshot) Equal ¶ added in v0.9.7
func (t *TimerSnapshot) Equal(object icobject.Impl) bool
func (TimerSnapshot) Iterator ¶ added in v0.9.7
func (t TimerSnapshot) Iterator() TimerIterator
func (*TimerSnapshot) RLPDecodeFields ¶ added in v0.9.7
func (t *TimerSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*TimerSnapshot) RLPEncodeFields ¶ added in v0.9.7
func (t *TimerSnapshot) RLPEncodeFields(encoder codec.Encoder) error
func (*TimerSnapshot) Version ¶ added in v0.9.7
func (t *TimerSnapshot) Version() int
type TimerState ¶ added in v0.9.7
type TimerState struct {
// contains filtered or unexported fields
}
func NewTimerWithSnapshot ¶ added in v0.9.7
func NewTimerWithSnapshot(tss *TimerSnapshot) *TimerState
func (*TimerState) Add ¶ added in v0.9.7
func (t *TimerState) Add(address module.Address)
func (*TimerState) Delete ¶ added in v0.9.7
func (t *TimerState) Delete(address module.Address)
func (*TimerState) GetSnapshot ¶ added in v0.9.7
func (t *TimerState) GetSnapshot() *TimerSnapshot
func (TimerState) Iterator ¶ added in v0.9.7
func (t TimerState) Iterator() TimerIterator
func (*TimerState) Reset ¶ added in v0.9.7
func (t *TimerState) Reset(ts *TimerSnapshot) *TimerState
type Unbond ¶
type Unbond struct {
// contains filtered or unexported fields
}
func (*Unbond) RLPDecodeSelf ¶ added in v0.9.7
func (*Unbond) RLPEncodeSelf ¶ added in v0.9.7
type Unbonds ¶
type Unbonds []*Unbond
func (Unbonds) ExpireRefCount ¶
func (Unbonds) GetUnbondAmount ¶
func (Unbonds) GetUnbondByAddress ¶
func (Unbonds) ToJSON ¶
func (ul Unbonds) ToJSON(_ module.JSONVersion) []interface{}
type Unstake ¶
Unstake is done on OnExecutionEnd of ExpireHeight
func (*Unstake) RLPDecodeSelf ¶ added in v0.9.7
func (*Unstake) RLPEncodeSelf ¶ added in v0.9.7
type Unstakes ¶
type Unstakes []*Unstake
func (Unstakes) GetUnstakeAmount ¶
GetUnstakeAmount return unstake Value
type ValidatorsSnapshot ¶ added in v0.9.7
type ValidatorsSnapshot struct { icobject.NoDatabase // contains filtered or unexported fields }
func NewValidatorsSnapshotWithPRepSnapshot ¶ added in v0.9.7
func NewValidatorsSnapshotWithPRepSnapshot( prepSnapshots PRepSnapshots, ownerToNodeMapper OwnerToNodeMappable, size int) *ValidatorsSnapshot
func ToValidators ¶ added in v0.9.7
func ToValidators(object trie.Object) *ValidatorsSnapshot
func (*ValidatorsSnapshot) Equal ¶ added in v0.9.7
func (vss *ValidatorsSnapshot) Equal(object icobject.Impl) bool
func (*ValidatorsSnapshot) IsUpdated ¶ added in v0.9.7
func (vss *ValidatorsSnapshot) IsUpdated(blockHeight int64) bool
IsUpdated returns true if validatorList is updated at this block
func (*ValidatorsSnapshot) NewValidatorSet ¶ added in v0.9.7
func (*ValidatorsSnapshot) NextPRepSnapshotIndex ¶ added in v0.9.7
func (vd *ValidatorsSnapshot) NextPRepSnapshotIndex() int
func (*ValidatorsSnapshot) RLPDecodeFields ¶ added in v0.9.7
func (vss *ValidatorsSnapshot) RLPDecodeFields(decoder codec.Decoder) error
func (*ValidatorsSnapshot) RLPEncodeFields ¶ added in v0.9.7
func (vss *ValidatorsSnapshot) RLPEncodeFields(encoder codec.Encoder) error
func (*ValidatorsSnapshot) Version ¶ added in v0.9.7
func (vss *ValidatorsSnapshot) Version() int
type ValidatorsState ¶ added in v0.9.7
type ValidatorsState struct {
// contains filtered or unexported fields
}
func NewValidatorsStateWithSnapshot ¶ added in v0.9.7
func NewValidatorsStateWithSnapshot(vss *ValidatorsSnapshot) *ValidatorsState
func (*ValidatorsState) GetSnapshot ¶ added in v0.9.7
func (vs *ValidatorsState) GetSnapshot() *ValidatorsSnapshot
func (*ValidatorsState) IsDirty ¶ added in v0.9.7
func (vs *ValidatorsState) IsDirty() bool
func (*ValidatorsState) NewValidatorSet ¶ added in v0.9.7
func (*ValidatorsState) NextPRepSnapshotIndex ¶ added in v0.9.7
func (vd *ValidatorsState) NextPRepSnapshotIndex() int
func (*ValidatorsState) Reset ¶ added in v0.9.7
func (vs *ValidatorsState) Reset(vss *ValidatorsSnapshot)
Source Files ¶
- account.go
- accountcache.go
- allprepcache.go
- blockvoters.go
- bond.go
- commissioninfo.go
- delegation.go
- issue.go
- jailinfo.go
- module.go
- networkvalue.go
- nodeownercache.go
- object.go
- prep.go
- prepbase.go
- prepcache.go
- prepcountconfig.go
- prepstatus.go
- rewardcalcinfo.go
- rewardfund.go
- snapshot.go
- state.go
- term.go
- timer.go
- timercache.go
- unbond.go
- unstake.go
- validators.go
- voting.go