Documentation ¶
Index ¶
- Variables
- type SDKValidator
- type Slasher
- type Snapshot
- func (*Snapshot) Descriptor() ([]byte, []int)
- func (m Snapshot) GetSuccinctJSON() ([]byte, error)
- func (m Snapshot) GetValidator(address sdk.ValAddress) (Validator, bool)
- 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) UnpackInterfaces(unpacker codectypes.AnyUnpacker) 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 Snapshotter
- type Tss
- type Validator
- func (*Validator) Descriptor() ([]byte, []int)
- func (m Validator) GetSDKValidator() SDKValidator
- func (m *Validator) Marshal() (dAtA []byte, err error)
- func (m *Validator) MarshalTo(dAtA []byte) (int, error)
- func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Validator) ProtoMessage()
- func (m *Validator) Reset()
- func (m *Validator) Size() (n int)
- func (m *Validator) String() string
- func (m *Validator) Unmarshal(dAtA []byte) error
- func (m Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
- func (m *Validator) XXX_DiscardUnknown()
- func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Validator) XXX_Merge(src proto.Message)
- func (m *Validator) XXX_Size() int
- func (m *Validator) XXX_Unmarshal(b []byte) error
- type ValidatorIllegibility
- func (ValidatorIllegibility) EnumDescriptor() ([]byte, []int)
- func (v ValidatorIllegibility) FilterIllegibilityForNewKey() ValidatorIllegibility
- func (v ValidatorIllegibility) FilterIllegibilityForSigning() ValidatorIllegibility
- func (v ValidatorIllegibility) Is(illegibility ValidatorIllegibility) bool
- func (v ValidatorIllegibility) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var ValidatorIllegibility_name = map[int32]string{
0: "VALIDATOR_ILLEGIBILITY_UNSPECIFIED",
1: "VALIDATOR_ILLEGIBILITY_TOMBSTONED",
2: "VALIDATOR_ILLEGIBILITY_JAILED",
4: "VALIDATOR_ILLEGIBILITY_MISSED_TOO_MANY_BLOCKS",
8: "VALIDATOR_ILLEGIBILITY_NO_PROXY_REGISTERED",
16: "VALIDATOR_ILLEGIBILITY_TSS_SUSPENDED",
32: "VALIDATOR_ILLEGIBILITY_PROXY_INSUFICIENT_FUNDS",
}
var ValidatorIllegibility_value = map[string]int32{
"VALIDATOR_ILLEGIBILITY_UNSPECIFIED": 0,
"VALIDATOR_ILLEGIBILITY_TOMBSTONED": 1,
"VALIDATOR_ILLEGIBILITY_JAILED": 2,
"VALIDATOR_ILLEGIBILITY_MISSED_TOO_MANY_BLOCKS": 4,
"VALIDATOR_ILLEGIBILITY_NO_PROXY_REGISTERED": 8,
"VALIDATOR_ILLEGIBILITY_TSS_SUSPENDED": 16,
"VALIDATOR_ILLEGIBILITY_PROXY_INSUFICIENT_FUNDS": 32,
}
Functions ¶
This section is empty.
Types ¶
type SDKValidator ¶
type SDKValidator interface { proto.Message codectypes.UnpackInterfacesMessage GetOperator() sdk.ValAddress GetConsAddr() (sdk.ConsAddress, error) GetConsensusPower(sdk.Int) int64 IsJailed() bool }
SDKValidator is an interface for a Cosmos validator account
type Slasher ¶
type Slasher interface { GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress) (info slashingtypes.ValidatorSigningInfo, found bool) SignedBlocksWindow(ctx sdk.Context) (res int64) }
Slasher provides functionality to manage slashing info for a validator
type Snapshot ¶
type Snapshot struct { Validators []Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` 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"` Counter int64 `protobuf:"varint,5,opt,name=counter,proto3" json:"counter,omitempty"` CorruptionThreshold int64 `protobuf:"varint,7,opt,name=corruption_threshold,json=corruptionThreshold,proto3" json:"corruption_threshold,omitempty"` }
func (*Snapshot) Descriptor ¶
func (Snapshot) GetSuccinctJSON ¶
GetSuccinctJSON marshals the snapshot as JSON without including the SDKValidator data
func (Snapshot) GetValidator ¶
func (m Snapshot) GetValidator(address sdk.ValAddress) (Validator, bool)
GetValidator returns the validator for a given address, if it is part of the snapshot
func (*Snapshot) MarshalToSizedBuffer ¶
func (*Snapshot) ProtoMessage ¶
func (*Snapshot) ProtoMessage()
func (Snapshot) UnpackInterfaces ¶
func (m Snapshot) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage
func (*Snapshot) XXX_DiscardUnknown ¶
func (m *Snapshot) XXX_DiscardUnknown()
func (*Snapshot) XXX_Marshal ¶
func (*Snapshot) XXX_Unmarshal ¶
type Snapshotter ¶
type Snapshotter interface { GetLatestSnapshot(ctx sdk.Context) (Snapshot, bool) GetLatestCounter(ctx sdk.Context) int64 GetSnapshot(ctx sdk.Context, seqNo int64) (Snapshot, bool) TakeSnapshot(ctx sdk.Context, keyRequirement tss.KeyRequirement) (Snapshot, error) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress GetProxy(ctx sdk.Context, principal sdk.ValAddress) (addr sdk.AccAddress, active bool) GetValidatorIllegibility(ctx sdk.Context, validator SDKValidator) (ValidatorIllegibility, error) }
Snapshotter represents the interface for the snapshot module's functionality
type Tss ¶
type Tss interface { GetTssSuspendedUntil(ctx sdk.Context, validator sdk.ValAddress) int64 GetNextKey(ctx sdk.Context, chain nexus.Chain, keyRole tss.KeyRole) (tss.Key, bool) IsOperatorAvailable(ctx sdk.Context, validator sdk.ValAddress, keyIDs ...tss.KeyID) bool GetMaxMissedBlocksPerWindow(ctx sdk.Context) utils.Threshold GetKeyRequirement(ctx sdk.Context, keyRole tss.KeyRole, keyType tss.KeyType) (tss.KeyRequirement, bool) }
Tss provides functionality to tss module
type Validator ¶
type Validator struct { SDKValidator *types.Any `protobuf:"bytes,1,opt,name=sdk_validator,json=sdkValidator,proto3" json:"sdk_validator,omitempty"` }
func NewValidator ¶
func NewValidator(validator SDKValidator, shareCount int64) Validator
NewValidator is the constructor for Validator
func (*Validator) Descriptor ¶
func (Validator) GetSDKValidator ¶
func (m Validator) GetSDKValidator() SDKValidator
GetSDKValidator returns the SdkValidator
func (*Validator) MarshalToSizedBuffer ¶
func (*Validator) ProtoMessage ¶
func (*Validator) ProtoMessage()
func (Validator) UnpackInterfaces ¶
func (m Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error
UnpackInterfaces implements UnpackInterfacesMessage
func (*Validator) XXX_DiscardUnknown ¶
func (m *Validator) XXX_DiscardUnknown()
func (*Validator) XXX_Marshal ¶
func (*Validator) XXX_Unmarshal ¶
type ValidatorIllegibility ¶
type ValidatorIllegibility int32
const ( // these enum values are used for bitwise operations, therefore they need to // be powers of 2 None ValidatorIllegibility = 0 Tombstoned ValidatorIllegibility = 1 Jailed ValidatorIllegibility = 2 MissedTooManyBlocks ValidatorIllegibility = 4 NoProxyRegistered ValidatorIllegibility = 8 TssSuspended ValidatorIllegibility = 16 ProxyInsuficientFunds ValidatorIllegibility = 32 )
func GetValidatorIllegibilities ¶
func GetValidatorIllegibilities() []ValidatorIllegibility
GetValidatorIllegibilities returns all validator illegibilities
func (ValidatorIllegibility) EnumDescriptor ¶
func (ValidatorIllegibility) EnumDescriptor() ([]byte, []int)
func (ValidatorIllegibility) FilterIllegibilityForNewKey ¶
func (v ValidatorIllegibility) FilterIllegibilityForNewKey() ValidatorIllegibility
FilterIllegibilityForNewKey filters the illegibility to only leave those ones related to handling of new key
func (ValidatorIllegibility) FilterIllegibilityForSigning ¶
func (v ValidatorIllegibility) FilterIllegibilityForSigning() ValidatorIllegibility
FilterIllegibilityForSigning filters the illegibility to only leave those ones related to handling of signing
func (ValidatorIllegibility) Is ¶
func (v ValidatorIllegibility) Is(illegibility ValidatorIllegibility) bool
Is returns true if the illegibility contains the given one; false otherwise
func (ValidatorIllegibility) String ¶
func (v ValidatorIllegibility) String() string
String returns a comma-separated string representation of illegibility