Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/hbtc-chain/bhchain/x/slashing/types
nolint
nolint:deadcode unused
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper)
- func ExportGenesis(ctx sdk.Context, keeper Keeper) (data types.GenesisState)
- func InitGenesis(ctx sdk.Context, keeper Keeper, stakingKeeper types.StakingKeeper, ...)
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type CodeType
- type GenesisState
- type Hooks
- func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.CUAddress, _ sdk.ValAddress)
- func (h Hooks) AfterNewEpoch(sdk.Context, sdk.Epoch)
- func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.CUAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.CUAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.CUAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec)
- type Keeper
- func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress)
- func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress)
- func (k Keeper) DowntimeJailDuration(ctx sdk.Context) (res time.Duration)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, ...)
- func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr crypto.Address, power int64, signed bool)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, ...)
- func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxEvidenceAge(ctx sdk.Context) (res time.Duration)
- func (k Keeper) MinSignedPerWindow(ctx sdk.Context) int64
- func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo)
- func (k Keeper) SignedBlocksWindow(ctx sdk.Context) (res int64)
- func (k Keeper) SlashFractionDoubleSign(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SlashFractionDowntime(ctx sdk.Context) (res sdk.Dec)
- type MissedBlock
- type MsgUnjail
- type Params
- type QuerySigningInfoParams
- type QuerySigningInfosParams
- type ValidatorSigningInfo
Constants ¶
const ( DefaultCodespace = types.DefaultCodespace CodeInvalidValidator = types.CodeInvalidValidator CodeValidatorJailed = types.CodeValidatorJailed CodeValidatorNotJailed = types.CodeValidatorNotJailed CodeMissingSelfDelegation = types.CodeMissingSelfDelegation CodeSelfDelegationTooLow = types.CodeSelfDelegationTooLow CodeMissingSigningInfo = types.CodeMissingSigningInfo ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute QueryParameters = types.QueryParameters QuerySigningInfo = types.QuerySigningInfo QuerySigningInfos = types.QuerySigningInfos DefaultParamspace = types.DefaultParamspace DefaultMaxEvidenceAge = types.DefaultMaxEvidenceAge DefaultSignedBlocksWindow = types.DefaultSignedBlocksWindow DefaultDowntimeJailDuration = types.DefaultDowntimeJailDuration )
Variables ¶
var ( // functions aliases RegisterCodec = types.RegisterCodec ErrNoValidatorForAddress = types.ErrNoValidatorForAddress ErrBadValidatorAddr = types.ErrBadValidatorAddr ErrValidatorJailed = types.ErrValidatorJailed ErrValidatorNotJailed = types.ErrValidatorNotJailed ErrMissingSelfDelegation = types.ErrMissingSelfDelegation ErrSelfDelegationTooLowToUnjail = types.ErrSelfDelegationTooLowToUnjail ErrNoSigningInfoFound = types.ErrNoSigningInfoFound NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState ValidateGenesis = types.ValidateGenesis GetValidatorSigningInfoKey = types.GetValidatorSigningInfoKey GetValidatorSigningInfoAddress = types.GetValidatorSigningInfoAddress GetValidatorMissedBlockBitArrayPrefixKey = types.GetValidatorMissedBlockBitArrayPrefixKey GetValidatorMissedBlockBitArrayKey = types.GetValidatorMissedBlockBitArrayKey GetAddrPubkeyRelationKey = types.GetAddrPubkeyRelationKey NewMsgUnjail = types.NewMsgUnjail ParamKeyTable = types.ParamKeyTable NewParams = types.NewParams DefaultParams = types.DefaultParams NewQuerySigningInfoParams = types.NewQuerySigningInfoParams NewQuerySigningInfosParams = types.NewQuerySigningInfosParams NewValidatorSigningInfo = types.NewValidatorSigningInfo // variable aliases ModuleCdc = types.ModuleCdc ValidatorSigningInfoKey = types.ValidatorSigningInfoKey ValidatorMissedBlockBitArrayKey = types.ValidatorMissedBlockBitArrayKey AddrPubkeyRelationKey = types.AddrPubkeyRelationKey DoubleSignJailEndTime = types.DoubleSignJailEndTime DefaultMinSignedPerWindow = types.DefaultMinSignedPerWindow DefaultSlashFractionDoubleSign = types.DefaultSlashFractionDoubleSign DefaultSlashFractionDowntime = types.DefaultSlashFractionDowntime KeyMaxEvidenceAge = types.KeyMaxEvidenceAge KeySignedBlocksWindow = types.KeySignedBlocksWindow KeyMinSignedPerWindow = types.KeyMinSignedPerWindow KeyDowntimeJailDuration = types.KeyDowntimeJailDuration KeySlashFractionDoubleSign = types.KeySlashFractionDoubleSign KeySlashFractionDowntime = types.KeySlashFractionDowntime EventTypeSlash = types.EventTypeSlash EventTypeLiveness = types.EventTypeLiveness AttributeKeyAddress = types.AttributeKeyAddress AttributeKeyHeight = types.AttributeKeyHeight AttributeKeyPower = types.AttributeKeyPower AttributeKeyReason = types.AttributeKeyReason AttributeKeyJailed = types.AttributeKeyJailed AttributeKeyMissedBlocks = types.AttributeKeyMissedBlocks AttributeValueDoubleSign = types.AttributeValueDoubleSign AttributeValueMissingSignature = types.AttributeValueMissingSignature AttributeValueCategory = types.AttributeValueCategory )
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper)
slashing begin block functionality
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) (data types.GenesisState)
ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, stakingKeeper types.StakingKeeper, data types.GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func NewHandler ¶
func NewQuerier ¶
NewQuerier creates a new querier for slashing clients.
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module
func NewAppModule ¶
func NewAppModule(keeper Keeper, stakingKeeper types.StakingKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
func (AppModule) NewQuerierHandler ¶
module querier
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
register invariants
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type GenesisState ¶
type GenesisState = types.GenesisState
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for slashing keeper
func (Hooks) AfterDelegationModified ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
nolint - unused hooks
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) BeforeDelegationCreated ¶
func (Hooks) BeforeDelegationRemoved ¶
func (Hooks) BeforeDelegationSharesModified ¶
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the slashing store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.StakingKeeper, paramspace params.Subspace, codespace sdk.CodespaceType) Keeper
NewKeeper creates a slashing keeper
func (Keeper) AfterValidatorBonded ¶
func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress)
func (Keeper) AfterValidatorCreated ¶
func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
When a validator is created, add the address-pubkey relation.
func (Keeper) AfterValidatorRemoved ¶
func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress)
When a validator is removed, delete the address-pubkey relation.
func (Keeper) DowntimeJailDuration ¶
Downtime unbond duration
func (Keeper) HandleDoubleSign ¶
func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, timestamp time.Time, power int64)
handle a validator signing two blocks at the same height power: power of the double-signing validator at the height of infraction
func (Keeper) HandleValidatorSignature ¶
func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr crypto.Address, power int64, signed bool)
handle a validator signature, must be called once per validator per block TODO refactor to take in a consensus address, additionally should maybe just take in the pubkey too
func (Keeper) IterateValidatorMissedBlockBitArray ¶
func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool))
Stored by *validator* address (not operator address)
func (Keeper) IterateValidatorSigningInfos ¶
func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context, handler func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool))
Stored by *validator* address (not operator address)
func (Keeper) MaxEvidenceAge ¶
MaxEvidenceAge - max age for evidence
func (Keeper) MinSignedPerWindow ¶
Downtime slashing threshold
func (Keeper) SetValidatorSigningInfo ¶
func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo)
Stored by *validator* address (not operator address)
func (Keeper) SignedBlocksWindow ¶
SignedBlocksWindow - sliding window for downtime slashing
func (Keeper) SlashFractionDoubleSign ¶
SlashFractionDoubleSign
type MissedBlock ¶
type MissedBlock = types.MissedBlock
type QuerySigningInfoParams ¶
type QuerySigningInfoParams = types.QuerySigningInfoParams
type QuerySigningInfosParams ¶
type QuerySigningInfosParams = types.QuerySigningInfosParams
type ValidatorSigningInfo ¶
type ValidatorSigningInfo = types.ValidatorSigningInfo