types

package
v0.0.0-...-b8831ae Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreateScavenge = "CreateScavenge"
	EventTypeCommitSolution = "CommitSolution"
	EventTypeSolveScavenge  = "SolveScavenge"

	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 = ModuleName

	ScavengePrefix = "sk-"
	CommitPrefix   = "ck-"
)
View Source
const (
	QueryListScavenges = "list"
	QueryGetScavenge   = "get"
	QueryCommit        = "commit"
)

query endpoints supported by the nameservice Querier

View Source
const CommitSolutionConst = "CommitSolution"

CommitSolutionConst is CommitSolution Constant

View Source
const CreateScavengeConst = "CreateScavenge"

CreateScavengeConst is CreateScavenge Constant

View Source
const (
	DefaultParamspace = ModuleName
)

Default parameter namespace

View Source
const RevealSolutionConst = "RevealSolution"

RevealSolutionConst is RevealSolution Constant

Variables

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"`                         // address of the scavenger scavenger
	SolutionHash          string         `json:"solutionHash" yaml:"solutionHash"`                   // SolutionHash of the scavenge
	SolutionScavengerHash string         `json:"solutionScavengerHash" yaml:"solutionScavengerHash"` // solution hash of the scavenge
}

Commit is the commit struct

func (Commit) String

func (c Commit) String() string

implement fmt.Stringer

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
}

MsgCommitSolution - struct for unjailing jailed validator

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

GetSignBytes gets the bytes for the message signer to sign on

func (MsgCommitSolution) GetSigners

func (msg MsgCommitSolution) GetSigners() []sdk.AccAddress

func (MsgCommitSolution) Route

func (msg MsgCommitSolution) Route() string

nolint

func (MsgCommitSolution) Type

func (msg MsgCommitSolution) Type() string

func (MsgCommitSolution) ValidateBasic

func (msg MsgCommitSolution) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

type MsgCreateScavenge

type MsgCreateScavenge struct {
	Creator      sdk.AccAddress `json:"creator" yaml:"creator"`           // address of the scavenger creator
	Description  string         `json:"description" yaml:"description"`   // description of the scavenge
	SolutionHash string         `json:"solutionHash" yaml:"solutionHash"` // solution hash of the scavenge
	Reward       sdk.Coins      `json:"reward" yaml:"reward"`             // reward of the scavenger
}

MsgCreateScavenge - struct for unjailing jailed validator

func NewMsgCreateScavenge

func NewMsgCreateScavenge(creator sdk.AccAddress, description, solutionHash string, reward sdk.Coins) MsgCreateScavenge

NewMsgCreateScavenge creates a new MsgCreateScavenge instance

func (MsgCreateScavenge) GetSignBytes

func (msg MsgCreateScavenge) GetSignBytes() []byte

GetSignBytes gets the bytes for the message signer to sign on

func (MsgCreateScavenge) GetSigners

func (msg MsgCreateScavenge) GetSigners() []sdk.AccAddress

func (MsgCreateScavenge) Route

func (msg MsgCreateScavenge) Route() string

nolint

func (MsgCreateScavenge) Type

func (msg MsgCreateScavenge) Type() string

func (MsgCreateScavenge) ValidateBasic

func (msg MsgCreateScavenge) ValidateBasic() error

ValidateBasic validity check for the AnteHandler

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 QueryResScavenges

type QueryResScavenges []string

QueryResScavenges Queries Result Payload for a names query

func (QueryResScavenges) String

func (n QueryResScavenges) String() string

implement fmt.Stringer

type Scavenge

type Scavenge struct {
	Creator      sdk.AccAddress `json:"creator" yaml:"creator"`           // address of the scavenger creator
	Description  string         `json:"description" yaml:"description"`   // description of the scavenge
	SolutionHash string         `json:"solutionHash" yaml:"solutionHash"` // solution hash of the scavenge
	Reward       sdk.Coins      `json:"reward" yaml:"reward"`             // reward of the scavenger
	Solution     string         `json:"solution" yaml:"solution"`         // the solution to the scagenve
	Scavenger    sdk.AccAddress `json:"scavenger" yaml:"scavenger"`       // the scavenger who found the solution
}

Scavenge is the Scavenge struct

func (Scavenge) String

func (s Scavenge) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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