provwasm

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package provwasm allows CosmWasm smart contracts to communicate with custom provenance modules.

Package provwasm allows CosmWasm smart contracts to communicate with custom provenance modules.

Package provwasm allows CosmWasm smart contracts to communicate with custom provenance modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageEncoders

func MessageEncoders(registry *EncoderRegistry, logger log.Logger) *wasm.MessageEncoders

MessageEncoders provides provenance message encoding support for smart contracts.

func QueryPlugins

func QueryPlugins(registry *QuerierRegistry) *wasm.QueryPlugins

QueryPlugins provides provenance query support for smart contracts.

Types

type EncodeRequest

type EncodeRequest struct {
	RequestFields
}

EncodeRequest is the top-level type for provenance message encoding support in CosmWasm smart contracts.

type Encoder

type Encoder func(contract sdk.AccAddress, data json.RawMessage, version string) ([]sdk.Msg, error)

Encoder describes behavior for provenance smart contract message encoding. The contract address must ALWAYS be set as the Msg signer.

type EncoderRegistry

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

EncoderRegistry maps routes to encoders.

func NewEncoderRegistry

func NewEncoderRegistry() *EncoderRegistry

NewEncoderRegistry creates a new registry for message encoders.

func (*EncoderRegistry) RegisterEncoder

func (qr *EncoderRegistry) RegisterEncoder(route string, encoder Encoder)

RegisterEncoder adds a message encoder for the given route.

type Querier

type Querier func(ctx sdk.Context, query json.RawMessage, version string) ([]byte, error)

Querier describes behavior for provenance smart contract query support.

type QuerierRegistry

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

QuerierRegistry maps routes to queriers.

func NewQuerierRegistry

func NewQuerierRegistry() *QuerierRegistry

NewQuerierRegistry creates a new registry for queriers.

func (*QuerierRegistry) RegisterQuerier

func (qr *QuerierRegistry) RegisterQuerier(route string, querier Querier)

RegisterQuerier adds a query handler for the given route.

type QueryRequest

type QueryRequest struct {
	RequestFields
}

QueryRequest is the top-level type for provenance query support in CosmWasm smart contracts.

type RequestFields

type RequestFields struct {
	// The router key of the module
	Route string `json:"route"`
	// The module-specific inputs represented as JSON.
	Params json.RawMessage `json:"params"`
	// Enables smart contract backwards compatibility.
	Version string `json:"version,omitempty"`
}

RequestFields contains fields shared between query requests and encode requests. Version should be the semantic data format version of the provenance rust bindings (eg 1.2.3).

Jump to

Keyboard shortcuts

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