utils

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIQueryJSONPrint

func CLIQueryJSONPrint(cdc *codec.Codec, uri string, data []byte, rstTypeFactory func() interface{}) error

func Load

func Load(filepath string, cdc *codec.Codec, factory func() interface{}) (interface{}, error)

Load import and unmarshal by cdc json unmarshal.

func Save added in v0.4.0

func Save(filepath string, cdc *codec.Codec, state interface{}) error

Save save the state to file, using codec json marshal.

func SimpleQueryCmd added in v0.6.3

func SimpleQueryCmd(use, short, route, store string, nargs int, rstPointer interface{}) func(*codec.Codec) *cobra.Command

Types

type QueryResolver added in v0.6.3

type QueryResolver = func(ctx sdk.Context, cdc *wire.Codec, path []string) ([]byte, sdk.Error)

return query result

func NewQueryResolver added in v0.6.3

func NewQueryResolver(numArgs int, resolver StoreQuerier) QueryResolver

type StoreMap added in v0.4.0

type StoreMap map[string]SubStore

func NewStoreMap added in v0.4.0

func NewStoreMap(ss []SubStore) StoreMap

type StoreQuerier added in v0.6.3

type StoreQuerier = func(args ...string) (interface{}, sdk.Error)

query store

type SubStore added in v0.4.0

type SubStore struct {
	Store      sdk.KVStore
	Prefix     []byte
	ValCreator ValueCreator
	Decoder    Unmarshaler
	NoValue    bool
}

func (SubStore) Iterate added in v0.4.0

func (s SubStore) Iterate(reactor ValueReactor)

type Unmarshaler added in v0.4.0

type Unmarshaler = func(bz []byte, rst interface{})

type ValueCreator added in v0.4.0

type ValueCreator = func() interface{}

type ValueReactor added in v0.4.0

type ValueReactor = func(key []byte, val interface{}) bool

Jump to

Keyboard shortcuts

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