Documentation ¶
Index ¶
- Variables
- func QuadraticWeightFunc(consensusPower sdk.Uint) sdk.Uint
- type Participant
- func (*Participant) Descriptor() ([]byte, []int)
- func (m Participant) GetAddress() sdk.ValAddress
- func (m *Participant) Marshal() (dAtA []byte, err error)
- func (m *Participant) MarshalTo(dAtA []byte) (int, error)
- func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Participant) ProtoMessage()
- func (m *Participant) Reset()
- func (m *Participant) Size() (n int)
- func (m *Participant) String() string
- func (m *Participant) Unmarshal(dAtA []byte) error
- func (m Participant) ValidateBasic() error
- func (m *Participant) XXX_DiscardUnknown()
- func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Participant) XXX_Merge(src proto.Message)
- func (m *Participant) XXX_Size() int
- func (m *Participant) XXX_Unmarshal(b []byte) error
- type Snapshot
- func (m Snapshot) CalculateMinPassingWeight(threshold utils.Threshold) sdk.Uint
- func (*Snapshot) Descriptor() ([]byte, []int)
- func (m Snapshot) GetParticipantAddresses() []sdk.ValAddress
- func (m Snapshot) GetParticipantWeight(participant sdk.ValAddress) sdk.Uint
- func (m Snapshot) GetParticipantsWeight() sdk.Uint
- func (m *Snapshot) Marshal() (dAtA []byte, err error)
- func (m *Snapshot) MarshalTo(dAtA []byte) (int, error)
- func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Snapshot) ProtoMessage()
- func (m *Snapshot) Reset()
- func (m *Snapshot) Size() (n int)
- func (m *Snapshot) String() string
- func (m *Snapshot) Unmarshal(dAtA []byte) error
- func (m Snapshot) ValidateBasic() error
- func (m *Snapshot) XXX_DiscardUnknown()
- func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Snapshot) XXX_Merge(src proto.Message)
- func (m *Snapshot) XXX_Size() int
- func (m *Snapshot) XXX_Unmarshal(b []byte) error
- type ValidatorI
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Participant ¶ added in v0.21.0
type Participant struct { Address github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"address,omitempty"` Weight github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"weight"` }
func NewParticipant ¶ added in v0.21.0
func NewParticipant(address sdk.ValAddress, weight sdk.Uint) Participant
NewParticipant is the constructor of Participant
func (*Participant) Descriptor ¶ added in v0.21.0
func (*Participant) Descriptor() ([]byte, []int)
func (Participant) GetAddress ¶ added in v0.21.0
func (m Participant) GetAddress() sdk.ValAddress
GetAddress returns the address of the participant
func (*Participant) Marshal ¶ added in v0.21.0
func (m *Participant) Marshal() (dAtA []byte, err error)
func (*Participant) MarshalTo ¶ added in v0.21.0
func (m *Participant) MarshalTo(dAtA []byte) (int, error)
func (*Participant) MarshalToSizedBuffer ¶ added in v0.21.0
func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Participant) ProtoMessage ¶ added in v0.21.0
func (*Participant) ProtoMessage()
func (*Participant) Reset ¶ added in v0.21.0
func (m *Participant) Reset()
func (*Participant) Size ¶ added in v0.21.0
func (m *Participant) Size() (n int)
func (*Participant) String ¶ added in v0.21.0
func (m *Participant) String() string
func (*Participant) Unmarshal ¶ added in v0.21.0
func (m *Participant) Unmarshal(dAtA []byte) error
func (Participant) ValidateBasic ¶ added in v0.21.0
func (m Participant) ValidateBasic() error
ValidateBasic returns an error if the given participant is invalid; nil otherwise
func (*Participant) XXX_DiscardUnknown ¶ added in v0.21.0
func (m *Participant) XXX_DiscardUnknown()
func (*Participant) XXX_Marshal ¶ added in v0.21.0
func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Participant) XXX_Merge ¶ added in v0.21.0
func (m *Participant) XXX_Merge(src proto.Message)
func (*Participant) XXX_Size ¶ added in v0.21.0
func (m *Participant) XXX_Size() int
func (*Participant) XXX_Unmarshal ¶ added in v0.21.0
func (m *Participant) XXX_Unmarshal(b []byte) error
type Snapshot ¶
type Snapshot struct { Timestamp time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp"` Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Participants map[string]Participant `` /* 155-byte string literal not displayed */ BondedWeight github_com_cosmos_cosmos_sdk_types.Uint `` /* 138-byte string literal not displayed */ }
func NewSnapshot ¶ added in v0.9.0
func NewSnapshot(timestamp time.Time, height int64, participants []Participant, bondedWeight sdk.Uint) Snapshot
NewSnapshot is the constructor of Snapshot
func (Snapshot) CalculateMinPassingWeight ¶ added in v0.21.0
CalculateMinPassingWeight returns the minimum amount of weights to pass the given threshold
func (*Snapshot) Descriptor ¶
func (Snapshot) GetParticipantAddresses ¶ added in v0.21.0
func (m Snapshot) GetParticipantAddresses() []sdk.ValAddress
GetParticipantAddresses returns the addresses of all participants in the snapshot
func (Snapshot) GetParticipantWeight ¶ added in v0.21.0
func (m Snapshot) GetParticipantWeight(participant sdk.ValAddress) sdk.Uint
GetParticipantWeight returns the weight of the given participant
func (Snapshot) GetParticipantsWeight ¶ added in v0.21.0
GetParticipantsWeight returns the sum of all participants' weights
func (*Snapshot) MarshalToSizedBuffer ¶
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (Snapshot) ValidateBasic ¶ added in v0.21.0
ValidateBasic returns an error if the given snapshot is invalid; nil otherwise
func (*Snapshot) XXX_DiscardUnknown ¶
func (m *Snapshot) XXX_DiscardUnknown()
func (*Snapshot) XXX_Marshal ¶
func (*Snapshot) XXX_Unmarshal ¶
type ValidatorI ¶ added in v0.21.0
type ValidatorI interface { GetConsensusPower(sdk.Int) int64 // validation power in tendermint GetOperator() sdk.ValAddress // operator address to receive/return validators coins GetConsAddr() (sdk.ConsAddress, error) // validation consensus address IsJailed() bool // whether the validator is jailed IsBonded() bool // whether the validator is bonded }
ValidatorI provides necessary functions to the validator information