Documentation
¶
Index ¶
- Constants
- func LoadABI() (abi.ABI, error)
- func ParseSigningInfoArgs(args []interface{}) (*slashingtypes.QuerySigningInfoRequest, error)
- func ParseSigningInfosArgs(method *abi.Method, args []interface{}) (*slashingtypes.QuerySigningInfosRequest, error)
- type EventValidatorUnjailed
- type Params
- type ParamsOutput
- type Precompile
- func (p Precompile) EmitValidatorUnjailedEvent(ctx sdk.Context, stateDB vm.StateDB, validator common.Address) error
- func (p *Precompile) GetParams(ctx sdk.Context, method *abi.Method, _ *vm.Contract, _ []interface{}) ([]byte, error)
- func (p *Precompile) GetSigningInfo(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (p *Precompile) GetSigningInfos(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- func (p Precompile) Unjail(ctx sdk.Context, method *abi.Method, stateDB vm.StateDB, _ *vm.Contract, ...) ([]byte, error)
- type SigningInfo
- type SigningInfoOutput
- type SigningInfosInput
- type SigningInfosOutput
- type ValidatorUnjailed
Constants ¶
const ( // GetSigningInfoMethod defines the ABI method name for the slashing SigningInfo query GetSigningInfoMethod = "getSigningInfo" // GetSigningInfosMethod defines the ABI method name for the slashing SigningInfos query GetSigningInfosMethod = "getSigningInfos" // GetParamsMethod defines the ABI method name for the slashing Params query GetParamsMethod = "getParams" )
const (
// EventTypeValidatorUnjailed defines the event type for validator unjailing
EventTypeValidatorUnjailed = "ValidatorUnjailed"
)
const ( // UnjailMethod defines the ABI method name for the slashing Unjail // transaction. UnjailMethod = "unjail" )
Variables ¶
This section is empty.
Functions ¶
func LoadABI ¶
LoadABI loads the slashing ABI from the embedded abi.json file for the slashing precompile.
func ParseSigningInfoArgs ¶
func ParseSigningInfoArgs(args []interface{}) (*slashingtypes.QuerySigningInfoRequest, error)
ParseSigningInfoArgs parses the arguments for the signing info query
func ParseSigningInfosArgs ¶
func ParseSigningInfosArgs(method *abi.Method, args []interface{}) (*slashingtypes.QuerySigningInfosRequest, error)
ParseSigningInfosArgs parses the arguments for the signing infos query
Types ¶
type EventValidatorUnjailed ¶
Add this struct after the existing constants
type Params ¶
type Params struct { SignedBlocksWindow uint64 `abi:"signedBlocksWindow"` MinSignedPerWindow string `abi:"minSignedPerWindow"` DowntimeJailDuration uint64 `abi:"downtimeJailDuration"` SlashFractionDoubleSign string `abi:"slashFractionDoubleSign"` SlashFractionDowntime string `abi:"slashFractionDowntime"` }
Params defines the parameters for the slashing module
type ParamsOutput ¶
type ParamsOutput struct {
Params Params
}
ParamsOutput represents the output of the params query
func (*ParamsOutput) FromResponse ¶
func (po *ParamsOutput) FromResponse(res *slashingtypes.QueryParamsResponse) *ParamsOutput
type Precompile ¶
type Precompile struct { cmn.Precompile // contains filtered or unexported fields }
Precompile defines the precompiled contract for slashing.
func NewPrecompile ¶
func NewPrecompile( slashingKeeper slashingkeeper.Keeper, authzKeeper authzkeeper.Keeper, ) (*Precompile, error)
NewPrecompile creates a new slashing Precompile instance as a PrecompiledContract interface.
func (Precompile) EmitValidatorUnjailedEvent ¶
func (p Precompile) EmitValidatorUnjailedEvent(ctx sdk.Context, stateDB vm.StateDB, validator common.Address) error
EmitValidatorUnjailedEvent emits the ValidatorUnjailed event
func (*Precompile) GetParams ¶
func (p *Precompile) GetParams( ctx sdk.Context, method *abi.Method, _ *vm.Contract, _ []interface{}, ) ([]byte, error)
GetParams implements the query to get the slashing parameters.
func (*Precompile) GetSigningInfo ¶
func (p *Precompile) GetSigningInfo( ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}, ) ([]byte, error)
GetSigningInfo implements the query to get a validator's signing info.
func (*Precompile) GetSigningInfos ¶
func (p *Precompile) GetSigningInfos( ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}, ) ([]byte, error)
GetSigningInfos implements the query to get signing info for all validators.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
Available slashing transactions are: - Unjail
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas calculates the precompiled contract's base gas rate.
type SigningInfo ¶
type SigningInfo struct { ValidatorAddress common.Address `abi:"validatorAddress"` StartHeight uint64 `abi:"startHeight"` IndexOffset uint64 `abi:"indexOffset"` JailedUntil uint64 `abi:"jailedUntil"` Tombstoned bool `abi:"tombstoned"` MissedBlocksCounter uint64 `abi:"missedBlocksCounter"` }
SigningInfo represents the signing info for a validator
type SigningInfoOutput ¶
type SigningInfoOutput struct {
SigningInfo SigningInfo
}
SigningInfoOutput represents the output of the signing info query
func (*SigningInfoOutput) FromResponse ¶
func (sio *SigningInfoOutput) FromResponse(res *slashingtypes.QuerySigningInfoResponse) *SigningInfoOutput
type SigningInfosInput ¶
type SigningInfosInput struct {
Pagination query.PageRequest `abi:"pagination"`
}
SigningInfosInput represents the input for the signing infos query
type SigningInfosOutput ¶
type SigningInfosOutput struct { SigningInfos []SigningInfo `abi:"signingInfos"` PageResponse query.PageResponse `abi:"pageResponse"` }
SigningInfosOutput represents the output of the signing infos query
func (*SigningInfosOutput) FromResponse ¶
func (sio *SigningInfosOutput) FromResponse(res *slashingtypes.QuerySigningInfosResponse) *SigningInfosOutput
type ValidatorUnjailed ¶
ValidatorUnjailed defines the data structure for the ValidatorUnjailed event.