Documentation ¶
Index ¶
- Variables
- func QuadraticWeightFunc(consensusPower sdkmath.Uint) sdkmath.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 ¶
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 ¶
func NewParticipant(address sdk.ValAddress, weight sdk.Uint) Participant
NewParticipant is the constructor of Participant
func (*Participant) Descriptor ¶
func (*Participant) Descriptor() ([]byte, []int)
func (Participant) GetAddress ¶
func (m Participant) GetAddress() sdk.ValAddress
GetAddress returns the address of the participant
func (*Participant) Marshal ¶
func (m *Participant) Marshal() (dAtA []byte, err error)
func (*Participant) MarshalToSizedBuffer ¶
func (m *Participant) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Participant) ProtoMessage ¶
func (*Participant) ProtoMessage()
func (*Participant) Reset ¶
func (m *Participant) Reset()
func (*Participant) Size ¶
func (m *Participant) Size() (n int)
func (*Participant) String ¶
func (m *Participant) String() string
func (*Participant) Unmarshal ¶
func (m *Participant) Unmarshal(dAtA []byte) error
func (Participant) ValidateBasic ¶
func (m Participant) ValidateBasic() error
ValidateBasic returns an error if the given participant is invalid; nil otherwise
func (*Participant) XXX_DiscardUnknown ¶
func (m *Participant) XXX_DiscardUnknown()
func (*Participant) XXX_Marshal ¶
func (m *Participant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Participant) XXX_Merge ¶
func (m *Participant) XXX_Merge(src proto.Message)
func (*Participant) XXX_Size ¶
func (m *Participant) XXX_Size() int
func (*Participant) XXX_Unmarshal ¶
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 ¶
func NewSnapshot(timestamp time.Time, height int64, participants []Participant, bondedWeight sdkmath.Uint) Snapshot
NewSnapshot is the constructor of Snapshot
func (Snapshot) CalculateMinPassingWeight ¶
CalculateMinPassingWeight returns the minimum amount of weights to pass the given threshold
func (*Snapshot) Descriptor ¶
func (Snapshot) GetParticipantAddresses ¶
func (m Snapshot) GetParticipantAddresses() []sdk.ValAddress
GetParticipantAddresses returns the addresses of all participants in the snapshot
func (Snapshot) GetParticipantWeight ¶
func (m Snapshot) GetParticipantWeight(participant sdk.ValAddress) sdk.Uint
GetParticipantWeight returns the weight of the given participant
func (Snapshot) GetParticipantsWeight ¶
GetParticipantsWeight returns the sum of all participants' weights
func (*Snapshot) MarshalToSizedBuffer ¶
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (Snapshot) ValidateBasic ¶
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 ¶
type ValidatorI interface { GetConsensusPower(sdkmath.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