provwasm

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 43 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 ConvertProtoToJSONMarshal added in v1.15.0

func ConvertProtoToJSONMarshal(protoResponseType codec.ProtoMarshaler, bz []byte, cdc codec.Codec) ([]byte, error)

ConvertProtoToJsonMarshal unmarshals the given bytes into a proto message and then marshals it to json. This is done so that clients calling stargate queries do not need to define their own proto unmarshalers, being able to use response directly by json marshaling, which is supported in cosmwasm.

func Dispatch added in v1.8.0

Dispatch sends an operation to the chain using a given account/funds on account for fees. Failures on the server side are handled as no-op msg operations with the error string as the status/response. Ideally this would live in wasmd

func GetStargateWhitelistedPaths added in v1.15.0

func GetStargateWhitelistedPaths() (keys []string)

func GetWhitelistedQuery added in v1.15.0

func GetWhitelistedQuery(queryPath string) (codec.ProtoMarshaler, error)

GetWhitelistedQuery returns the whitelisted query at the provided path. If the query does not exist, or it was setup wrong by the chain, this returns an error.

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, queryRouter baseapp.GRPCQueryRouter, codec codec.Codec) *wasm.QueryPlugins

QueryPlugins provides provenance query support for smart contracts.

func SimulateActivateMarker added in v1.8.0

func SimulateActivateMarker(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateFinalizeMarker added in v1.8.0

func SimulateFinalizeMarker(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateMsgAddAccess added in v1.8.0

func SimulateMsgAddAccess(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateMsgAddMarker added in v1.8.0

func SimulateMsgAddMarker(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateMsgBindName added in v1.8.0

func SimulateMsgBindName(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, count *int) simtypes.Operation

SimulateMsgBindName will bind a NAME under an existing name

func SimulateMsgExecuteContract added in v1.8.0

func SimulateMsgExecuteContract(ak authkeeper.AccountKeeperI, bk bankkeeper.ViewKeeper, _, consumer simtypes.Account, contractAddr string) simtypes.Operation

func SimulateMsgInstantiateContract added in v1.8.0

func SimulateMsgInstantiateContract(ak authkeeper.AccountKeeperI, bk bankkeeper.ViewKeeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateMsgStoreContract added in v1.8.0

func SimulateMsgStoreContract(ak authkeeper.AccountKeeperI, bk bankkeeper.ViewKeeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func SimulateMsgWithdrawRequest added in v1.8.0

func SimulateMsgWithdrawRequest(ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, node, feebucket, merchant, consumer simtypes.Account, name string) simtypes.Operation

func StargateQuerier added in v1.15.0

func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func(ctx sdk.Context, request *wasmvmtypes.StargateQuery) ([]byte, error)

StargateQuerier dispatches whitelisted stargate queries

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).

type Wrapper added in v1.8.0

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

func NewWrapper added in v1.8.0

func NewWrapper(cdc codec.Codec, keeper *wasm.Keeper, validatorSetSource keeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper) *Wrapper

func (Wrapper) GenerateGenesisState added in v1.8.0

func (pw Wrapper) GenerateGenesisState(input *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the wasm module.

func (Wrapper) ProposalContents added in v1.8.0

func (pw Wrapper) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents doesn't return any content functions for governance proposals.

func (Wrapper) RandomizedParams added in v1.8.0

func (pw Wrapper) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange

RandomizedParams returns empty list as the params don't change

func (Wrapper) RegisterStoreDecoder added in v1.8.0

func (pw Wrapper) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for supply module's types

func (Wrapper) WeightedOperations added in v1.8.0

func (pw Wrapper) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the provwasm operations with their respective weights.

Jump to

Keyboard shortcuts

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