helpers

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCodec

func RegisterCodec(codec *codec.Codec)

Types

type Auxiliaries

type Auxiliaries interface {
	Get(string) Auxiliary
	GetList() []Auxiliary
}

type Auxiliary

type Auxiliary interface {
	GetName() string
	GetKeeper() AuxiliaryKeeper
	Initialize(Mapper, Parameters, ...interface{}) Auxiliary
}

type AuxiliaryKeeper

type AuxiliaryKeeper interface {
	Help(sdkTypes.Context, AuxiliaryRequest) AuxiliaryResponse
	Keeper
}

type AuxiliaryRequest

type AuxiliaryRequest interface {
	Request
}

type AuxiliaryResponse

type AuxiliaryResponse interface {
	Response
}

type Block

type Block interface {
	Begin(sdkTypes.Context, abciTypes.RequestBeginBlock)
	End(sdkTypes.Context, abciTypes.RequestEndBlock)
	Initialize(Mapper, Parameters, ...interface{}) Block
}

type CLICommand

type CLICommand interface {
	ReadInt64(CLIFlag) int64
	ReadInt(CLIFlag) int
	ReadBool(CLIFlag) bool
	ReadString(CLIFlag) string
	ReadBaseReq(context.CLIContext) rest.BaseReq

	CreateCommand(func(command *cobra.Command, args []string) error) *cobra.Command
}

type CLIFlag

type CLIFlag interface {
	GetName() string
	GetValue() interface{}
	Register(*cobra.Command)
	ReadCLIValue() interface{}
}

type Collection

type Collection interface {
	GetKey() Key
	Get(Key) Mappable
	GetList() []Mappable

	Iterate(Key, func(Mappable) bool)
	Fetch(Key) Collection
	Add(Mappable) Collection
	Remove(Mappable) Collection
	Mutate(Mappable) Collection
	Initialize(sdkTypes.Context, Mapper) Collection
}

Collection a list of mappable with create CRUD methods

type Genesis

type Genesis interface {
	Default() Genesis
	Validate() error
	Import(sdkTypes.Context, Mapper, Parameters)
	Export(sdkTypes.Context, Mapper, Parameters) Genesis

	Encode() []byte
	Decode([]byte) Genesis

	Initialize([]Mappable, []parameters.Parameter) Genesis

	GetParameterList() []parameters.Parameter
	GetMappableList() []Mappable
}

type Keeper

type Keeper interface {
	Initialize(Mapper, Parameters, []interface{}) Keeper
}

type Key

type Key interface {
	String() string
	GenerateStoreKeyBytes() []byte
	// TODO Check is register codec is still required
	RegisterCodec(*codec.Codec)
	IsPartial() bool
	// TODO ** check all key impls
	Equals(Key) bool
}

Key SHOULD be derivable from the object it is referencing and SHOULD not be totally arbitrary or sequential

type Mappable

type Mappable interface {
	GetKey() Key
	RegisterCodec(*codec.Codec)
}

type Mapper

type Mapper interface {
	NewCollection(sdkTypes.Context) Collection

	Create(sdkTypes.Context, Mappable)
	Read(sdkTypes.Context, Key) Mappable
	Update(sdkTypes.Context, Mappable)
	Delete(sdkTypes.Context, Key)
	Iterate(sdkTypes.Context, Key, func(Mappable) bool)
	ReverseIterate(sdkTypes.Context, Key, func(Mappable) bool)

	StoreDecoder(*codec.Codec, kv.Pair, kv.Pair) string

	Initialize(*sdkTypes.KVStoreKey) Mapper
}

type Message

type Message interface {
	// TODO check if register message code is required
	RegisterCodec(*codec.Codec)
	sdkTypes.Msg
}

type Module

type Module interface {
	sdkTypesModule.AppModuleBasic
	sdkTypesModule.AppModule
	sdkTypesModule.AppModuleSimulation

	GetAuxiliary(string) Auxiliary

	DecodeModuleTransactionRequest(string, json.RawMessage) (sdkTypes.Msg, error)

	Initialize(*sdkTypes.KVStoreKey, params.Subspace, ...interface{}) Module
}

type Parameters

type Parameters interface {
	String() string

	Validate() error
	Equal(Parameters) bool

	Get(ids.ID) parameters.Parameter
	GetList() []parameters.Parameter

	Fetch(sdkTypes.Context, ids.ID) Parameters
	Mutate(sdkTypes.Context, parameters.Parameter) Parameters

	GetKeyTable() subspace.KeyTable
	subspace.ParamSet

	Initialize(params.Subspace) Parameters
}

type Queries

type Queries interface {
	Get(string) Query
	GetList() []Query
}

type Query

type Query interface {
	GetName() string
	Command(*codec.Codec) *cobra.Command
	HandleMessage(sdkTypes.Context, abciTypes.RequestQuery) ([]byte, error)
	RESTQueryHandler(context.CLIContext) http.HandlerFunc
	Initialize(Mapper, Parameters, ...interface{}) Query
}

type QueryKeeper

type QueryKeeper interface {
	Enquire(sdkTypes.Context, QueryRequest) QueryResponse
	Keeper
}

type QueryRequest

type QueryRequest interface {
	Request
	FromCLI(CLICommand, context.CLIContext) (QueryRequest, error)
	FromMap(map[string]string) (QueryRequest, error)
	Encode() ([]byte, error)
	Decode([]byte) (QueryRequest, error)
}

type QueryResponse

type QueryResponse interface {
	Response
	Encode() ([]byte, error)
	Decode([]byte) (QueryResponse, error)
}

type Request

type Request interface {
	Validate() error
}

type Response

type Response interface {
	IsSuccessful() bool
	GetError() error
}

type Simulator

type Simulator interface {
	RandomizedGenesisState(*module.SimulationState)
	WeightedOperations(simulation.AppParams, *codec.Codec) simulation.WeightedOperations
	WeightedProposalContentList() []simulation.WeightedProposalContent
	ParamChangeList(*rand.Rand) []simulation.ParamChange
}

type StoreKeyPrefix added in v0.3.0

type StoreKeyPrefix interface {
	// TODO define types and use key and storeKey
	GenerateStoreKey(key []byte) []byte
}

type Transaction

type Transaction interface {
	GetName() string
	Command(*codec.Codec) *cobra.Command
	HandleMessage(sdkTypes.Context, sdkTypes.Msg) (*sdkTypes.Result, error)
	RESTRequestHandler(context.CLIContext) http.HandlerFunc
	RegisterCodec(*codec.Codec)
	DecodeTransactionRequest(json.RawMessage) (sdkTypes.Msg, error)
	InitializeKeeper(Mapper, Parameters, ...interface{}) Transaction
}

type TransactionKeeper

type TransactionKeeper interface {
	Transact(sdkTypes.Context, sdkTypes.Msg) TransactionResponse
	Keeper
}

type TransactionRequest

type TransactionRequest interface {
	GetBaseReq() rest.BaseReq

	FromCLI(CLICommand, context.CLIContext) (TransactionRequest, error)
	FromJSON(json.RawMessage) (TransactionRequest, error)
	MakeMsg() (sdkTypes.Msg, error)
	RegisterCodec(*codec.Codec)
	Request
}

type TransactionResponse

type TransactionResponse interface {
	Response
}

type Transactions

type Transactions interface {
	Get(string) Transaction
	GetList() []Transaction
}

type WasmMessage

type WasmMessage interface {
	GetType() string
	GetRawMessage() json.RawMessage
}

type WasmMessagePrototype

type WasmMessagePrototype func() WasmMessage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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