Documentation ¶
Overview ¶
Package consensus is a generated GoMock package.
Package consensus is a generated GoMock package.
Package consensus is a generated GoMock package.
Package consensus is a generated GoMock package.
Index ¶
- Variables
- func NewVirtualVerifier() interfaces.ConsensusVerifier
- type APIReader
- type APISnapshot
- type ByBalance
- type Chain
- type Consensus
- type ConsensusCfg
- type DposReader
- type DposVerifier
- type Event
- type Life
- type LinkedArray
- type MockChain
- func (m *MockChain) EXPECT() *MockChainMockRecorder
- func (m *MockChain) GetAllRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
- func (m *MockChain) GetConfirmedBalanceList(addrList []types.Address, tokenID types.TokenTypeId, sbHash types.Hash) (map[types.Address]*big.Int, error)
- func (m *MockChain) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
- func (m *MockChain) GetContractMeta(contractAddress types.Address) (*core.ContractMeta, error)
- func (m *MockChain) GetGenesisSnapshotBlock() *core.SnapshotBlock
- func (m *MockChain) GetLastUnpublishedSeedSnapshotHeader(producer types.Address, beforeTime time.Time) (*core.SnapshotBlock, error)
- func (m *MockChain) GetLatestSnapshotBlock() *core.SnapshotBlock
- func (m *MockChain) GetRandomSeed(snapshotHash types.Hash, n int) uint64
- func (m *MockChain) GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
- func (m *MockChain) GetSnapshotBlockByHash(hash types.Hash) (*core.SnapshotBlock, error)
- func (m *MockChain) GetSnapshotBlockByHeight(height uint64) (*core.SnapshotBlock, error)
- func (m *MockChain) GetSnapshotHeaderBeforeTime(timestamp *time.Time) (*core.SnapshotBlock, error)
- func (m *MockChain) GetSnapshotHeadersAfterOrEqualTime(endHashHeight *core.HashHeight, startTime *time.Time, producer *types.Address) ([]*core.SnapshotBlock, error)
- func (m *MockChain) GetVoteList(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error)
- func (m *MockChain) IsGenesisSnapshotBlock(hash types.Hash) bool
- func (m *MockChain) NewDb(dbDir string) (*leveldb.DB, error)
- func (m *MockChain) Register(listener interfaces.EventListener)
- func (m *MockChain) UnRegister(listener interfaces.EventListener)
- type MockChainMockRecorder
- func (mr *MockChainMockRecorder) GetAllRegisterList(snapshotHash, gid interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetConfirmedBalanceList(addrList, tokenID, sbHash interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetConsensusGroupList(snapshotHash interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetContractMeta(contractAddress interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetGenesisSnapshotBlock() *gomock.Call
- func (mr *MockChainMockRecorder) GetLastUnpublishedSeedSnapshotHeader(producer, beforeTime interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetLatestSnapshotBlock() *gomock.Call
- func (mr *MockChainMockRecorder) GetRandomSeed(snapshotHash, n interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetRegisterList(snapshotHash, gid interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetSnapshotBlockByHash(hash interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetSnapshotBlockByHeight(height interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetSnapshotHeaderBeforeTime(timestamp interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetSnapshotHeadersAfterOrEqualTime(endHashHeight, startTime, producer interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetVoteList(snapshotHash, gid interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) IsGenesisSnapshotBlock(hash interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) NewDb(dbDir interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) Register(listener interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) UnRegister(listener interface{}) *gomock.Call
- type MockDposReader
- func (m *MockDposReader) EXPECT() *MockDposReaderMockRecorder
- func (m *MockDposReader) ElectionIndex(arg0 uint64) (*electionResult, error)
- func (m *MockDposReader) GenVoteTime(arg0 uint64) time.Time
- func (m *MockDposReader) GetInfo() *core.GroupInfo
- func (m *MockDposReader) Index2Time(arg0 uint64) (time.Time, time.Time)
- func (m *MockDposReader) Time2Index(arg0 time.Time) uint64
- func (m *MockDposReader) VerifyProducer(arg0 types.Address, arg1 time.Time) (bool, error)
- type MockDposReaderMockRecorder
- func (mr *MockDposReaderMockRecorder) ElectionIndex(arg0 interface{}) *gomock.Call
- func (mr *MockDposReaderMockRecorder) GenVoteTime(arg0 interface{}) *gomock.Call
- func (mr *MockDposReaderMockRecorder) GetInfo() *gomock.Call
- func (mr *MockDposReaderMockRecorder) Index2Time(arg0 interface{}) *gomock.Call
- func (mr *MockDposReaderMockRecorder) Time2Index(arg0 interface{}) *gomock.Call
- func (mr *MockDposReaderMockRecorder) VerifyProducer(arg0, arg1 interface{}) *gomock.Call
- type MockLinkedArray
- func (m *MockLinkedArray) EXPECT() *MockLinkedArrayMockRecorder
- func (m *MockLinkedArray) GetByIndex(arg0 uint64) (*cdb.Point, error)
- func (m *MockLinkedArray) GetByIndexWithProof(arg0 uint64, arg1 types.Hash) (*cdb.Point, error)
- func (m *MockLinkedArray) Index2Time(arg0 uint64) (time.Time, time.Time)
- func (m *MockLinkedArray) Time2Index(arg0 time.Time) uint64
- type MockLinkedArrayMockRecorder
- func (mr *MockLinkedArrayMockRecorder) GetByIndex(arg0 interface{}) *gomock.Call
- func (mr *MockLinkedArrayMockRecorder) GetByIndexWithProof(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockLinkedArrayMockRecorder) Index2Time(arg0 interface{}) *gomock.Call
- func (mr *MockLinkedArrayMockRecorder) Time2Index(arg0 interface{}) *gomock.Call
- type MockRollbackProof
- func (m *MockRollbackProof) EXPECT() *MockRollbackProofMockRecorder
- func (m *MockRollbackProof) Proof(arg0 types.Hash, arg1 time.Time) (*ledger.SnapshotBlock, error)
- func (m *MockRollbackProof) ProofEmpty(arg0, arg1 time.Time) (bool, error)
- func (m *MockRollbackProof) ProofHash(arg0 time.Time) (types.Hash, error)
- type MockRollbackProofMockRecorder
- type ProducersEvent
- type Reader
- type RollbackProof
- type SBPInfo
- type Subscriber
- type VoteDetails
Constants ¶
This section is empty.
Variables ¶
var NotFoundBlock = errors.New("block not found")
Functions ¶
func NewVirtualVerifier ¶ added in v2.11.3
func NewVirtualVerifier() interfaces.ConsensusVerifier
Types ¶
type APIReader ¶
type APIReader interface { ReadVoteMap(t time.Time) ([]*VoteDetails, *ledger.HashHeight, error) ReadSuccessRate(start, end uint64) ([]map[types.Address]*cdb.Content, error) ReadByIndex(gid types.Gid, index uint64) ([]*Event, uint64, error) }
APIReader is just provided for RPC api
type APISnapshot ¶
type APISnapshot struct {
// contains filtered or unexported fields
}
APISnapshot is the interface that can query snapshot consensus info.
func (APISnapshot) ReadByIndex ¶
func (*APISnapshot) ReadSuccessRate ¶
func (api *APISnapshot) ReadSuccessRate(start, end uint64) ([]map[types.Address]*cdb.Content, error)
ReadSuccessRate query success rate for every SBP.
func (*APISnapshot) ReadVoteMap ¶
func (api *APISnapshot) ReadVoteMap(ti time.Time) ([]*VoteDetails, *ledger.HashHeight, error)
ReadVoteMap query the vote result by time.
type ByBalance ¶
type ByBalance []*VoteDetails
ByBalance sorts a slice of VoteDetails in decreasing order. Sorts by name for equal balance
type Chain ¶
type Chain interface { GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetLatestSnapshotBlock() *ledger.SnapshotBlock /* * Event Manager */ Register(listener interfaces.EventListener) UnRegister(listener interfaces.EventListener) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error) // Get all consensus group GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error) // Get register for consensus group GetAllRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error) // Get register for consensus group GetVoteList(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error) // Get the candidate's vote GetConfirmedBalanceList(addrList []types.Address, tokenID types.TokenTypeId, sbHash types.Hash) (map[types.Address]*big.Int, error) // Get balance for addressList GetSnapshotHeaderBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error) GetContractMeta(contractAddress types.Address) (meta *ledger.ContractMeta, err error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSnapshotBlockByHash(hash types.Hash) (*ledger.SnapshotBlock, error) GetSnapshotHeadersAfterOrEqualTime(endHashHeight *ledger.HashHeight, startTime *time.Time, producer *types.Address) ([]*ledger.SnapshotBlock, error) IsGenesisSnapshotBlock(hash types.Hash) bool GetRandomSeed(snapshotHash types.Hash, n int) uint64 GetLastUnpublishedSeedSnapshotHeader(producer types.Address, beforeTime time.Time) (*ledger.SnapshotBlock, error) NewDb(dbDir string) (*leveldb.DB, error) }
Chain refer to chain.Chain
type Consensus ¶
type Consensus interface { interfaces.ConsensusVerifier Subscriber Reader Life API() APIReader SBPReader() core.SBPStatReader }
Consensus include all interface for consensus
func NewConsensus ¶
func NewConsensus(ch Chain, rollback lock.ChainRollback) Consensus
NewConsensus instantiates a new consensus object
type ConsensusCfg ¶
type ConsensusCfg struct { }
func Cfg ¶
func Cfg() *ConsensusCfg
func DefaultCfg ¶
func DefaultCfg() *ConsensusCfg
type DposReader ¶
type DposVerifier ¶
type DposVerifier interface { }
type Event ¶
type Event struct { Gid types.Gid Address types.Address Stime time.Time Etime time.Time Timestamp time.Time // add to block VoteTime time.Time // voteTime PeriodStime time.Time // start time for period PeriodEtime time.Time // end time for period }
Event will trigger when the snapshot block needs production
type Life ¶
type Life interface { Start() Init(cfg *ConsensusCfg) error Stop() }
Life define the life cycle for consensus component
type LinkedArray ¶
type LinkedArray interface { core.TimeIndex GetByIndex(index uint64) (*cdb.Point, error) GetByIndexWithProof(index uint64, proofHash types.Hash) (*cdb.Point, error) }
LinkedArray can read SBP statistics of day, hour, period
type MockChain ¶
type MockChain struct {
// contains filtered or unexported fields
}
MockChain is a mock of Chain interface.
func NewMockChain ¶
func NewMockChain(ctrl *gomock.Controller) *MockChain
NewMockChain creates a new mock instance.
func (*MockChain) EXPECT ¶
func (m *MockChain) EXPECT() *MockChainMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChain) GetAllRegisterList ¶
func (m *MockChain) GetAllRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
GetAllRegisterList mocks base method.
func (*MockChain) GetConfirmedBalanceList ¶
func (m *MockChain) GetConfirmedBalanceList(addrList []types.Address, tokenID types.TokenTypeId, sbHash types.Hash) (map[types.Address]*big.Int, error)
GetConfirmedBalanceList mocks base method.
func (*MockChain) GetConsensusGroupList ¶
func (m *MockChain) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
GetConsensusGroupList mocks base method.
func (*MockChain) GetContractMeta ¶
GetContractMeta mocks base method.
func (*MockChain) GetGenesisSnapshotBlock ¶
func (m *MockChain) GetGenesisSnapshotBlock() *core.SnapshotBlock
GetGenesisSnapshotBlock mocks base method.
func (*MockChain) GetLastUnpublishedSeedSnapshotHeader ¶
func (m *MockChain) GetLastUnpublishedSeedSnapshotHeader(producer types.Address, beforeTime time.Time) (*core.SnapshotBlock, error)
GetLastUnpublishedSeedSnapshotHeader mocks base method.
func (*MockChain) GetLatestSnapshotBlock ¶
func (m *MockChain) GetLatestSnapshotBlock() *core.SnapshotBlock
GetLatestSnapshotBlock mocks base method.
func (*MockChain) GetRandomSeed ¶
GetRandomSeed mocks base method.
func (*MockChain) GetRegisterList ¶
func (m *MockChain) GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
GetRegisterList mocks base method.
func (*MockChain) GetSnapshotBlockByHash ¶
GetSnapshotBlockByHash mocks base method.
func (*MockChain) GetSnapshotBlockByHeight ¶
func (m *MockChain) GetSnapshotBlockByHeight(height uint64) (*core.SnapshotBlock, error)
GetSnapshotBlockByHeight mocks base method.
func (*MockChain) GetSnapshotHeaderBeforeTime ¶
GetSnapshotHeaderBeforeTime mocks base method.
func (*MockChain) GetSnapshotHeadersAfterOrEqualTime ¶
func (m *MockChain) GetSnapshotHeadersAfterOrEqualTime(endHashHeight *core.HashHeight, startTime *time.Time, producer *types.Address) ([]*core.SnapshotBlock, error)
GetSnapshotHeadersAfterOrEqualTime mocks base method.
func (*MockChain) GetVoteList ¶
GetVoteList mocks base method.
func (*MockChain) IsGenesisSnapshotBlock ¶
IsGenesisSnapshotBlock mocks base method.
func (*MockChain) Register ¶
func (m *MockChain) Register(listener interfaces.EventListener)
Register mocks base method.
func (*MockChain) UnRegister ¶
func (m *MockChain) UnRegister(listener interfaces.EventListener)
UnRegister mocks base method.
type MockChainMockRecorder ¶
type MockChainMockRecorder struct {
// contains filtered or unexported fields
}
MockChainMockRecorder is the mock recorder for MockChain.
func (*MockChainMockRecorder) GetAllRegisterList ¶
func (mr *MockChainMockRecorder) GetAllRegisterList(snapshotHash, gid interface{}) *gomock.Call
GetAllRegisterList indicates an expected call of GetAllRegisterList.
func (*MockChainMockRecorder) GetConfirmedBalanceList ¶
func (mr *MockChainMockRecorder) GetConfirmedBalanceList(addrList, tokenID, sbHash interface{}) *gomock.Call
GetConfirmedBalanceList indicates an expected call of GetConfirmedBalanceList.
func (*MockChainMockRecorder) GetConsensusGroupList ¶
func (mr *MockChainMockRecorder) GetConsensusGroupList(snapshotHash interface{}) *gomock.Call
GetConsensusGroupList indicates an expected call of GetConsensusGroupList.
func (*MockChainMockRecorder) GetContractMeta ¶
func (mr *MockChainMockRecorder) GetContractMeta(contractAddress interface{}) *gomock.Call
GetContractMeta indicates an expected call of GetContractMeta.
func (*MockChainMockRecorder) GetGenesisSnapshotBlock ¶
func (mr *MockChainMockRecorder) GetGenesisSnapshotBlock() *gomock.Call
GetGenesisSnapshotBlock indicates an expected call of GetGenesisSnapshotBlock.
func (*MockChainMockRecorder) GetLastUnpublishedSeedSnapshotHeader ¶
func (mr *MockChainMockRecorder) GetLastUnpublishedSeedSnapshotHeader(producer, beforeTime interface{}) *gomock.Call
GetLastUnpublishedSeedSnapshotHeader indicates an expected call of GetLastUnpublishedSeedSnapshotHeader.
func (*MockChainMockRecorder) GetLatestSnapshotBlock ¶
func (mr *MockChainMockRecorder) GetLatestSnapshotBlock() *gomock.Call
GetLatestSnapshotBlock indicates an expected call of GetLatestSnapshotBlock.
func (*MockChainMockRecorder) GetRandomSeed ¶
func (mr *MockChainMockRecorder) GetRandomSeed(snapshotHash, n interface{}) *gomock.Call
GetRandomSeed indicates an expected call of GetRandomSeed.
func (*MockChainMockRecorder) GetRegisterList ¶
func (mr *MockChainMockRecorder) GetRegisterList(snapshotHash, gid interface{}) *gomock.Call
GetRegisterList indicates an expected call of GetRegisterList.
func (*MockChainMockRecorder) GetSnapshotBlockByHash ¶
func (mr *MockChainMockRecorder) GetSnapshotBlockByHash(hash interface{}) *gomock.Call
GetSnapshotBlockByHash indicates an expected call of GetSnapshotBlockByHash.
func (*MockChainMockRecorder) GetSnapshotBlockByHeight ¶
func (mr *MockChainMockRecorder) GetSnapshotBlockByHeight(height interface{}) *gomock.Call
GetSnapshotBlockByHeight indicates an expected call of GetSnapshotBlockByHeight.
func (*MockChainMockRecorder) GetSnapshotHeaderBeforeTime ¶
func (mr *MockChainMockRecorder) GetSnapshotHeaderBeforeTime(timestamp interface{}) *gomock.Call
GetSnapshotHeaderBeforeTime indicates an expected call of GetSnapshotHeaderBeforeTime.
func (*MockChainMockRecorder) GetSnapshotHeadersAfterOrEqualTime ¶
func (mr *MockChainMockRecorder) GetSnapshotHeadersAfterOrEqualTime(endHashHeight, startTime, producer interface{}) *gomock.Call
GetSnapshotHeadersAfterOrEqualTime indicates an expected call of GetSnapshotHeadersAfterOrEqualTime.
func (*MockChainMockRecorder) GetVoteList ¶
func (mr *MockChainMockRecorder) GetVoteList(snapshotHash, gid interface{}) *gomock.Call
GetVoteList indicates an expected call of GetVoteList.
func (*MockChainMockRecorder) IsGenesisSnapshotBlock ¶
func (mr *MockChainMockRecorder) IsGenesisSnapshotBlock(hash interface{}) *gomock.Call
IsGenesisSnapshotBlock indicates an expected call of IsGenesisSnapshotBlock.
func (*MockChainMockRecorder) NewDb ¶
func (mr *MockChainMockRecorder) NewDb(dbDir interface{}) *gomock.Call
NewDb indicates an expected call of NewDb.
func (*MockChainMockRecorder) Register ¶
func (mr *MockChainMockRecorder) Register(listener interface{}) *gomock.Call
Register indicates an expected call of Register.
func (*MockChainMockRecorder) UnRegister ¶
func (mr *MockChainMockRecorder) UnRegister(listener interface{}) *gomock.Call
UnRegister indicates an expected call of UnRegister.
type MockDposReader ¶
type MockDposReader struct {
// contains filtered or unexported fields
}
MockDposReader is a mock of DposReader interface
func NewMockDposReader ¶
func NewMockDposReader(ctrl *gomock.Controller) *MockDposReader
NewMockDposReader creates a new mock instance
func (*MockDposReader) EXPECT ¶
func (m *MockDposReader) EXPECT() *MockDposReaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockDposReader) ElectionIndex ¶
func (m *MockDposReader) ElectionIndex(arg0 uint64) (*electionResult, error)
ElectionIndex mocks base method
func (*MockDposReader) GenVoteTime ¶
func (m *MockDposReader) GenVoteTime(arg0 uint64) time.Time
GenProofTime mocks base method
func (*MockDposReader) GetInfo ¶
func (m *MockDposReader) GetInfo() *core.GroupInfo
GetInfo mocks base method
func (*MockDposReader) Index2Time ¶
Index2Time mocks base method
func (*MockDposReader) Time2Index ¶
func (m *MockDposReader) Time2Index(arg0 time.Time) uint64
Time2Index mocks base method
func (*MockDposReader) VerifyProducer ¶
VerifyProducer mocks base method
type MockDposReaderMockRecorder ¶
type MockDposReaderMockRecorder struct {
// contains filtered or unexported fields
}
MockDposReaderMockRecorder is the mock recorder for MockDposReader
func (*MockDposReaderMockRecorder) ElectionIndex ¶
func (mr *MockDposReaderMockRecorder) ElectionIndex(arg0 interface{}) *gomock.Call
ElectionIndex indicates an expected call of ElectionIndex
func (*MockDposReaderMockRecorder) GenVoteTime ¶
func (mr *MockDposReaderMockRecorder) GenVoteTime(arg0 interface{}) *gomock.Call
GenProofTime indicates an expected call of GenProofTime
func (*MockDposReaderMockRecorder) GetInfo ¶
func (mr *MockDposReaderMockRecorder) GetInfo() *gomock.Call
GetInfo indicates an expected call of GetInfo
func (*MockDposReaderMockRecorder) Index2Time ¶
func (mr *MockDposReaderMockRecorder) Index2Time(arg0 interface{}) *gomock.Call
Index2Time indicates an expected call of Index2Time
func (*MockDposReaderMockRecorder) Time2Index ¶
func (mr *MockDposReaderMockRecorder) Time2Index(arg0 interface{}) *gomock.Call
Time2Index indicates an expected call of Time2Index
func (*MockDposReaderMockRecorder) VerifyProducer ¶
func (mr *MockDposReaderMockRecorder) VerifyProducer(arg0, arg1 interface{}) *gomock.Call
VerifyProducer indicates an expected call of VerifyProducer
type MockLinkedArray ¶
type MockLinkedArray struct {
// contains filtered or unexported fields
}
MockLinkedArray is a mock of LinkedArray interface
func NewMockLinkedArray ¶
func NewMockLinkedArray(ctrl *gomock.Controller) *MockLinkedArray
NewMockLinkedArray creates a new mock instance
func (*MockLinkedArray) EXPECT ¶
func (m *MockLinkedArray) EXPECT() *MockLinkedArrayMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockLinkedArray) GetByIndex ¶
func (m *MockLinkedArray) GetByIndex(arg0 uint64) (*cdb.Point, error)
GetByIndex mocks base method
func (*MockLinkedArray) GetByIndexWithProof ¶
GetByIndexWithProof mocks base method
func (*MockLinkedArray) Index2Time ¶
Index2Time mocks base method
func (*MockLinkedArray) Time2Index ¶
func (m *MockLinkedArray) Time2Index(arg0 time.Time) uint64
Time2Index mocks base method
type MockLinkedArrayMockRecorder ¶
type MockLinkedArrayMockRecorder struct {
// contains filtered or unexported fields
}
MockLinkedArrayMockRecorder is the mock recorder for MockLinkedArray
func (*MockLinkedArrayMockRecorder) GetByIndex ¶
func (mr *MockLinkedArrayMockRecorder) GetByIndex(arg0 interface{}) *gomock.Call
GetByIndex indicates an expected call of GetByIndex
func (*MockLinkedArrayMockRecorder) GetByIndexWithProof ¶
func (mr *MockLinkedArrayMockRecorder) GetByIndexWithProof(arg0, arg1 interface{}) *gomock.Call
GetByIndexWithProof indicates an expected call of GetByIndexWithProof
func (*MockLinkedArrayMockRecorder) Index2Time ¶
func (mr *MockLinkedArrayMockRecorder) Index2Time(arg0 interface{}) *gomock.Call
Index2Time indicates an expected call of Index2Time
func (*MockLinkedArrayMockRecorder) Time2Index ¶
func (mr *MockLinkedArrayMockRecorder) Time2Index(arg0 interface{}) *gomock.Call
Time2Index indicates an expected call of Time2Index
type MockRollbackProof ¶
type MockRollbackProof struct {
// contains filtered or unexported fields
}
MockRollbackProof is a mock of RollbackProof interface
func NewMockRollbackProof ¶
func NewMockRollbackProof(ctrl *gomock.Controller) *MockRollbackProof
NewMockRollbackProof creates a new mock instance
func (*MockRollbackProof) EXPECT ¶
func (m *MockRollbackProof) EXPECT() *MockRollbackProofMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockRollbackProof) Proof ¶
func (m *MockRollbackProof) Proof(arg0 types.Hash, arg1 time.Time) (*ledger.SnapshotBlock, error)
Proof mocks base method
func (*MockRollbackProof) ProofEmpty ¶
func (m *MockRollbackProof) ProofEmpty(arg0, arg1 time.Time) (bool, error)
ProofEmpty mocks base method
type MockRollbackProofMockRecorder ¶
type MockRollbackProofMockRecorder struct {
// contains filtered or unexported fields
}
MockRollbackProofMockRecorder is the mock recorder for MockRollbackProof
func (*MockRollbackProofMockRecorder) Proof ¶
func (mr *MockRollbackProofMockRecorder) Proof(arg0, arg1 interface{}) *gomock.Call
Proof indicates an expected call of Proof
func (*MockRollbackProofMockRecorder) ProofEmpty ¶
func (mr *MockRollbackProofMockRecorder) ProofEmpty(arg0, arg1 interface{}) *gomock.Call
ProofEmpty indicates an expected call of ProofEmpty
func (*MockRollbackProofMockRecorder) ProofHash ¶
func (mr *MockRollbackProofMockRecorder) ProofHash(arg0 interface{}) *gomock.Call
ProofHash indicates an expected call of ProofHash
type ProducersEvent ¶
ProducersEvent describes all SBP in one period
type Reader ¶
type Reader interface { ReadByIndex(gid types.Gid, index uint64) ([]*Event, uint64, error) VoteTimeToIndex(gid types.Gid, t2 time.Time) (uint64, error) VoteIndexToTime(gid types.Gid, i uint64) (*time.Time, *time.Time, error) }
Reader can read consensus result
type RollbackProof ¶
type Subscriber ¶
type Subscriber interface { Subscribe(gid types.Gid, id string, addr *types.Address, fn func(Event)) UnSubscribe(gid types.Gid, id string) SubscribeProducers(gid types.Gid, id string, fn func(event ProducersEvent)) TriggerMineEvent(addr types.Address) error }
Subscriber provide an interface to consensus event
Source Files ¶
- api.go
- chain_rw.go
- config.go
- consensus.go
- consensus_contract.go
- consensus_contract_dpos.go
- consensus_event.go
- consensus_impl.go
- consensus_point_array.go
- consensus_simple.go
- consensus_snapshot.go
- consensus_verifier.go
- dpos.go
- mock_ch.go
- mock_dposReader.go
- mock_linkedArray.go
- mock_rollback_proof.go
- result.go
- rollback_proof.go
- snapshot_listener.go
- subscriber.go
- trigger.go