Documentation
¶
Index ¶
- func NewConsensus(genesisTime time.Time, ch ch) *committee
- type ByBalance
- type Consensus
- type Event
- type Life
- type MockConsensus
- func (*MockConsensus) Subscribe(gid types.Gid, id string, addr *types.Address, fn func(Event))
- func (*MockConsensus) SubscribeProducers(gid types.Gid, id string, fn func(event ProducersEvent))
- func (*MockConsensus) UnSubscribe(gid types.Gid, id string)
- func (*MockConsensus) UnSubscribeProducers(gid types.Gid, id string)
- func (*MockConsensus) VerifyAccountProducer(block *ledger.AccountBlock) (bool, error)
- func (*MockConsensus) VerifySnapshotProducer(block *ledger.SnapshotBlock) (bool, error)
- type ProducersEvent
- type Reader
- type Subscriber
- type Verifier
- type VoteDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConsensus ¶
Types ¶
type ByBalance ¶
type ByBalance []*VoteDetails
type MockConsensus ¶
type MockConsensus struct {
}
func (*MockConsensus) SubscribeProducers ¶ added in v1.2.0
func (*MockConsensus) SubscribeProducers(gid types.Gid, id string, fn func(event ProducersEvent))
func (*MockConsensus) UnSubscribe ¶
func (*MockConsensus) UnSubscribe(gid types.Gid, id string)
func (*MockConsensus) UnSubscribeProducers ¶ added in v1.2.0
func (*MockConsensus) UnSubscribeProducers(gid types.Gid, id string)
func (*MockConsensus) VerifyAccountProducer ¶
func (*MockConsensus) VerifyAccountProducer(block *ledger.AccountBlock) (bool, error)
func (*MockConsensus) VerifySnapshotProducer ¶
func (*MockConsensus) VerifySnapshotProducer(block *ledger.SnapshotBlock) (bool, error)
type ProducersEvent ¶ added in v1.2.0
type Reader ¶
type Reader interface {
ReadByIndex(gid types.Gid, index uint64) ([]*Event, uint64, error)
ReadByTime(gid types.Gid, t time.Time) ([]*Event, uint64, error)
ReadVoteMapByTime(gid types.Gid, index uint64) ([]*VoteDetails, *ledger.HashHeight, error)
ReadVoteMapForAPI(gid types.Gid, t time.Time) ([]*VoteDetails, *ledger.HashHeight, error)
VoteTimeToIndex(gid types.Gid, t2 time.Time) (uint64, error)
VoteIndexToTime(gid types.Gid, i uint64) (*time.Time, *time.Time, error)
}
type Subscriber ¶
type Verifier ¶
type Verifier interface {
VerifyAccountProducer(block *ledger.AccountBlock) (bool, error)
VerifySnapshotProducer(block *ledger.SnapshotBlock) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.