wasm

package
v9.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	HasMore   bool     `json:"has_more"`
	Variables []string `json:"variables"`
	Results   []Result `json:"results"`
}

Answer denotes the Answer element JSON representation in an AskResponse for wasm custom query purpose, it redefines the existing generated type from proto to ensure a dedicated serialization logic.

type AskQuery

type AskQuery struct {
	Program string        `json:"program"`
	Query   string        `json:"query"`
	Limit   *sdkmath.Uint `json:"limit"`
}

AskQuery implements the wasm custom Ask query JSON schema, it basically redefined the Ask gRPC request parameters to keep control in case of eventual breaking change in the logic module definition, and to decouple the serialization logic.

type AskResponse

type AskResponse struct {
	Height     uint64  `json:"height"`
	GasUsed    uint64  `json:"gas_used"`
	Answer     *Answer `json:"answer,omitempty"`
	UserOutput string  `json:"user_output,omitempty"`
}

AskResponse implements the Ask query response JSON schema in a wasm custom query purpose, it redefines the existing generated type from proto to ensure a dedicated serialization logic.

type LogicQuerier

type LogicQuerier struct {
	// contains filtered or unexported fields
}

LogicQuerier ease the bridge between the logic module with the wasm CustomQuerier to allow wasm contracts to query the logic module.

func MakeLogicQuerier

func MakeLogicQuerier(keeper *keeper.Keeper) LogicQuerier

MakeLogicQuerier creates a new LogicQuerier based on the logic keeper.

func (LogicQuerier) Ask

func (querier LogicQuerier) Ask(ctx sdk.Context, query AskQuery) ([]byte, error)

Ask is a proxy method with the gRPC request, returning the result in the json format.

type Result

type Result struct {
	Error         string         `json:"error,omitempty"`
	Substitutions []Substitution `json:"substitutions"`
}

Result denotes the Result element JSON representation in an AskResponse for wasm custom query purpose, it redefines the existing generated type from proto to ensure a dedicated serialization logic.

type Substitution

type Substitution struct {
	Variable   string `json:"variable"`
	Expression string `json:"expression"`
}

Substitution denotes the Substitution element JSON representation in an AskResponse for wasm custom query purpose, it redefines the existing generated type from proto to ensure a dedicated serialization logic.

Jump to

Keyboard shortcuts

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