Documentation ¶
Index ¶
Constants ¶
View Source
const ( AttributeKeyNonce = "nonce" ActionPenalty = "penalty" AttributeValueGuardFailure = "guard_failure" AttributeValueDepositBurn = "deposit_burn" )
View Source
const ( // module name ModuleName = "slash" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
View Source
const ( QueryPenalty = "penalty" QueryPenaltyRequest = "penalty-request" QueryParameters = "parameters" )
View Source
const (
DefaultSignedBlocksWindow = 100
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file
Variables ¶
View Source
var ( PenaltyKeyPrefix = []byte{0x11} // Key prefix for Penalty PenaltyNonceKey = []byte{0x12} // Key for Penalty nonce )
View Source
var ( DefaultMinSignedPerWindow = sdk.NewDecWithPrec(5, 1) DefaultSlashFractionDoubleSign = sdk.NewDec(1).Quo(sdk.NewDec(20)) DefaultSlashFractionDowntime = sdk.NewDec(1).Quo(sdk.NewDec(100)) DefaultSlashFractionGuardFailure = sdk.NewDec(1).Quo(sdk.NewDec(100)) DefaultFallbackGuardReward = sdk.NewDec(1).Quo(sdk.NewDec(2)) )
slash params default values
View Source
var ( KeySignedBlocksWindow = []byte("SignedBlocksWindow") KeyMinSignedPerWindow = []byte("MinSignedPerWindow") KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign") KeySlashFractionDowntime = []byte("SlashFractionDowntime") KeySlashFractionGuardFailure = []byte("SlashFractionGuardFailure") KeyFallbackGuardReward = []byte("FallbackGuardReward") )
nolint - Keys for parameter access
View Source
var ModuleCdc = codec.New()
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type AccountAmtPair ¶
func NewAccountAmtPair ¶
func NewAccountAmtPair(account string, amount sdk.Int) AccountAmtPair
func (AccountAmtPair) String ¶
func (amp AccountAmtPair) String() string
type AccountFractionPair ¶
type AccountFractionPair struct { Account string `json:"account"` Fraction sdk.Dec `json:"percent"` }
func NewAccountFractionPair ¶
func NewAccountFractionPair(account string, fraction sdk.Dec) AccountFractionPair
type MsgSignPenalty ¶
type MsgSignPenalty struct { Nonce uint64 `json:"nonce"` Sig []byte `json:"sig"` Sender sdk.AccAddress `json:"sender"` }
func NewMsgSignPenalty ¶
func NewMsgSignPenalty(nonce uint64, sig []byte, sender sdk.AccAddress) MsgSignPenalty
func (MsgSignPenalty) GetSignBytes ¶
func (msg MsgSignPenalty) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSignPenalty) GetSigners ¶
func (msg MsgSignPenalty) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSignPenalty) Route ¶
func (msg MsgSignPenalty) Route() string
Route should return the name of the module
func (MsgSignPenalty) ValidateBasic ¶
func (msg MsgSignPenalty) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type Params ¶
type Params struct { SignedBlocksWindow int64 `json:"signed_blocks_window" yaml:"signed_blocks_window"` MinSignedPerWindow sdk.Dec `json:"min_signed_per_window" yaml:"min_signed_per_window"` SlashFractionDoubleSign sdk.Dec `json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"` SlashFractionDowntime sdk.Dec `json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"` SlashFractionGuardFailure sdk.Dec `json:"slash_fraction_guard_failure" yaml:"slash_fraction_guard_failure"` FallbackGuardReward sdk.Dec `json:"fallback_guard_reward" yaml:"fallback_guard_reward"` }
Params defines the high level settings for slash
func MustUnmarshalParams ¶
unmarshal the current slash params value from store key or panic
func NewParams ¶
func NewParams(signedBlocksWindow int64, minSignedPerWindow, slashFractionDoubleSign, slashFractionDowntime, slashFractionGuardFailure, fallbackGuardReward sdk.Dec) Params
NewParams creates a new Params instance
func UnmarshalParams ¶
unmarshal the current slash params value from store key
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type Penalty ¶
type Penalty struct { Nonce uint64 `json:"nonce"` ValidatorAddr string `json:"validator_addr"` Reason string `json:"reason"` PenalizedDelegators []AccountAmtPair `json:"penalized_delegators"` Beneficiaries []AccountFractionPair `json:"beneficiaries"` PenaltyProtoBytes []byte `json:"penalty_proto_bytes"` Sigs []common.Sig `json:"sigs"` }
func (*Penalty) GenerateProtoBytes ¶
func (p *Penalty) GenerateProtoBytes()
func (Penalty) GetPenaltyRequest ¶
Generate penaltyRequest msg
type QueryPenaltyParams ¶
type QueryPenaltyParams struct {
Nonce uint64
}
func NewQueryPenaltyParams ¶
func NewQueryPenaltyParams(nonce uint64) QueryPenaltyParams
Source Files ¶
Click to show internal directories.
Click to hide internal directories.