Documentation ¶
Index ¶
Constants ¶
const ( // TODO: Create your event types // EventType<Action> = "action" EventTypeCreateScavenge = "CreateScavenge" EventTypeCommitSolution = "CommitSolution" EventTypeSolveScavenge = "SolveScavenge" // TODO: Create keys fo your events, the values will be derivided from the msg // AttributeKeyAddress = "address" AttributeDescription = "description" AttributeSolution = "solution" AttributeSolutionHash = "solutionHash" AttributeReward = "reward" AttributeScavenger = "scavenger" AttributeSolutionScavengerHash = "solutionScavengerHash" AttributeValueCategory = ModuleName )
scavenge module event types
const ( // ModuleName is the name of the module ModuleName = "scavenge" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for querier msgs QuerierRoute = ModuleName )
const ( QueryListScavenge = "list-scavenge" QueryGetScavenge = "get-scavenge" )
const ( QueryListCommit = "list-commit" QueryGetCommit = "get-commit" )
const (
CommitPrefix = "commit-"
)
const (
DefaultParamspace = ModuleName
)
Default parameter namespace
const RevealSolutionConst = "RevealSolution"
RevealSolutionConst is RevealSolution Constant
const (
ScavengePrefix = "scavenge-"
)
Variables ¶
var (
ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
var ModuleCdc *codec.Codec
ModuleCdc defines the module codec
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the scavenge genesis parameters
Types ¶
type Commit ¶
type Commit struct { Scavenger sdk.AccAddress `json:"scavenger" yaml:"scavenger"` SolutionHash string `json:"solutionHash" yaml:"solutionHash"` SolutionScavengerHash string `json:"solutionScavengerHash" yaml:"solutionScavengerHash"` }
type GenesisState ¶
type GenesisState struct { }
GenesisState - all scavenge state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func NewGenesisState ¶
func NewGenesisState() GenesisState
NewGenesisState creates a new GenesisState object
type MsgCommitSolution ¶
type MsgCommitSolution struct { Scavenger sdk.AccAddress `json:"scavenger" yaml:"scavenger"` // address of the scavenger SolutionHash string `json:"solutionhash" yaml:"solutionhash"` // solutionhash of the scavenge SolutionScavengerHash string `json:"solutionScavengerHash" yaml:"solutionScavengerHash"` // solution hash of the scavenge }
func NewMsgCommitSolution ¶
func NewMsgCommitSolution(scavenger sdk.AccAddress, solutionHash string, solutionScavengerHash string) MsgCommitSolution
NewMsgCommitSolution creates a new MsgCommitSolution instance
func (MsgCommitSolution) GetSignBytes ¶
func (msg MsgCommitSolution) GetSignBytes() []byte
func (MsgCommitSolution) GetSigners ¶
func (msg MsgCommitSolution) GetSigners() []sdk.AccAddress
func (MsgCommitSolution) Route ¶
func (msg MsgCommitSolution) Route() string
func (MsgCommitSolution) Type ¶
func (msg MsgCommitSolution) Type() string
func (MsgCommitSolution) ValidateBasic ¶
func (msg MsgCommitSolution) ValidateBasic() error
type MsgCreateScavenge ¶
type MsgCreateScavenge struct { Creator sdk.AccAddress `json:"creator" yaml:"creator"` Description string `json:"description" yaml:"description"` SolutionHash string `json:"solutionHash" yaml:"solutionHash"` Reward sdk.Coins `json:"reward" yaml:"reward"` }
func NewMsgCreateScavenge ¶
func NewMsgCreateScavenge(creator sdk.AccAddress, description string, solutionHash string, reward sdk.Coins) MsgCreateScavenge
func (MsgCreateScavenge) GetSignBytes ¶
func (msg MsgCreateScavenge) GetSignBytes() []byte
func (MsgCreateScavenge) GetSigners ¶
func (msg MsgCreateScavenge) GetSigners() []sdk.AccAddress
func (MsgCreateScavenge) Route ¶
func (msg MsgCreateScavenge) Route() string
func (MsgCreateScavenge) Type ¶
func (msg MsgCreateScavenge) Type() string
func (MsgCreateScavenge) ValidateBasic ¶
func (msg MsgCreateScavenge) ValidateBasic() error
type MsgRevealSolution ¶
type MsgRevealSolution struct { Scavenger sdk.AccAddress `json:"scavenger" yaml:"scavenger"` // address of the scavenger scavenger SolutionHash string `json:"solutionHash" yaml:"solutionHash"` // SolutionHash of the scavenge Solution string `json:"solution" yaml:"solution"` // solution of the scavenge }
MsgRevealSolution - struct for unjailing jailed validator
func NewMsgRevealSolution ¶
func NewMsgRevealSolution(scavenger sdk.AccAddress, solution string) MsgRevealSolution
NewMsgRevealSolution creates a new MsgRevealSolution instance
func (MsgRevealSolution) GetSignBytes ¶
func (msg MsgRevealSolution) GetSignBytes() []byte
GetSignBytes gets the bytes for the message signer to sign on
func (MsgRevealSolution) GetSigners ¶
func (msg MsgRevealSolution) GetSigners() []sdk.AccAddress
func (MsgRevealSolution) Type ¶
func (msg MsgRevealSolution) Type() string
func (MsgRevealSolution) ValidateBasic ¶
func (msg MsgRevealSolution) ValidateBasic() error
ValidateBasic validity check for the AnteHandler
type ParamSubspace ¶
type ParamSubspace interface { WithKeyTable(table params.KeyTable) params.Subspace Get(ctx sdk.Context, key []byte, ptr interface{}) GetParamSet(ctx sdk.Context, ps params.ParamSet) SetParamSet(ctx sdk.Context, ps params.ParamSet) }
ParamSubspace defines the expected Subspace interfacace
type Params ¶
type Params struct { }
Params - used for initializing default parameter for scavenge at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet
type Scavenge ¶
type Scavenge struct { Creator sdk.AccAddress `json:"creator" yaml:"creator"` Description string `json:"description" yaml:"description"` SolutionHash string `json:"solutionHash" yaml:"solutionHash"` Reward sdk.Coins `json:"reward" yaml:"reward"` Solution string `json:"solution" yaml:"solution"` Scavenger sdk.AccAddress `json:"scavenger" yaml:"scavenger"` }