Documentation ¶
Overview ¶
Package core is a generated GoMock package.
Index ¶
- Constants
- func ConvertVoteToAddress(votes []*Vote) []types.Address
- func NewAlgo(info *GroupInfo) *algo
- type Algo
- type BaseStats
- type BigInt
- type ByBalance
- type BySuccessRate
- type DayStats
- type GroupInfo
- type HourStats
- type MemberPlan
- type MockSBPStatReader
- func (m *MockSBPStatReader) DayStats(startIndex, endIndex uint64) ([]*DayStats, error)
- func (m *MockSBPStatReader) EXPECT() *MockSBPStatReaderMockRecorder
- func (m *MockSBPStatReader) GetDayTimeIndex() TimeIndex
- func (m *MockSBPStatReader) GetHourTimeIndex() TimeIndex
- func (m *MockSBPStatReader) GetNodeCount() int
- func (m *MockSBPStatReader) GetPeriodTimeIndex() TimeIndex
- func (m *MockSBPStatReader) GetSuccessRateByHour(index uint64) (map[types.Address]int32, error)
- func (m *MockSBPStatReader) HourStats(startIndex, endIndex uint64) ([]*HourStats, error)
- func (m *MockSBPStatReader) PeriodStats(startIndex, endIndex uint64) ([]*PeriodStats, error)
- type MockSBPStatReaderMockRecorder
- func (mr *MockSBPStatReaderMockRecorder) DayStats(startIndex, endIndex interface{}) *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) GetDayTimeIndex() *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) GetHourTimeIndex() *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) GetNodeCount() *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) GetPeriodTimeIndex() *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) GetSuccessRateByHour(index interface{}) *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) HourStats(startIndex, endIndex interface{}) *gomock.Call
- func (mr *MockSBPStatReaderMockRecorder) PeriodStats(startIndex, endIndex interface{}) *gomock.Call
- type PeriodStats
- type SBPStatReader
- type SbpStats
- type SeedInfo
- type SuccessRateVote
- type TimeIndex
- type Vote
- type VoteAlgoContext
- type VoteType
Constants ¶
const ( NORMAL = VoteType(0) SUCCESS_RATE_PROMOTION = VoteType(1) SUCCESS_RATE_DEMOTION = VoteType(2) RANDOM_PROMOTION = VoteType(3) )
const (
Line = 800000
)
Variables ¶
This section is empty.
Functions ¶
func ConvertVoteToAddress ¶
Types ¶
type Algo ¶
type Algo interface { ShuffleVotes(votes []*Vote, hashH *ledger.HashHeight, info *SeedInfo) []*Vote FilterVotes(context *VoteAlgoContext) []*Vote FilterSimple(votes []*Vote) ([]*Vote, []*Vote) }
type BySuccessRate ¶
type BySuccessRate []*SuccessRateVote
func (BySuccessRate) Len ¶
func (a BySuccessRate) Len() int
func (BySuccessRate) Less ¶
func (a BySuccessRate) Less(i, j int) bool
func (BySuccessRate) Swap ¶
func (a BySuccessRate) Swap(i, j int)
type GroupInfo ¶
type GroupInfo struct { TimeIndex types.ConsensusGroupInfo GenesisTime time.Time PlanInterval uint64 // contains filtered or unexported fields }
func NewGroupInfo ¶
func NewGroupInfo(genesisTime time.Time, info types.ConsensusGroupInfo) *GroupInfo
func (GroupInfo) GenPlan ¶
func (self GroupInfo) GenPlan(index uint64, members []*Vote) []*MemberPlan
func (GroupInfo) GenPlanByAddress ¶
func (self GroupInfo) GenPlanByAddress(index uint64, members []types.Address) []*MemberPlan
type MemberPlan ¶
type MockSBPStatReader ¶ added in v2.11.3
type MockSBPStatReader struct {
// contains filtered or unexported fields
}
MockSBPStatReader is a mock of SBPStatReader interface.
func NewMockSBPStatReader ¶ added in v2.11.3
func NewMockSBPStatReader(ctrl *gomock.Controller) *MockSBPStatReader
NewMockSBPStatReader creates a new mock instance.
func (*MockSBPStatReader) DayStats ¶ added in v2.11.3
func (m *MockSBPStatReader) DayStats(startIndex, endIndex uint64) ([]*DayStats, error)
DayStats mocks base method.
func (*MockSBPStatReader) EXPECT ¶ added in v2.11.3
func (m *MockSBPStatReader) EXPECT() *MockSBPStatReaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSBPStatReader) GetDayTimeIndex ¶ added in v2.11.3
func (m *MockSBPStatReader) GetDayTimeIndex() TimeIndex
GetDayTimeIndex mocks base method.
func (*MockSBPStatReader) GetHourTimeIndex ¶ added in v2.11.3
func (m *MockSBPStatReader) GetHourTimeIndex() TimeIndex
GetHourTimeIndex mocks base method.
func (*MockSBPStatReader) GetNodeCount ¶ added in v2.11.3
func (m *MockSBPStatReader) GetNodeCount() int
GetNodeCount mocks base method.
func (*MockSBPStatReader) GetPeriodTimeIndex ¶ added in v2.11.3
func (m *MockSBPStatReader) GetPeriodTimeIndex() TimeIndex
GetPeriodTimeIndex mocks base method.
func (*MockSBPStatReader) GetSuccessRateByHour ¶ added in v2.11.3
GetSuccessRateByHour mocks base method.
func (*MockSBPStatReader) HourStats ¶ added in v2.11.3
func (m *MockSBPStatReader) HourStats(startIndex, endIndex uint64) ([]*HourStats, error)
HourStats mocks base method.
func (*MockSBPStatReader) PeriodStats ¶ added in v2.11.3
func (m *MockSBPStatReader) PeriodStats(startIndex, endIndex uint64) ([]*PeriodStats, error)
PeriodStats mocks base method.
type MockSBPStatReaderMockRecorder ¶ added in v2.11.3
type MockSBPStatReaderMockRecorder struct {
// contains filtered or unexported fields
}
MockSBPStatReaderMockRecorder is the mock recorder for MockSBPStatReader.
func (*MockSBPStatReaderMockRecorder) DayStats ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) DayStats(startIndex, endIndex interface{}) *gomock.Call
DayStats indicates an expected call of DayStats.
func (*MockSBPStatReaderMockRecorder) GetDayTimeIndex ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) GetDayTimeIndex() *gomock.Call
GetDayTimeIndex indicates an expected call of GetDayTimeIndex.
func (*MockSBPStatReaderMockRecorder) GetHourTimeIndex ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) GetHourTimeIndex() *gomock.Call
GetHourTimeIndex indicates an expected call of GetHourTimeIndex.
func (*MockSBPStatReaderMockRecorder) GetNodeCount ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) GetNodeCount() *gomock.Call
GetNodeCount indicates an expected call of GetNodeCount.
func (*MockSBPStatReaderMockRecorder) GetPeriodTimeIndex ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) GetPeriodTimeIndex() *gomock.Call
GetPeriodTimeIndex indicates an expected call of GetPeriodTimeIndex.
func (*MockSBPStatReaderMockRecorder) GetSuccessRateByHour ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) GetSuccessRateByHour(index interface{}) *gomock.Call
GetSuccessRateByHour indicates an expected call of GetSuccessRateByHour.
func (*MockSBPStatReaderMockRecorder) HourStats ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) HourStats(startIndex, endIndex interface{}) *gomock.Call
HourStats indicates an expected call of HourStats.
func (*MockSBPStatReaderMockRecorder) PeriodStats ¶ added in v2.11.3
func (mr *MockSBPStatReaderMockRecorder) PeriodStats(startIndex, endIndex interface{}) *gomock.Call
PeriodStats indicates an expected call of PeriodStats.
type PeriodStats ¶
type PeriodStats struct {
*BaseStats
}
type SBPStatReader ¶
type SBPStatReader interface { DayStats(startIndex uint64, endIndex uint64) ([]*DayStats, error) GetDayTimeIndex() TimeIndex HourStats(startIndex uint64, endIndex uint64) ([]*HourStats, error) GetHourTimeIndex() TimeIndex PeriodStats(startIndex uint64, endIndex uint64) ([]*PeriodStats, error) GetPeriodTimeIndex() TimeIndex GetSuccessRateByHour(index uint64) (map[types.Address]int32, error) GetNodeCount() int }
type SeedInfo ¶
type SeedInfo struct {
// contains filtered or unexported fields
}
func NewSeedInfo ¶
type SuccessRateVote ¶
type TimeIndex ¶
type VoteAlgoContext ¶
type VoteAlgoContext struct {
// contains filtered or unexported fields
}
func NewVoteAlgoContext ¶
func NewVoteAlgoContext(votes []*Vote, hashH *ledger.HashHeight, successRate map[types.Address]int32, seeds *SeedInfo) *VoteAlgoContext