cosmos-sdk: github.com/cosmos/cosmos-sdk/x/slashing/types Index | Files

package types

import "github.com/cosmos/cosmos-sdk/x/slashing/types"

noalias

noalias DONTCOVER

Index

Package Files

codec.go errors.go events.go expected_keepers.go genesis.go genesis.pb.go keys.go msg.go params.go querier.go query.pb.go signing_info.go slashing.pb.go tx.pb.go

Constants

const (
    EventTypeSlash    = "slash"
    EventTypeLiveness = "liveness"

    AttributeKeyAddress      = "address"
    AttributeKeyHeight       = "height"
    AttributeKeyPower        = "power"
    AttributeKeyReason       = "reason"
    AttributeKeyJailed       = "jailed"
    AttributeKeyMissedBlocks = "missed_blocks"

    AttributeValueDoubleSign       = "double_sign"
    AttributeValueMissingSignature = "missing_signature"
    AttributeValueCategory         = ModuleName
)

Slashing module event types

const (
    // ModuleName is the name of the module
    ModuleName = "slashing"

    // StoreKey is the store key string for slashing
    StoreKey = ModuleName

    // RouterKey is the message route for slashing
    RouterKey = ModuleName

    // QuerierRoute is the querier route for slashing
    QuerierRoute = ModuleName
)
const (
    DefaultSignedBlocksWindow   = int64(100)
    DefaultDowntimeJailDuration = 60 * 10 * time.Second
)

Default parameter namespace

const (
    QueryParameters   = "parameters"
    QuerySigningInfo  = "signingInfo"
    QuerySigningInfos = "signingInfos"
)

Query endpoints supported by the slashing querier

const (
    TypeMsgUnjail = "unjail"
)

slashing message types

Variables

var (
    ErrNoValidatorForAddress        = sdkerrors.Register(ModuleName, 2, "address is not associated with any known validator")
    ErrBadValidatorAddr             = sdkerrors.Register(ModuleName, 3, "validator does not exist for that address")
    ErrValidatorJailed              = sdkerrors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed")
    ErrValidatorNotJailed           = sdkerrors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed")
    ErrMissingSelfDelegation        = sdkerrors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed")
    ErrSelfDelegationTooLowToUnjail = sdkerrors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed")
    ErrNoSigningInfoFound           = sdkerrors.Register(ModuleName, 8, "no validator signing info found")
)

x/slashing module sentinel errors

var (
    ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
var (
    ValidatorSigningInfoKeyPrefix         = []byte{0x01} // Prefix for signing info
    ValidatorMissedBlockBitArrayKeyPrefix = []byte{0x02} // Prefix for missed block bit array
    AddrPubkeyRelationKeyPrefix           = []byte{0x03} // Prefix for address-pubkey relation
)

Keys for slashing store Items are stored with the following key: values

- 0x01<consAddress_Bytes>: ValidatorSigningInfo

- 0x02<consAddress_Bytes><period_Bytes>: bool

- 0x03<accAddr_Bytes>: crypto.PubKey

var (
    DefaultMinSignedPerWindow      = sdk.NewDecWithPrec(5, 1)
    DefaultSlashFractionDoubleSign = sdk.NewDec(1).Quo(sdk.NewDec(20))
    DefaultSlashFractionDowntime   = sdk.NewDec(1).Quo(sdk.NewDec(100))
)
var (
    KeySignedBlocksWindow      = []byte("SignedBlocksWindow")
    KeyMinSignedPerWindow      = []byte("MinSignedPerWindow")
    KeyDowntimeJailDuration    = []byte("DowntimeJailDuration")
    KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign")
    KeySlashFractionDowntime   = []byte("SlashFractionDowntime")
)

Parameter store keys

var (
    ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
var (
    ErrInvalidLengthSlashing        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowSlashing          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupSlashing = fmt.Errorf("proto: unexpected end of group")
)
var (
    ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
var (

    // ModuleCdc references the global x/slashing module codec. Note, the codec
    // should ONLY be used in certain instances of tests and for JSON encoding as Amino
    // is still used for that purpose.
    //
    // The actual codec used for serialization should be provided to x/slashing and
    // defined at the application level.
    ModuleCdc = codec.NewAminoCodec(amino)
)

func AddrPubkeyRelationKey Uses

func AddrPubkeyRelationKey(address []byte) []byte

AddrPubkeyRelationKey gets pubkey relation key used to get the pubkey from the address

func ParamKeyTable Uses

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for slashing module

func RegisterCodec Uses

func RegisterCodec(cdc *codec.LegacyAmino)

RegisterCodec registers concrete types on codec

func RegisterInterfaces Uses

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterQueryServer Uses

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis Uses

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the slashing genesis parameters

func ValidatorMissedBlockBitArrayKey Uses

func ValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte

ValidatorMissedBlockBitArrayKey - stored by *Consensus* address (not operator address)

func ValidatorMissedBlockBitArrayPrefixKey Uses

func ValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte

ValidatorMissedBlockBitArrayPrefixKey - stored by *Consensus* address (not operator address)

func ValidatorSigningInfoAddress Uses

func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress)

ValidatorSigningInfoAddress - extract the address from a validator signing info key

func ValidatorSigningInfoKey Uses

func ValidatorSigningInfoKey(v sdk.ConsAddress) []byte

ValidatorSigningInfoKey - stored by *Consensus* address (not operator address)

type AccountKeeper Uses

type AccountKeeper interface {
    GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI
    IterateAccounts(ctx sdk.Context, process func(auth.AccountI) (stop bool))
}

AccountKeeper expected account keeper

type BankKeeper Uses

type BankKeeper interface {
    GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
    GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
    SetBalances(ctx sdk.Context, addr sdk.AccAddress, balances sdk.Coins) error
    LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
    SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type GenesisState Uses

type GenesisState struct {
    // params defines all the paramaters of related to deposit.
    Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
    // signing_infos represents a map between validator addresses and their
    // signing infos.
    SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos" yaml:"signing_infos"`
    // signing_infos represents a map between validator addresses and their
    // missed blocks.
    MissedBlocks []ValidatorMissedBlocks `protobuf:"bytes,3,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks" yaml:"missed_blocks"`
}

GenesisState defines the slashing module's genesis state.

func DefaultGenesisState Uses

func DefaultGenesisState() *GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState Uses

func NewGenesisState(
    params Params, signingInfos []SigningInfo, missedBlocks []ValidatorMissedBlocks,
) *GenesisState

NewGenesisState creates a new GenesisState object

func (*GenesisState) Descriptor Uses

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetMissedBlocks Uses

func (m *GenesisState) GetMissedBlocks() []ValidatorMissedBlocks

func (*GenesisState) GetParams Uses

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetSigningInfos Uses

func (m *GenesisState) GetSigningInfos() []SigningInfo

func (*GenesisState) Marshal Uses

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo Uses

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer Uses

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage Uses

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset Uses

func (m *GenesisState) Reset()

func (*GenesisState) Size Uses

func (m *GenesisState) Size() (n int)

func (*GenesisState) String Uses

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal Uses

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown Uses

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal Uses

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge Uses

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size Uses

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal Uses

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MissedBlock Uses

type MissedBlock struct {
    // index is the height at which the block was missed.
    Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
    // missed is the missed status.
    Missed bool `protobuf:"varint,2,opt,name=missed,proto3" json:"missed,omitempty"`
}

MissedBlock contains height and missed status as boolean.

func NewMissedBlock Uses

func NewMissedBlock(index int64, missed bool) MissedBlock

NewMissedBlock creates a new MissedBlock instance

func (*MissedBlock) Descriptor Uses

func (*MissedBlock) Descriptor() ([]byte, []int)

func (*MissedBlock) GetIndex Uses

func (m *MissedBlock) GetIndex() int64

func (*MissedBlock) GetMissed Uses

func (m *MissedBlock) GetMissed() bool

func (*MissedBlock) Marshal Uses

func (m *MissedBlock) Marshal() (dAtA []byte, err error)

func (*MissedBlock) MarshalTo Uses

func (m *MissedBlock) MarshalTo(dAtA []byte) (int, error)

func (*MissedBlock) MarshalToSizedBuffer Uses

func (m *MissedBlock) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MissedBlock) ProtoMessage Uses

func (*MissedBlock) ProtoMessage()

func (*MissedBlock) Reset Uses

func (m *MissedBlock) Reset()

func (*MissedBlock) Size Uses

func (m *MissedBlock) Size() (n int)

func (*MissedBlock) String Uses

func (m *MissedBlock) String() string

func (*MissedBlock) Unmarshal Uses

func (m *MissedBlock) Unmarshal(dAtA []byte) error

func (*MissedBlock) XXX_DiscardUnknown Uses

func (m *MissedBlock) XXX_DiscardUnknown()

func (*MissedBlock) XXX_Marshal Uses

func (m *MissedBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MissedBlock) XXX_Merge Uses

func (m *MissedBlock) XXX_Merge(src proto.Message)

func (*MissedBlock) XXX_Size Uses

func (m *MissedBlock) XXX_Size() int

func (*MissedBlock) XXX_Unmarshal Uses

func (m *MissedBlock) XXX_Unmarshal(b []byte) error

type MsgUnjail Uses

type MsgUnjail struct {
    ValidatorAddr github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"address" yaml:"address"`
}

MsgUnjail - struct for unjailing jailed validator

func NewMsgUnjail Uses

func NewMsgUnjail(validatorAddr sdk.ValAddress) *MsgUnjail

NewMsgUnjail creates a new MsgUnjail instance

func (*MsgUnjail) Descriptor Uses

func (*MsgUnjail) Descriptor() ([]byte, []int)

func (*MsgUnjail) Equal Uses

func (this *MsgUnjail) Equal(that interface{}) bool

func (MsgUnjail) GetSignBytes Uses

func (msg MsgUnjail) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgUnjail) GetSigners Uses

func (msg MsgUnjail) GetSigners() []sdk.AccAddress

func (*MsgUnjail) GetValidatorAddr Uses

func (m *MsgUnjail) GetValidatorAddr() github_com_cosmos_cosmos_sdk_types.ValAddress

func (*MsgUnjail) Marshal Uses

func (m *MsgUnjail) Marshal() (dAtA []byte, err error)

func (*MsgUnjail) MarshalTo Uses

func (m *MsgUnjail) MarshalTo(dAtA []byte) (int, error)

func (*MsgUnjail) MarshalToSizedBuffer Uses

func (m *MsgUnjail) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUnjail) ProtoMessage Uses

func (*MsgUnjail) ProtoMessage()

func (*MsgUnjail) Reset Uses

func (m *MsgUnjail) Reset()

func (MsgUnjail) Route Uses

func (msg MsgUnjail) Route() string

func (*MsgUnjail) Size Uses

func (m *MsgUnjail) Size() (n int)

func (*MsgUnjail) String Uses

func (m *MsgUnjail) String() string

func (MsgUnjail) Type Uses

func (msg MsgUnjail) Type() string

func (*MsgUnjail) Unmarshal Uses

func (m *MsgUnjail) Unmarshal(dAtA []byte) error

func (MsgUnjail) ValidateBasic Uses

func (msg MsgUnjail) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

func (*MsgUnjail) XXX_DiscardUnknown Uses

func (m *MsgUnjail) XXX_DiscardUnknown()

func (*MsgUnjail) XXX_Marshal Uses

func (m *MsgUnjail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUnjail) XXX_Merge Uses

func (m *MsgUnjail) XXX_Merge(src proto.Message)

func (*MsgUnjail) XXX_Size Uses

func (m *MsgUnjail) XXX_Size() int

func (*MsgUnjail) XXX_Unmarshal Uses

func (m *MsgUnjail) XXX_Unmarshal(b []byte) error

type ParamSubspace Uses

type ParamSubspace interface {
    HasKeyTable() bool
    WithKeyTable(table paramtypes.KeyTable) paramtypes.Subspace
    Get(ctx sdk.Context, key []byte, ptr interface{})
    GetParamSet(ctx sdk.Context, ps paramtypes.ParamSet)
    SetParamSet(ctx sdk.Context, ps paramtypes.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Params Uses

type Params struct {
    SignedBlocksWindow      int64                                  `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty" yaml:"signed_blocks_window"`
    MinSignedPerWindow      github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_signed_per_window" yaml:"min_signed_per_window"`
    DowntimeJailDuration    time.Duration                          `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration" yaml:"downtime_jail_duration"`
    SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"`
    SlashFractionDowntime   github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"`
}

Params - used for initializing default parameter for slashing at genesis

func DefaultParams Uses

func DefaultParams() Params

DefaultParams defines the parameters for this module

func NewParams Uses

func NewParams(
    signedBlocksWindow int64, minSignedPerWindow sdk.Dec, downtimeJailDuration time.Duration,
    slashFractionDoubleSign, slashFractionDowntime sdk.Dec,
) Params

NewParams creates a new Params object

func (*Params) Descriptor Uses

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal Uses

func (this *Params) Equal(that interface{}) bool

func (*Params) GetDowntimeJailDuration Uses

func (m *Params) GetDowntimeJailDuration() time.Duration

func (*Params) GetSignedBlocksWindow Uses

func (m *Params) GetSignedBlocksWindow() int64

func (*Params) Marshal Uses

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo Uses

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer Uses

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs Uses

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs - Implements params.ParamSet

func (*Params) ProtoMessage Uses

func (*Params) ProtoMessage()

func (*Params) Reset Uses

func (m *Params) Reset()

func (*Params) Size Uses

func (m *Params) Size() (n int)

func (*Params) String Uses

func (m *Params) String() string

func (*Params) Unmarshal Uses

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) XXX_DiscardUnknown Uses

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal Uses

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge Uses

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size Uses

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal Uses

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryClient Uses

type QueryClient interface {
    // Params queries the parameters of slashing module
    Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
    // SigningInfo queries the signing info of given cons address
    SigningInfo(ctx context.Context, in *QuerySigningInfoRequest, opts ...grpc.CallOption) (*QuerySigningInfoResponse, error)
    // SigningInfos queries signing info of all validators
    SigningInfos(ctx context.Context, in *QuerySigningInfosRequest, opts ...grpc.CallOption) (*QuerySigningInfosResponse, error)
}

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 Uses

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest Uses

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method

func (*QueryParamsRequest) Descriptor Uses

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal Uses

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo Uses

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer Uses

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage Uses

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset Uses

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size Uses

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String Uses

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal Uses

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown Uses

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal Uses

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge Uses

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size Uses

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal Uses

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse Uses

type QueryParamsResponse struct {
    Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method

func (*QueryParamsResponse) Descriptor Uses

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams Uses

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal Uses

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo Uses

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer Uses

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage Uses

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset Uses

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size Uses

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String Uses

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal Uses

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown Uses

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal Uses

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge Uses

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size Uses

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal Uses

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer Uses

type QueryServer interface {
    // Params queries the parameters of slashing module
    Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
    // SigningInfo queries the signing info of given cons address
    SigningInfo(context.Context, *QuerySigningInfoRequest) (*QuerySigningInfoResponse, error)
    // SigningInfos queries signing info of all validators
    SigningInfos(context.Context, *QuerySigningInfosRequest) (*QuerySigningInfosResponse, error)
}

QueryServer is the server API for Query service.

type QuerySigningInfoRequest Uses

type QuerySigningInfoRequest struct {
    // cons_address is the address to query signing info of
    ConsAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,1,opt,name=cons_address,json=consAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"cons_address,omitempty"`
}

QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC method

func (*QuerySigningInfoRequest) Descriptor Uses

func (*QuerySigningInfoRequest) Descriptor() ([]byte, []int)

func (*QuerySigningInfoRequest) GetConsAddress Uses

func (m *QuerySigningInfoRequest) GetConsAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress

func (*QuerySigningInfoRequest) Marshal Uses

func (m *QuerySigningInfoRequest) Marshal() (dAtA []byte, err error)

func (*QuerySigningInfoRequest) MarshalTo Uses

func (m *QuerySigningInfoRequest) MarshalTo(dAtA []byte) (int, error)

func (*QuerySigningInfoRequest) MarshalToSizedBuffer Uses

func (m *QuerySigningInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySigningInfoRequest) ProtoMessage Uses

func (*QuerySigningInfoRequest) ProtoMessage()

func (*QuerySigningInfoRequest) Reset Uses

func (m *QuerySigningInfoRequest) Reset()

func (*QuerySigningInfoRequest) Size Uses

func (m *QuerySigningInfoRequest) Size() (n int)

func (*QuerySigningInfoRequest) String Uses

func (m *QuerySigningInfoRequest) String() string

func (*QuerySigningInfoRequest) Unmarshal Uses

func (m *QuerySigningInfoRequest) Unmarshal(dAtA []byte) error

func (*QuerySigningInfoRequest) XXX_DiscardUnknown Uses

func (m *QuerySigningInfoRequest) XXX_DiscardUnknown()

func (*QuerySigningInfoRequest) XXX_Marshal Uses

func (m *QuerySigningInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySigningInfoRequest) XXX_Merge Uses

func (m *QuerySigningInfoRequest) XXX_Merge(src proto.Message)

func (*QuerySigningInfoRequest) XXX_Size Uses

func (m *QuerySigningInfoRequest) XXX_Size() int

func (*QuerySigningInfoRequest) XXX_Unmarshal Uses

func (m *QuerySigningInfoRequest) XXX_Unmarshal(b []byte) error

type QuerySigningInfoResponse Uses

type QuerySigningInfoResponse struct {
    // val_signing_info is the signing info of requested val cons address
    ValSigningInfo ValidatorSigningInfo `protobuf:"bytes,1,opt,name=val_signing_info,json=valSigningInfo,proto3" json:"val_signing_info"`
}

QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC method

func (*QuerySigningInfoResponse) Descriptor Uses

func (*QuerySigningInfoResponse) Descriptor() ([]byte, []int)

func (*QuerySigningInfoResponse) GetValSigningInfo Uses

func (m *QuerySigningInfoResponse) GetValSigningInfo() ValidatorSigningInfo

func (*QuerySigningInfoResponse) Marshal Uses

func (m *QuerySigningInfoResponse) Marshal() (dAtA []byte, err error)

func (*QuerySigningInfoResponse) MarshalTo Uses

func (m *QuerySigningInfoResponse) MarshalTo(dAtA []byte) (int, error)

func (*QuerySigningInfoResponse) MarshalToSizedBuffer Uses

func (m *QuerySigningInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySigningInfoResponse) ProtoMessage Uses

func (*QuerySigningInfoResponse) ProtoMessage()

func (*QuerySigningInfoResponse) Reset Uses

func (m *QuerySigningInfoResponse) Reset()

func (*QuerySigningInfoResponse) Size Uses

func (m *QuerySigningInfoResponse) Size() (n int)

func (*QuerySigningInfoResponse) String Uses

func (m *QuerySigningInfoResponse) String() string

func (*QuerySigningInfoResponse) Unmarshal Uses

func (m *QuerySigningInfoResponse) Unmarshal(dAtA []byte) error

func (*QuerySigningInfoResponse) XXX_DiscardUnknown Uses

func (m *QuerySigningInfoResponse) XXX_DiscardUnknown()

func (*QuerySigningInfoResponse) XXX_Marshal Uses

func (m *QuerySigningInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySigningInfoResponse) XXX_Merge Uses

func (m *QuerySigningInfoResponse) XXX_Merge(src proto.Message)

func (*QuerySigningInfoResponse) XXX_Size Uses

func (m *QuerySigningInfoResponse) XXX_Size() int

func (*QuerySigningInfoResponse) XXX_Unmarshal Uses

func (m *QuerySigningInfoResponse) XXX_Unmarshal(b []byte) error

type QuerySigningInfosParams Uses

type QuerySigningInfosParams struct {
    Page, Limit int
}

QuerySigningInfosParams defines the params for the following queries: - 'custom/slashing/signingInfos'

func NewQuerySigningInfosParams Uses

func NewQuerySigningInfosParams(page, limit int) QuerySigningInfosParams

NewQuerySigningInfosParams creates a new QuerySigningInfosParams instance

type QuerySigningInfosRequest Uses

type QuerySigningInfosRequest struct {
    Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method

func (*QuerySigningInfosRequest) Descriptor Uses

func (*QuerySigningInfosRequest) Descriptor() ([]byte, []int)

func (*QuerySigningInfosRequest) GetPagination Uses

func (m *QuerySigningInfosRequest) GetPagination() *query.PageRequest

func (*QuerySigningInfosRequest) Marshal Uses

func (m *QuerySigningInfosRequest) Marshal() (dAtA []byte, err error)

func (*QuerySigningInfosRequest) MarshalTo Uses

func (m *QuerySigningInfosRequest) MarshalTo(dAtA []byte) (int, error)

func (*QuerySigningInfosRequest) MarshalToSizedBuffer Uses

func (m *QuerySigningInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySigningInfosRequest) ProtoMessage Uses

func (*QuerySigningInfosRequest) ProtoMessage()

func (*QuerySigningInfosRequest) Reset Uses

func (m *QuerySigningInfosRequest) Reset()

func (*QuerySigningInfosRequest) Size Uses

func (m *QuerySigningInfosRequest) Size() (n int)

func (*QuerySigningInfosRequest) String Uses

func (m *QuerySigningInfosRequest) String() string

func (*QuerySigningInfosRequest) Unmarshal Uses

func (m *QuerySigningInfosRequest) Unmarshal(dAtA []byte) error

func (*QuerySigningInfosRequest) XXX_DiscardUnknown Uses

func (m *QuerySigningInfosRequest) XXX_DiscardUnknown()

func (*QuerySigningInfosRequest) XXX_Marshal Uses

func (m *QuerySigningInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySigningInfosRequest) XXX_Merge Uses

func (m *QuerySigningInfosRequest) XXX_Merge(src proto.Message)

func (*QuerySigningInfosRequest) XXX_Size Uses

func (m *QuerySigningInfosRequest) XXX_Size() int

func (*QuerySigningInfosRequest) XXX_Unmarshal Uses

func (m *QuerySigningInfosRequest) XXX_Unmarshal(b []byte) error

type QuerySigningInfosResponse Uses

type QuerySigningInfosResponse struct {
    // info is the signing info of all validators
    Info       []ValidatorSigningInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info"`
    Pagination *query.PageResponse    `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method

func (*QuerySigningInfosResponse) Descriptor Uses

func (*QuerySigningInfosResponse) Descriptor() ([]byte, []int)

func (*QuerySigningInfosResponse) GetInfo Uses

func (m *QuerySigningInfosResponse) GetInfo() []ValidatorSigningInfo

func (*QuerySigningInfosResponse) GetPagination Uses

func (m *QuerySigningInfosResponse) GetPagination() *query.PageResponse

func (*QuerySigningInfosResponse) Marshal Uses

func (m *QuerySigningInfosResponse) Marshal() (dAtA []byte, err error)

func (*QuerySigningInfosResponse) MarshalTo Uses

func (m *QuerySigningInfosResponse) MarshalTo(dAtA []byte) (int, error)

func (*QuerySigningInfosResponse) MarshalToSizedBuffer Uses

func (m *QuerySigningInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QuerySigningInfosResponse) ProtoMessage Uses

func (*QuerySigningInfosResponse) ProtoMessage()

func (*QuerySigningInfosResponse) Reset Uses

func (m *QuerySigningInfosResponse) Reset()

func (*QuerySigningInfosResponse) Size Uses

func (m *QuerySigningInfosResponse) Size() (n int)

func (*QuerySigningInfosResponse) String Uses

func (m *QuerySigningInfosResponse) String() string

func (*QuerySigningInfosResponse) Unmarshal Uses

func (m *QuerySigningInfosResponse) Unmarshal(dAtA []byte) error

func (*QuerySigningInfosResponse) XXX_DiscardUnknown Uses

func (m *QuerySigningInfosResponse) XXX_DiscardUnknown()

func (*QuerySigningInfosResponse) XXX_Marshal Uses

func (m *QuerySigningInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySigningInfosResponse) XXX_Merge Uses

func (m *QuerySigningInfosResponse) XXX_Merge(src proto.Message)

func (*QuerySigningInfosResponse) XXX_Size Uses

func (m *QuerySigningInfosResponse) XXX_Size() int

func (*QuerySigningInfosResponse) XXX_Unmarshal Uses

func (m *QuerySigningInfosResponse) XXX_Unmarshal(b []byte) error

type SigningInfo Uses

type SigningInfo struct {
    // address is the validator address.
    Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
    // validator_signing_info represents the signing info of this validator.
    ValidatorSigningInfo ValidatorSigningInfo `protobuf:"bytes,2,opt,name=validator_signing_info,json=validatorSigningInfo,proto3" json:"validator_signing_info" yaml:"validator_signing_info"`
}

SigningInfo stores validator signing info of corresponding address.

func (*SigningInfo) Descriptor Uses

func (*SigningInfo) Descriptor() ([]byte, []int)

func (*SigningInfo) GetAddress Uses

func (m *SigningInfo) GetAddress() string

func (*SigningInfo) GetValidatorSigningInfo Uses

func (m *SigningInfo) GetValidatorSigningInfo() ValidatorSigningInfo

func (*SigningInfo) Marshal Uses

func (m *SigningInfo) Marshal() (dAtA []byte, err error)

func (*SigningInfo) MarshalTo Uses

func (m *SigningInfo) MarshalTo(dAtA []byte) (int, error)

func (*SigningInfo) MarshalToSizedBuffer Uses

func (m *SigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SigningInfo) ProtoMessage Uses

func (*SigningInfo) ProtoMessage()

func (*SigningInfo) Reset Uses

func (m *SigningInfo) Reset()

func (*SigningInfo) Size Uses

func (m *SigningInfo) Size() (n int)

func (*SigningInfo) String Uses

func (m *SigningInfo) String() string

func (*SigningInfo) Unmarshal Uses

func (m *SigningInfo) Unmarshal(dAtA []byte) error

func (*SigningInfo) XXX_DiscardUnknown Uses

func (m *SigningInfo) XXX_DiscardUnknown()

func (*SigningInfo) XXX_Marshal Uses

func (m *SigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SigningInfo) XXX_Merge Uses

func (m *SigningInfo) XXX_Merge(src proto.Message)

func (*SigningInfo) XXX_Size Uses

func (m *SigningInfo) XXX_Size() int

func (*SigningInfo) XXX_Unmarshal Uses

func (m *SigningInfo) XXX_Unmarshal(b []byte) error

type StakingHooks Uses

type StakingHooks interface {
    AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)                           // Must be called when a validator is created
    AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted

    AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is bonded
}

StakingHooks event hooks for staking validator object (noalias)

type StakingKeeper Uses

type StakingKeeper interface {
    // iterate through validators by operator address, execute func for each validator
    IterateValidators(sdk.Context,
        func(index int64, validator stakingexported.ValidatorI) (stop bool))

    Validator(sdk.Context, sdk.ValAddress) stakingexported.ValidatorI            // get a particular validator by operator address
    ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingexported.ValidatorI // get a particular validator by consensus address

    // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction
    Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
    Jail(sdk.Context, sdk.ConsAddress)   // jail a validator
    Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator

    // Delegation allows for getting a particular delegation for a given validator
    // and delegator outside the scope of the staking module.
    Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingexported.DelegationI

    // MaxValidators returns the maximum amount of bonded validators
    MaxValidators(sdk.Context) uint32
}

StakingKeeper expected staking keeper

type UnimplementedQueryServer Uses

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params Uses

func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)

func (*UnimplementedQueryServer) SigningInfo Uses

func (*UnimplementedQueryServer) SigningInfo(ctx context.Context, req *QuerySigningInfoRequest) (*QuerySigningInfoResponse, error)

func (*UnimplementedQueryServer) SigningInfos Uses

func (*UnimplementedQueryServer) SigningInfos(ctx context.Context, req *QuerySigningInfosRequest) (*QuerySigningInfosResponse, error)

type ValidatorMissedBlocks Uses

type ValidatorMissedBlocks struct {
    // address is the validator address.
    Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
    // missed_blocks is an array of missed blocks by the validator.
    MissedBlocks []MissedBlock `protobuf:"bytes,2,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks" yaml:"missed_blocks"`
}

ValidatorMissedBlocks contains array of missed blocks of corresponding address.

func (*ValidatorMissedBlocks) Descriptor Uses

func (*ValidatorMissedBlocks) Descriptor() ([]byte, []int)

func (*ValidatorMissedBlocks) GetAddress Uses

func (m *ValidatorMissedBlocks) GetAddress() string

func (*ValidatorMissedBlocks) GetMissedBlocks Uses

func (m *ValidatorMissedBlocks) GetMissedBlocks() []MissedBlock

func (*ValidatorMissedBlocks) Marshal Uses

func (m *ValidatorMissedBlocks) Marshal() (dAtA []byte, err error)

func (*ValidatorMissedBlocks) MarshalTo Uses

func (m *ValidatorMissedBlocks) MarshalTo(dAtA []byte) (int, error)

func (*ValidatorMissedBlocks) MarshalToSizedBuffer Uses

func (m *ValidatorMissedBlocks) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidatorMissedBlocks) ProtoMessage Uses

func (*ValidatorMissedBlocks) ProtoMessage()

func (*ValidatorMissedBlocks) Reset Uses

func (m *ValidatorMissedBlocks) Reset()

func (*ValidatorMissedBlocks) Size Uses

func (m *ValidatorMissedBlocks) Size() (n int)

func (*ValidatorMissedBlocks) String Uses

func (m *ValidatorMissedBlocks) String() string

func (*ValidatorMissedBlocks) Unmarshal Uses

func (m *ValidatorMissedBlocks) Unmarshal(dAtA []byte) error

func (*ValidatorMissedBlocks) XXX_DiscardUnknown Uses

func (m *ValidatorMissedBlocks) XXX_DiscardUnknown()

func (*ValidatorMissedBlocks) XXX_Marshal Uses

func (m *ValidatorMissedBlocks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorMissedBlocks) XXX_Merge Uses

func (m *ValidatorMissedBlocks) XXX_Merge(src proto.Message)

func (*ValidatorMissedBlocks) XXX_Size Uses

func (m *ValidatorMissedBlocks) XXX_Size() int

func (*ValidatorMissedBlocks) XXX_Unmarshal Uses

func (m *ValidatorMissedBlocks) XXX_Unmarshal(b []byte) error

type ValidatorSigningInfo Uses

type ValidatorSigningInfo struct {
    Address github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"address,omitempty"`
    // height at which validator was first a candidate OR was unjailed
    StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty" yaml:"start_height"`
    // index offset into signed block bit array
    IndexOffset int64 `protobuf:"varint,3,opt,name=index_offset,json=indexOffset,proto3" json:"index_offset,omitempty" yaml:"index_offset"`
    // timestamp validator cannot be unjailed until
    JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until" yaml:"jailed_until"`
    // whether or not a validator has been tombstoned (killed out of validator set)
    Tombstoned bool `protobuf:"varint,5,opt,name=tombstoned,proto3" json:"tombstoned,omitempty"`
    // missed blocks counter (to avoid scanning the array every time)
    MissedBlocksCounter int64 `protobuf:"varint,6,opt,name=missed_blocks_counter,json=missedBlocksCounter,proto3" json:"missed_blocks_counter,omitempty" yaml:"missed_blocks_counter"`
}

ValidatorSigningInfo defines the signing info for a validator

func NewValidatorSigningInfo Uses

func NewValidatorSigningInfo(
    condAddr sdk.ConsAddress, startHeight, indexOffset int64,
    jailedUntil time.Time, tombstoned bool, missedBlocksCounter int64,
) ValidatorSigningInfo

NewValidatorSigningInfo creates a new ValidatorSigningInfo instance

func UnmarshalValSigningInfo Uses

func UnmarshalValSigningInfo(cdc codec.Marshaler, value []byte) (signingInfo ValidatorSigningInfo, err error)

unmarshal a validator signing info from a store value

func (*ValidatorSigningInfo) Descriptor Uses

func (*ValidatorSigningInfo) Descriptor() ([]byte, []int)

func (*ValidatorSigningInfo) Equal Uses

func (this *ValidatorSigningInfo) Equal(that interface{}) bool

func (*ValidatorSigningInfo) GetAddress Uses

func (m *ValidatorSigningInfo) GetAddress() github_com_cosmos_cosmos_sdk_types.ConsAddress

func (*ValidatorSigningInfo) GetIndexOffset Uses

func (m *ValidatorSigningInfo) GetIndexOffset() int64

func (*ValidatorSigningInfo) GetJailedUntil Uses

func (m *ValidatorSigningInfo) GetJailedUntil() time.Time

func (*ValidatorSigningInfo) GetMissedBlocksCounter Uses

func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64

func (*ValidatorSigningInfo) GetStartHeight Uses

func (m *ValidatorSigningInfo) GetStartHeight() int64

func (*ValidatorSigningInfo) GetTombstoned Uses

func (m *ValidatorSigningInfo) GetTombstoned() bool

func (*ValidatorSigningInfo) Marshal Uses

func (m *ValidatorSigningInfo) Marshal() (dAtA []byte, err error)

func (*ValidatorSigningInfo) MarshalTo Uses

func (m *ValidatorSigningInfo) MarshalTo(dAtA []byte) (int, error)

func (*ValidatorSigningInfo) MarshalToSizedBuffer Uses

func (m *ValidatorSigningInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidatorSigningInfo) ProtoMessage Uses

func (*ValidatorSigningInfo) ProtoMessage()

func (*ValidatorSigningInfo) Reset Uses

func (m *ValidatorSigningInfo) Reset()

func (*ValidatorSigningInfo) Size Uses

func (m *ValidatorSigningInfo) Size() (n int)

func (ValidatorSigningInfo) String Uses

func (i ValidatorSigningInfo) String() string

String implements the stringer interface for ValidatorSigningInfo

func (*ValidatorSigningInfo) Unmarshal Uses

func (m *ValidatorSigningInfo) Unmarshal(dAtA []byte) error

func (*ValidatorSigningInfo) XXX_DiscardUnknown Uses

func (m *ValidatorSigningInfo) XXX_DiscardUnknown()

func (*ValidatorSigningInfo) XXX_Marshal Uses

func (m *ValidatorSigningInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorSigningInfo) XXX_Merge Uses

func (m *ValidatorSigningInfo) XXX_Merge(src proto.Message)

func (*ValidatorSigningInfo) XXX_Size Uses

func (m *ValidatorSigningInfo) XXX_Size() int

func (*ValidatorSigningInfo) XXX_Unmarshal Uses

func (m *ValidatorSigningInfo) XXX_Unmarshal(b []byte) error

Package types imports 26 packages (graph) and is imported by 6 packages. Updated 2020-08-13. Refresh now. Tools for package owners.