types

package
v0.0.0-...-0e23608 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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
)
View Source
const (
	QueryListScavenge = "list-scavenge"
	QueryGetScavenge  = "get-scavenge"
)
View Source
const (
	QueryListCommit = "list-commit"
	QueryGetCommit  = "get-commit"
)
View Source
const (
	CommitPrefix = "commit-"
)
View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const RevealSolutionConst = "RevealSolution"

RevealSolutionConst is RevealSolution Constant

View Source
const (
	ScavengePrefix = "scavenge-"
)

Variables

View Source
var (
	ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for scavenge module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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"`
}

func (Commit) String

func (c Commit) String() string

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) Route

func (msg MsgRevealSolution) Route() string

nolint

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 NewParams

func NewParams() Params

NewParams creates a new Params object

func (*Params) ParamSetPairs

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

ParamSetPairs - Implements params.ParamSet

func (Params) String

func (p Params) String() string

String implements the stringer interface for Params

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"`
}

func (Scavenge) String

func (s Scavenge) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL