Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgServer
- type MsgSlashValidator
- func (*MsgSlashValidator) Descriptor() ([]byte, []int)
- func (m *MsgSlashValidator) GetAuthority() string
- func (m *MsgSlashValidator) GetInfractionHeight() uint32
- func (m *MsgSlashValidator) GetValidatorAddress() string
- func (m *MsgSlashValidator) Marshal() (dAtA []byte, err error)
- func (m *MsgSlashValidator) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSlashValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSlashValidator) ProtoMessage()
- func (m *MsgSlashValidator) Reset()
- func (m *MsgSlashValidator) Size() (n int)
- func (m *MsgSlashValidator) String() string
- func (m *MsgSlashValidator) Unmarshal(dAtA []byte) error
- func (msg *MsgSlashValidator) ValidateBasic() error
- func (m *MsgSlashValidator) XXX_DiscardUnknown()
- func (m *MsgSlashValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSlashValidator) XXX_Merge(src proto.Message)
- func (m *MsgSlashValidator) XXX_Size() int
- func (m *MsgSlashValidator) XXX_Unmarshal(b []byte) error
- type MsgSlashValidatorResponse
- func (*MsgSlashValidatorResponse) Descriptor() ([]byte, []int)
- func (m *MsgSlashValidatorResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgSlashValidatorResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgSlashValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgSlashValidatorResponse) ProtoMessage()
- func (m *MsgSlashValidatorResponse) Reset()
- func (m *MsgSlashValidatorResponse) Size() (n int)
- func (m *MsgSlashValidatorResponse) String() string
- func (m *MsgSlashValidatorResponse) Unmarshal(dAtA []byte) error
- func (m *MsgSlashValidatorResponse) XXX_DiscardUnknown()
- func (m *MsgSlashValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgSlashValidatorResponse) XXX_Merge(src proto.Message)
- func (m *MsgSlashValidatorResponse) XXX_Size() int
- func (m *MsgSlashValidatorResponse) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type StakingKeeper
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( // ModuleName defines the module name ModuleName = "govplus" // StoreKey defines the primary module store key // This is not govplus because then StoreKey gov (from x/gov) would be a prefix of it, // and that is not allowed. StoreKey = "klyragovplus" )
Module name and store keys
Variables ¶
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )
var ( ErrValidatorAddress = errorsmod.Register( ModuleName, 400, "Could not convert validator consensus address from bech32", ) ErrInvalidAuthority = errorsmod.Register( ModuleName, 401, "Authority is invalid", ) ErrInvalidSlashFactor = errorsmod.Register( ModuleName, 402, "slash_factor must be between 0 and 1 inclusive", ) ErrInvalidTokensAtInfractionHeight = errorsmod.Register( ModuleName, 403, "tokens_at_infraction_height must be positive", ) )
Functions ¶
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgServer ¶
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type GenesisState ¶
type GenesisState struct { }
GenesisState defines the govplus module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { // SlashValidator is exposed to allow slashing of a misbehaving validator via // governance. SlashValidator(ctx context.Context, in *MsgSlashValidator, opts ...grpc.CallOption) (*MsgSlashValidatorResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgServer ¶
type MsgServer interface { // SlashValidator is exposed to allow slashing of a misbehaving validator via // governance. SlashValidator(context.Context, *MsgSlashValidator) (*MsgSlashValidatorResponse, error) }
MsgServer is the server API for Msg service.
type MsgSlashValidator ¶
type MsgSlashValidator struct { Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // Consensus address of the validator to slash ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // Colloquially, the height at which the validator is deemed to have // misbehaved. In practice, this is the height used to determine the targets // of the slash. For example, undelegating after this height will not escape // slashing. This height should be set to a recent height at the time of the // proposal to prevent delegators from undelegating during the vote period. // i.e. infraction_height <= proposal submission height. // // NB: At the time this message is applied, this height must have occured // equal to or less than an unbonding period in the past in order for the // slash to be effective. // i.e. time(proposal pass height) - time(infraction_height) < unbonding // period InfractionHeight uint32 `protobuf:"varint,3,opt,name=infraction_height,json=infractionHeight,proto3" json:"infraction_height,omitempty"` // Tokens of the validator at the specified height. Used to compute the slash // amount. The x/staking HistoricalInfo query endpoint can be used to find // this. TokensAtInfractionHeight github_com_StreamFinance_Protocol_stream_chain_protocol_dtypes.SerializableInt `` /* 217-byte string literal not displayed */ // Multiplier for how much of the validator's stake should be slashed. // slash_factor * tokens_at_infraction_height = tokens slashed SlashFactor cosmossdk_io_math.LegacyDec `protobuf:"bytes,5,opt,name=slash_factor,json=slashFactor,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"slash_factor"` }
MsgSlashValidator is the Msg/SlashValidator request type.
func (*MsgSlashValidator) Descriptor ¶
func (*MsgSlashValidator) Descriptor() ([]byte, []int)
func (*MsgSlashValidator) GetAuthority ¶
func (m *MsgSlashValidator) GetAuthority() string
func (*MsgSlashValidator) GetInfractionHeight ¶
func (m *MsgSlashValidator) GetInfractionHeight() uint32
func (*MsgSlashValidator) GetValidatorAddress ¶
func (m *MsgSlashValidator) GetValidatorAddress() string
func (*MsgSlashValidator) Marshal ¶
func (m *MsgSlashValidator) Marshal() (dAtA []byte, err error)
func (*MsgSlashValidator) MarshalTo ¶
func (m *MsgSlashValidator) MarshalTo(dAtA []byte) (int, error)
func (*MsgSlashValidator) MarshalToSizedBuffer ¶
func (m *MsgSlashValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSlashValidator) ProtoMessage ¶
func (*MsgSlashValidator) ProtoMessage()
func (*MsgSlashValidator) Reset ¶
func (m *MsgSlashValidator) Reset()
func (*MsgSlashValidator) Size ¶
func (m *MsgSlashValidator) Size() (n int)
func (*MsgSlashValidator) String ¶
func (m *MsgSlashValidator) String() string
func (*MsgSlashValidator) Unmarshal ¶
func (m *MsgSlashValidator) Unmarshal(dAtA []byte) error
func (*MsgSlashValidator) ValidateBasic ¶
func (msg *MsgSlashValidator) ValidateBasic() error
func (*MsgSlashValidator) XXX_DiscardUnknown ¶
func (m *MsgSlashValidator) XXX_DiscardUnknown()
func (*MsgSlashValidator) XXX_Marshal ¶
func (m *MsgSlashValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSlashValidator) XXX_Merge ¶
func (m *MsgSlashValidator) XXX_Merge(src proto.Message)
func (*MsgSlashValidator) XXX_Size ¶
func (m *MsgSlashValidator) XXX_Size() int
func (*MsgSlashValidator) XXX_Unmarshal ¶
func (m *MsgSlashValidator) XXX_Unmarshal(b []byte) error
type MsgSlashValidatorResponse ¶
type MsgSlashValidatorResponse struct { }
MsgSlashValidatorResponse is the Msg/SlashValidator response type.
func (*MsgSlashValidatorResponse) Descriptor ¶
func (*MsgSlashValidatorResponse) Descriptor() ([]byte, []int)
func (*MsgSlashValidatorResponse) Marshal ¶
func (m *MsgSlashValidatorResponse) Marshal() (dAtA []byte, err error)
func (*MsgSlashValidatorResponse) MarshalTo ¶
func (m *MsgSlashValidatorResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgSlashValidatorResponse) MarshalToSizedBuffer ¶
func (m *MsgSlashValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgSlashValidatorResponse) ProtoMessage ¶
func (*MsgSlashValidatorResponse) ProtoMessage()
func (*MsgSlashValidatorResponse) Reset ¶
func (m *MsgSlashValidatorResponse) Reset()
func (*MsgSlashValidatorResponse) Size ¶
func (m *MsgSlashValidatorResponse) Size() (n int)
func (*MsgSlashValidatorResponse) String ¶
func (m *MsgSlashValidatorResponse) String() string
func (*MsgSlashValidatorResponse) Unmarshal ¶
func (m *MsgSlashValidatorResponse) Unmarshal(dAtA []byte) error
func (*MsgSlashValidatorResponse) XXX_DiscardUnknown ¶
func (m *MsgSlashValidatorResponse) XXX_DiscardUnknown()
func (*MsgSlashValidatorResponse) XXX_Marshal ¶
func (m *MsgSlashValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgSlashValidatorResponse) XXX_Merge ¶
func (m *MsgSlashValidatorResponse) XXX_Merge(src proto.Message)
func (*MsgSlashValidatorResponse) XXX_Size ¶
func (m *MsgSlashValidatorResponse) XXX_Size() int
func (*MsgSlashValidatorResponse) XXX_Unmarshal ¶
func (m *MsgSlashValidatorResponse) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type StakingKeeper ¶
type StakingKeeper interface { Slash( ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec, ) (math.Int, error) }
StatsKeeper defines the expected stats keeper
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) SlashValidator ¶
func (*UnimplementedMsgServer) SlashValidator(ctx context.Context, req *MsgSlashValidator) (*MsgSlashValidatorResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.