Documentation
¶
Index ¶
- Variables
- func GetChainID(r *types.Replica) (string, error)
- func GetPrivKey(r *types.Replica) (crypto.PrivKey, error)
- func GetProposalBlockID(msg *TMessage) (*ttypes.BlockID, bool)
- func GetProposalBlockIDS(msg *TMessage) (string, bool)
- func GetReplicaAddress(r *types.Replica) ([]byte, error)
- func GetVoteBlockID(msg *TMessage) (*ttypes.BlockID, bool)
- func GetVoteBlockIDS(msg *TMessage) (string, bool)
- func GetVoteTime(msg *TMessage) (time.Time, bool)
- func GetVoteValidator(msg *TMessage) ([]byte, bool)
- func IsVoteFrom(msg *TMessage, replica *types.Replica) bool
- type GenericPartitioner
- type MessageType
- type Part
- type Partition
- type ReplicaSet
- func (r *ReplicaSet) Add(replica *types.Replica) error
- func (r *ReplicaSet) Exists(id types.ReplicaID) bool
- func (r *ReplicaSet) ExistsVal(addr []byte) bool
- func (r *ReplicaSet) GetRandom() *types.Replica
- func (r *ReplicaSet) Iter() []types.ReplicaID
- func (r *ReplicaSet) Size() int
- func (rs *ReplicaSet) String() string
- type TMessage
- func ChangeProposalBlockIDToNil(replica *types.Replica, pMsg *TMessage) (*TMessage, error)
- func ChangeProposalLockedValue(replica *types.Replica, pMsg *TMessage) (*TMessage, error)
- func ChangeVote(replica *types.Replica, tMsg *TMessage, blockID *ttypes.BlockID) (*TMessage, error)
- func ChangeVoteRound(replica *types.Replica, tMsg *TMessage, round int32) (*TMessage, error)
- func ChangeVoteTime(replica *types.Replica, tMsg *TMessage, add time.Duration) (*TMessage, error)
- func ChangeVoteToNil(replica *types.Replica, voteMsg *TMessage) (*TMessage, error)
- func GetMessageFromEvent(e *types.Event, ctx *sm.Context) (*TMessage, bool)
- func GetParsedMessage(m *types.Message) (*TMessage, bool)
- type TMessageParser
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidVote = errors.New("invalid message type to change vote")
)
Functions ¶
func GetPrivKey ¶
Should cache key instead of decoding everytime
func GetProposalBlockIDS ¶
func GetVoteBlockIDS ¶
func GetVoteValidator ¶
Types ¶
type GenericPartitioner ¶
type GenericPartitioner struct {
// contains filtered or unexported fields
}
func NewGenericPartitioner ¶
func NewGenericPartitioner(replicasStore *types.ReplicaStore) *GenericPartitioner
func (*GenericPartitioner) CreatePartition ¶
func (g *GenericPartitioner) CreatePartition(sizes []int, labels []string) (*Partition, error)
type MessageType ¶
type MessageType string
const ( NewRoundStep MessageType = "NewRoundStep" NewValidBlock MessageType = "NewValidBlock" Proposal MessageType = "Proposal" ProposalPol MessageType = "ProposalPol" BlockPart MessageType = "BlockPart" Vote MessageType = "Vote" Prevote MessageType = "Prevote" Precommit MessageType = "Precommit" HasVote MessageType = "HasVote" VoteSetMaj23 MessageType = "VoteSetMaj23" VoteSetBits MessageType = "VoteSetBits" None MessageType = "None" )
type Partition ¶
func NewPartition ¶
type ReplicaSet ¶
type ReplicaSet struct {
// contains filtered or unexported fields
}
func NewReplicaSet ¶
func NewReplicaSet() *ReplicaSet
func (*ReplicaSet) ExistsVal ¶
func (r *ReplicaSet) ExistsVal(addr []byte) bool
func (*ReplicaSet) GetRandom ¶
func (r *ReplicaSet) GetRandom() *types.Replica
func (*ReplicaSet) Iter ¶
func (r *ReplicaSet) Iter() []types.ReplicaID
func (*ReplicaSet) Size ¶
func (r *ReplicaSet) Size() int
func (*ReplicaSet) String ¶
func (rs *ReplicaSet) String() string
type TMessage ¶
type TMessage struct { MsgB []byte `json:"msg"` Type MessageType `json:"-"` Data *tmsg.Message `json:"-"` }
func ChangeVote ¶
func ChangeVoteRound ¶
func ChangeVoteTime ¶
func ChangeVoteToNil ¶
func GetMessageFromEvent ¶
func (*TMessage) Clone ¶
func (t *TMessage) Clone() types.ParsedMessage
func (*TMessage) HeightRound ¶
type TMessageParser ¶
type TMessageParser struct { }
func (*TMessageParser) Parse ¶
func (p *TMessageParser) Parse(m []byte) (types.ParsedMessage, error)
Click to show internal directories.
Click to hide internal directories.