types

package
v0.0.0-...-a2f4e79 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName is set to xwasm and not wasmx to avoid Potential key collision between KVStores
	// (see assertNoPrefix in cosmos-sdk/types/store.go)
	ModuleName = "xwasm"
	StoreKey   = ModuleName
	TStoreKey  = "transient_xwasm"
)
View Source
const (
	GasForFeeDeduction     uint64 = 13419
	GasForFeeRefund        uint64 = 13419
	DefaultGasContractCall uint64 = 63558
	MinExecutionGasLimit          = GasForFeeDeduction + GasForFeeRefund + DefaultGasContractCall
)
View Source
const RouterKey = ModuleName
View Source
const (
	TypeMsgExecuteContractCompat = "executeContractCompat"
)
View Source
const (
	TypeMsgInstantiateContractCompat = "instantiateContractCompat"
)

Variables

View Source
var (

	// ModuleCdc references the global x/wasmx module codec. Note, the codec should
	// ONLY be used in certain instances of tests and for JSON encoding as Amino is
	// still used for that purpose.
	//
	// The actual codec used for serialization should be provided to x/wasmx and
	// defined at the application level.
	ModuleCdc = codec.NewAminoCodec(amino)

	// AminoCdc is a amino codec created to support amino JSON compatible msgs.
	AminoCdc = codec.NewAminoCodec(amino)
)
View Source
var (
	ErrInvalidGasLimit        = sdkerrors.Register(ModuleName, 1, "invalid gas limit")
	ErrInvalidGasPrice        = sdkerrors.Register(ModuleName, 2, "invalid gas price")
	ErrInvalidContractAddress = sdkerrors.Register(ModuleName, 3, "invalid contract address")
	ErrAlreadyRegistered      = sdkerrors.Register(ModuleName, 4, "contract already registered")
	ErrDuplicateContract      = sdkerrors.Register(ModuleName, 5, "duplicate contract")
	ErrNoContractAddresses    = sdkerrors.Register(ModuleName, 6, "no contract addresses found")
	ErrInvalidCodeId          = sdkerrors.Register(ModuleName, 7, "invalid code id")
	ErrDeductingGasFees       = sdkerrors.Register(ModuleName, 8, "not possible to deduct gas fees")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ContractsByGasPricePrefix = []byte{0x01} // key to the smart contract execution request ID
	ContractsIndexPrefix      = []byte{0x02}
)
View Source
var (
	NewInt            = sdkmath.NewInt
	ZeroInt           = sdkmath.ZeroInt
	NewUint           = sdkmath.NewUint
	NewUintFromString = func(s string) Uint {
		if s == "" {
			return sdkmath.NewUint(0)
		}

		val := sdkmath.NewUintFromString(s)
		return val
	}
)
View Source
var (
	NewDecWithPrec    = sdkmath.LegacyNewDecWithPrec
	NewDecFromInt     = sdkmath.LegacyNewDecFromInt
	NewDecFromStr     = sdkmath.LegacyNewDecFromStr
	MustNewDecFromStr = sdkmath.LegacyMustNewDecFromStr
)
View Source
var (
	ErrInvalidLengthPacket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPacket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPacket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	DefaultIsExecutionEnabled           = false
	DefaultMaxBeginBlockTotalGas uint64 = 42_000_000                        // 42M
	DefaultMaxContractGasLimit   uint64 = DefaultMaxBeginBlockTotalGas / 12 // 3.5M
	DefaultMinGasPrice           uint64 = 1_000_000_000                     // 1B
)

Wasmx params default values

View Source
var (
	KeyIsExecutionEnabled    = []byte("IsExecutionEnabled")
	KeyMaxBeginBlockTotalGas = []byte("MaxBeginBlockTotalGas")
	KeyMaxContractGasLimit   = []byte("MaxContractGasLimit")
	KeyMinGasPrice           = []byte("MinGasPrice")
)

Parameter keys

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthWasmx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowWasmx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupWasmx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func GetContractsByGasPriceKey

func GetContractsByGasPriceKey(gasPrice uint64, address sdk.AccAddress) []byte

func GetContractsIndexKey

func GetContractsIndexKey(address sdk.AccAddress) []byte

GetContractsIndexKey provides the key for the contract address => gasPrice

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the parameter key table.

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary x/wasmx interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
}

BankKeeper defines the expected bank keeper methods

type Dec

type Dec = sdkmath.LegacyDec

type GenesisState

type GenesisState struct {
	// params defines all the parameters of related to wasmx.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState defines the wasmx module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

func NewGenesisState

func NewGenesisState() GenesisState

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type Int

type Int = sdkmath.Int

type MsgClient

type MsgClient interface {
	ExecuteContractCompat(ctx context.Context, in *MsgExecuteContractCompat, opts ...grpc.CallOption) (*MsgExecuteContractCompatResponse, error)
	InstantiateContractCompat(ctx context.Context, in *MsgInstantiateContractCompat, opts ...grpc.CallOption) (*MsgInstantiateContractCompatResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgExecuteContractCompat

type MsgExecuteContractCompat struct {
	// Sender is the that actor that signed the messages
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// Contract is the address of the smart contract
	Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
	// Msg json encoded message to be passed to the contract
	Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
	// Funds coins that are transferred to the contract on execution
	Funds string `protobuf:"bytes,4,opt,name=funds,proto3" json:"funds,omitempty"`
}

MsgExecuteContractCompat submits the given message data to a smart contract, compatible with EIP712

func (*MsgExecuteContractCompat) Descriptor

func (*MsgExecuteContractCompat) Descriptor() ([]byte, []int)

func (*MsgExecuteContractCompat) GetContract

func (m *MsgExecuteContractCompat) GetContract() string

func (*MsgExecuteContractCompat) GetFunds

func (m *MsgExecuteContractCompat) GetFunds() string

func (*MsgExecuteContractCompat) GetMsg

func (m *MsgExecuteContractCompat) GetMsg() string

func (*MsgExecuteContractCompat) GetSender

func (m *MsgExecuteContractCompat) GetSender() string

func (MsgExecuteContractCompat) GetSignBytes

func (msg MsgExecuteContractCompat) GetSignBytes() []byte

Note ModuleCdc is Amino (see codec.go)

func (MsgExecuteContractCompat) GetSigners

func (msg MsgExecuteContractCompat) GetSigners() []sdk.AccAddress

func (*MsgExecuteContractCompat) Marshal

func (m *MsgExecuteContractCompat) Marshal() (dAtA []byte, err error)

func (*MsgExecuteContractCompat) MarshalTo

func (m *MsgExecuteContractCompat) MarshalTo(dAtA []byte) (int, error)

func (*MsgExecuteContractCompat) MarshalToSizedBuffer

func (m *MsgExecuteContractCompat) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExecuteContractCompat) ProtoMessage

func (*MsgExecuteContractCompat) ProtoMessage()

func (*MsgExecuteContractCompat) Reset

func (m *MsgExecuteContractCompat) Reset()

func (MsgExecuteContractCompat) Route

func (msg MsgExecuteContractCompat) Route() string

func (*MsgExecuteContractCompat) Size

func (m *MsgExecuteContractCompat) Size() (n int)

func (*MsgExecuteContractCompat) String

func (m *MsgExecuteContractCompat) String() string

func (MsgExecuteContractCompat) Type

func (msg MsgExecuteContractCompat) Type() string

func (*MsgExecuteContractCompat) Unmarshal

func (m *MsgExecuteContractCompat) Unmarshal(dAtA []byte) error

func (MsgExecuteContractCompat) ValidateBasic

func (msg MsgExecuteContractCompat) ValidateBasic() error

func (*MsgExecuteContractCompat) XXX_DiscardUnknown

func (m *MsgExecuteContractCompat) XXX_DiscardUnknown()

func (*MsgExecuteContractCompat) XXX_Marshal

func (m *MsgExecuteContractCompat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExecuteContractCompat) XXX_Merge

func (m *MsgExecuteContractCompat) XXX_Merge(src proto.Message)

func (*MsgExecuteContractCompat) XXX_Size

func (m *MsgExecuteContractCompat) XXX_Size() int

func (*MsgExecuteContractCompat) XXX_Unmarshal

func (m *MsgExecuteContractCompat) XXX_Unmarshal(b []byte) error

type MsgExecuteContractCompatResponse

type MsgExecuteContractCompatResponse struct {
	// Data contains bytes to returned from the contract
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

MsgExecuteContractCompatResponse returns execution result data.

func (*MsgExecuteContractCompatResponse) Descriptor

func (*MsgExecuteContractCompatResponse) Descriptor() ([]byte, []int)

func (*MsgExecuteContractCompatResponse) GetData

func (m *MsgExecuteContractCompatResponse) GetData() []byte

func (*MsgExecuteContractCompatResponse) Marshal

func (m *MsgExecuteContractCompatResponse) Marshal() (dAtA []byte, err error)

func (*MsgExecuteContractCompatResponse) MarshalTo

func (m *MsgExecuteContractCompatResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgExecuteContractCompatResponse) MarshalToSizedBuffer

func (m *MsgExecuteContractCompatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExecuteContractCompatResponse) ProtoMessage

func (*MsgExecuteContractCompatResponse) ProtoMessage()

func (*MsgExecuteContractCompatResponse) Reset

func (*MsgExecuteContractCompatResponse) Size

func (m *MsgExecuteContractCompatResponse) Size() (n int)

func (*MsgExecuteContractCompatResponse) String

func (*MsgExecuteContractCompatResponse) Unmarshal

func (m *MsgExecuteContractCompatResponse) Unmarshal(dAtA []byte) error

func (*MsgExecuteContractCompatResponse) XXX_DiscardUnknown

func (m *MsgExecuteContractCompatResponse) XXX_DiscardUnknown()

func (*MsgExecuteContractCompatResponse) XXX_Marshal

func (m *MsgExecuteContractCompatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgExecuteContractCompatResponse) XXX_Merge

func (*MsgExecuteContractCompatResponse) XXX_Size

func (m *MsgExecuteContractCompatResponse) XXX_Size() int

func (*MsgExecuteContractCompatResponse) XXX_Unmarshal

func (m *MsgExecuteContractCompatResponse) XXX_Unmarshal(b []byte) error

type MsgInstantiateContractCompat

type MsgInstantiateContractCompat struct {
	// Sender is the that actor that signed the messages
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// Code ID obtained from store wasm code
	CodeId Uint `protobuf:"bytes,2,opt,name=codeId,proto3,customtype=Uint" json:"codeId"`
	// Label is a human-readable string for labelling the contract
	Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"`
	// Funds coins that are transferred to the contract on instantiation
	Funds string `protobuf:"bytes,4,opt,name=funds,proto3" json:"funds,omitempty"`
}

func (*MsgInstantiateContractCompat) Descriptor

func (*MsgInstantiateContractCompat) Descriptor() ([]byte, []int)

func (*MsgInstantiateContractCompat) GetFunds

func (m *MsgInstantiateContractCompat) GetFunds() string

func (*MsgInstantiateContractCompat) GetLabel

func (m *MsgInstantiateContractCompat) GetLabel() string

func (*MsgInstantiateContractCompat) GetSender

func (m *MsgInstantiateContractCompat) GetSender() string

func (MsgInstantiateContractCompat) GetSignBytes

func (msg MsgInstantiateContractCompat) GetSignBytes() []byte

Note ModuleCdc is Amino (see codec.go)

func (MsgInstantiateContractCompat) GetSigners

func (msg MsgInstantiateContractCompat) GetSigners() []sdk.AccAddress

func (*MsgInstantiateContractCompat) Marshal

func (m *MsgInstantiateContractCompat) Marshal() (dAtA []byte, err error)

func (*MsgInstantiateContractCompat) MarshalTo

func (m *MsgInstantiateContractCompat) MarshalTo(dAtA []byte) (int, error)

func (*MsgInstantiateContractCompat) MarshalToSizedBuffer

func (m *MsgInstantiateContractCompat) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgInstantiateContractCompat) ProtoMessage

func (*MsgInstantiateContractCompat) ProtoMessage()

func (*MsgInstantiateContractCompat) Reset

func (m *MsgInstantiateContractCompat) Reset()

func (MsgInstantiateContractCompat) Route

func (*MsgInstantiateContractCompat) Size

func (m *MsgInstantiateContractCompat) Size() (n int)

func (*MsgInstantiateContractCompat) String

func (MsgInstantiateContractCompat) Type

func (*MsgInstantiateContractCompat) Unmarshal

func (m *MsgInstantiateContractCompat) Unmarshal(dAtA []byte) error

func (MsgInstantiateContractCompat) ValidateBasic

func (msg MsgInstantiateContractCompat) ValidateBasic() error

func (*MsgInstantiateContractCompat) XXX_DiscardUnknown

func (m *MsgInstantiateContractCompat) XXX_DiscardUnknown()

func (*MsgInstantiateContractCompat) XXX_Marshal

func (m *MsgInstantiateContractCompat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgInstantiateContractCompat) XXX_Merge

func (m *MsgInstantiateContractCompat) XXX_Merge(src proto.Message)

func (*MsgInstantiateContractCompat) XXX_Size

func (m *MsgInstantiateContractCompat) XXX_Size() int

func (*MsgInstantiateContractCompat) XXX_Unmarshal

func (m *MsgInstantiateContractCompat) XXX_Unmarshal(b []byte) error

type MsgInstantiateContractCompatResponse

type MsgInstantiateContractCompatResponse struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Data    []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}

MsgInstantiateContractCompatResponse returns store result data.

func (*MsgInstantiateContractCompatResponse) Descriptor

func (*MsgInstantiateContractCompatResponse) Descriptor() ([]byte, []int)

func (*MsgInstantiateContractCompatResponse) GetAddress

func (*MsgInstantiateContractCompatResponse) GetData

func (*MsgInstantiateContractCompatResponse) Marshal

func (m *MsgInstantiateContractCompatResponse) Marshal() (dAtA []byte, err error)

func (*MsgInstantiateContractCompatResponse) MarshalTo

func (m *MsgInstantiateContractCompatResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgInstantiateContractCompatResponse) MarshalToSizedBuffer

func (m *MsgInstantiateContractCompatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgInstantiateContractCompatResponse) ProtoMessage

func (*MsgInstantiateContractCompatResponse) ProtoMessage()

func (*MsgInstantiateContractCompatResponse) Reset

func (*MsgInstantiateContractCompatResponse) Size

func (*MsgInstantiateContractCompatResponse) String

func (*MsgInstantiateContractCompatResponse) Unmarshal

func (m *MsgInstantiateContractCompatResponse) Unmarshal(dAtA []byte) error

func (*MsgInstantiateContractCompatResponse) XXX_DiscardUnknown

func (m *MsgInstantiateContractCompatResponse) XXX_DiscardUnknown()

func (*MsgInstantiateContractCompatResponse) XXX_Marshal

func (m *MsgInstantiateContractCompatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgInstantiateContractCompatResponse) XXX_Merge

func (*MsgInstantiateContractCompatResponse) XXX_Size

func (*MsgInstantiateContractCompatResponse) XXX_Unmarshal

func (m *MsgInstantiateContractCompatResponse) XXX_Unmarshal(b []byte) error

type MsgServer

MsgServer is the server API for Msg service.

type NoData

type NoData struct {
}

func (*NoData) Descriptor

func (*NoData) Descriptor() ([]byte, []int)

func (*NoData) Marshal

func (m *NoData) Marshal() (dAtA []byte, err error)

func (*NoData) MarshalTo

func (m *NoData) MarshalTo(dAtA []byte) (int, error)

func (*NoData) MarshalToSizedBuffer

func (m *NoData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*NoData) ProtoMessage

func (*NoData) ProtoMessage()

func (*NoData) Reset

func (m *NoData) Reset()

func (*NoData) Size

func (m *NoData) Size() (n int)

func (*NoData) String

func (m *NoData) String() string

func (*NoData) Unmarshal

func (m *NoData) Unmarshal(dAtA []byte) error

func (*NoData) XXX_DiscardUnknown

func (m *NoData) XXX_DiscardUnknown()

func (*NoData) XXX_Marshal

func (m *NoData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NoData) XXX_Merge

func (m *NoData) XXX_Merge(src proto.Message)

func (*NoData) XXX_Size

func (m *NoData) XXX_Size() int

func (*NoData) XXX_Unmarshal

func (m *NoData) XXX_Unmarshal(b []byte) error

type ParamSet

type ParamSet interface {
	ParamSetPairs() ParamSetPairs
}

ParamSet defines an interface for structs containing parameters for a module

type ParamSetPair

type ParamSetPair struct {
	Key         []byte
	Value       interface{}
	ValidatorFn ValueValidatorFn
}

ParamSetPair is used for associating paramsubspace key and field of param structs.

func NewParamSetPair

func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair

NewParamSetPair creates a new ParamSetPair instance.

type ParamSetPairs

type ParamSetPairs []ParamSetPair

ParamSetPairs Slice of KeyFieldPair

type Params

type Params struct {
	// Set the status to active to indicate that contracts can be executed in begin blocker.
	IsExecutionEnabled bool `protobuf:"varint,1,opt,name=is_execution_enabled,json=isExecutionEnabled,proto3" json:"is_execution_enabled,omitempty"`
	// Maximum aggregate total gas to be used for the contract executions in the BeginBlocker.
	MaxBeginBlockTotalGas uint64 `` /* 131-byte string literal not displayed */
	// the maximum gas limit each individual contract can consume in the BeginBlocker.
	MaxContractGasLimit uint64 `protobuf:"varint,3,opt,name=max_contract_gas_limit,json=maxContractGasLimit,proto3" json:"max_contract_gas_limit,omitempty"`
	// min_gas_price defines the minimum gas price the contracts must pay to be executed in the BeginBlocker.
	MinGasPrice uint64 `protobuf:"varint,4,opt,name=min_gas_price,json=minGasPrice,proto3" json:"min_gas_price,omitempty"`
}

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams

func NewParams(
	isExecutionEnabled bool,
	maxBeginBlockTotalGas uint64,
	maxContractGasLimit uint64,
	minGasPrice uint64,
) Params

NewParams creates a new Params instance

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetIsExecutionEnabled

func (m *Params) GetIsExecutionEnabled() bool

func (*Params) GetMaxBeginBlockTotalGas

func (m *Params) GetMaxBeginBlockTotalGas() uint64

func (*Params) GetMaxContractGasLimit

func (m *Params) GetMaxContractGasLimit() uint64

func (*Params) GetMinGasPrice

func (m *Params) GetMinGasPrice() uint64

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs returns the parameter set pairs.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate performs basic validation on wasmx parameters.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Retrieves wasmx params
	WasmxParams(ctx context.Context, in *QueryWasmxParamsRequest, opts ...grpc.CallOption) (*QueryWasmxParamsResponse, error)
	// Retrieves the entire wasmx module's state
	WasmxModuleState(ctx context.Context, in *QueryModuleStateRequest, opts ...grpc.CallOption) (*QueryModuleStateResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryModuleStateRequest

type QueryModuleStateRequest struct {
}

QueryModuleStateRequest is the request type for the Query/WasmxModuleState RPC method.

func (*QueryModuleStateRequest) Descriptor

func (*QueryModuleStateRequest) Descriptor() ([]byte, []int)

func (*QueryModuleStateRequest) Marshal

func (m *QueryModuleStateRequest) Marshal() (dAtA []byte, err error)

func (*QueryModuleStateRequest) MarshalTo

func (m *QueryModuleStateRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryModuleStateRequest) MarshalToSizedBuffer

func (m *QueryModuleStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryModuleStateRequest) ProtoMessage

func (*QueryModuleStateRequest) ProtoMessage()

func (*QueryModuleStateRequest) Reset

func (m *QueryModuleStateRequest) Reset()

func (*QueryModuleStateRequest) Size

func (m *QueryModuleStateRequest) Size() (n int)

func (*QueryModuleStateRequest) String

func (m *QueryModuleStateRequest) String() string

func (*QueryModuleStateRequest) Unmarshal

func (m *QueryModuleStateRequest) Unmarshal(dAtA []byte) error

func (*QueryModuleStateRequest) XXX_DiscardUnknown

func (m *QueryModuleStateRequest) XXX_DiscardUnknown()

func (*QueryModuleStateRequest) XXX_Marshal

func (m *QueryModuleStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryModuleStateRequest) XXX_Merge

func (m *QueryModuleStateRequest) XXX_Merge(src proto.Message)

func (*QueryModuleStateRequest) XXX_Size

func (m *QueryModuleStateRequest) XXX_Size() int

func (*QueryModuleStateRequest) XXX_Unmarshal

func (m *QueryModuleStateRequest) XXX_Unmarshal(b []byte) error

type QueryModuleStateResponse

type QueryModuleStateResponse struct {
	State *GenesisState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
}

QueryModuleStateResponse is the response type for the Query/WasmxModuleState RPC method.

func (*QueryModuleStateResponse) Descriptor

func (*QueryModuleStateResponse) Descriptor() ([]byte, []int)

func (*QueryModuleStateResponse) GetState

func (m *QueryModuleStateResponse) GetState() *GenesisState

func (*QueryModuleStateResponse) Marshal

func (m *QueryModuleStateResponse) Marshal() (dAtA []byte, err error)

func (*QueryModuleStateResponse) MarshalTo

func (m *QueryModuleStateResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryModuleStateResponse) MarshalToSizedBuffer

func (m *QueryModuleStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryModuleStateResponse) ProtoMessage

func (*QueryModuleStateResponse) ProtoMessage()

func (*QueryModuleStateResponse) Reset

func (m *QueryModuleStateResponse) Reset()

func (*QueryModuleStateResponse) Size

func (m *QueryModuleStateResponse) Size() (n int)

func (*QueryModuleStateResponse) String

func (m *QueryModuleStateResponse) String() string

func (*QueryModuleStateResponse) Unmarshal

func (m *QueryModuleStateResponse) Unmarshal(dAtA []byte) error

func (*QueryModuleStateResponse) XXX_DiscardUnknown

func (m *QueryModuleStateResponse) XXX_DiscardUnknown()

func (*QueryModuleStateResponse) XXX_Marshal

func (m *QueryModuleStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryModuleStateResponse) XXX_Merge

func (m *QueryModuleStateResponse) XXX_Merge(src proto.Message)

func (*QueryModuleStateResponse) XXX_Size

func (m *QueryModuleStateResponse) XXX_Size() int

func (*QueryModuleStateResponse) XXX_Unmarshal

func (m *QueryModuleStateResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Retrieves wasmx params
	WasmxParams(context.Context, *QueryWasmxParamsRequest) (*QueryWasmxParamsResponse, error)
	// Retrieves the entire wasmx module's state
	WasmxModuleState(context.Context, *QueryModuleStateRequest) (*QueryModuleStateResponse, error)
}

QueryServer is the server API for Query service.

type QueryWasmxParamsRequest

type QueryWasmxParamsRequest struct {
}

QueryWasmxParamsRequest is the request type for the Query/WasmxParams RPC method.

func (*QueryWasmxParamsRequest) Descriptor

func (*QueryWasmxParamsRequest) Descriptor() ([]byte, []int)

func (*QueryWasmxParamsRequest) Marshal

func (m *QueryWasmxParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryWasmxParamsRequest) MarshalTo

func (m *QueryWasmxParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryWasmxParamsRequest) MarshalToSizedBuffer

func (m *QueryWasmxParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryWasmxParamsRequest) ProtoMessage

func (*QueryWasmxParamsRequest) ProtoMessage()

func (*QueryWasmxParamsRequest) Reset

func (m *QueryWasmxParamsRequest) Reset()

func (*QueryWasmxParamsRequest) Size

func (m *QueryWasmxParamsRequest) Size() (n int)

func (*QueryWasmxParamsRequest) String

func (m *QueryWasmxParamsRequest) String() string

func (*QueryWasmxParamsRequest) Unmarshal

func (m *QueryWasmxParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryWasmxParamsRequest) XXX_DiscardUnknown

func (m *QueryWasmxParamsRequest) XXX_DiscardUnknown()

func (*QueryWasmxParamsRequest) XXX_Marshal

func (m *QueryWasmxParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryWasmxParamsRequest) XXX_Merge

func (m *QueryWasmxParamsRequest) XXX_Merge(src proto.Message)

func (*QueryWasmxParamsRequest) XXX_Size

func (m *QueryWasmxParamsRequest) XXX_Size() int

func (*QueryWasmxParamsRequest) XXX_Unmarshal

func (m *QueryWasmxParamsRequest) XXX_Unmarshal(b []byte) error

type QueryWasmxParamsResponse

type QueryWasmxParamsResponse struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryWasmxParamsRequest is the response type for the Query/WasmxParams RPC method.

func (*QueryWasmxParamsResponse) Descriptor

func (*QueryWasmxParamsResponse) Descriptor() ([]byte, []int)

func (*QueryWasmxParamsResponse) GetParams

func (m *QueryWasmxParamsResponse) GetParams() Params

func (*QueryWasmxParamsResponse) Marshal

func (m *QueryWasmxParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryWasmxParamsResponse) MarshalTo

func (m *QueryWasmxParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryWasmxParamsResponse) MarshalToSizedBuffer

func (m *QueryWasmxParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryWasmxParamsResponse) ProtoMessage

func (*QueryWasmxParamsResponse) ProtoMessage()

func (*QueryWasmxParamsResponse) Reset

func (m *QueryWasmxParamsResponse) Reset()

func (*QueryWasmxParamsResponse) Size

func (m *QueryWasmxParamsResponse) Size() (n int)

func (*QueryWasmxParamsResponse) String

func (m *QueryWasmxParamsResponse) String() string

func (*QueryWasmxParamsResponse) Unmarshal

func (m *QueryWasmxParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryWasmxParamsResponse) XXX_DiscardUnknown

func (m *QueryWasmxParamsResponse) XXX_DiscardUnknown()

func (*QueryWasmxParamsResponse) XXX_Marshal

func (m *QueryWasmxParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryWasmxParamsResponse) XXX_Merge

func (m *QueryWasmxParamsResponse) XXX_Merge(src proto.Message)

func (*QueryWasmxParamsResponse) XXX_Size

func (m *QueryWasmxParamsResponse) XXX_Size() int

func (*QueryWasmxParamsResponse) XXX_Unmarshal

func (m *QueryWasmxParamsResponse) XXX_Unmarshal(b []byte) error

type Uint

type Uint = sdkmath.Uint

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ExecuteContractCompat

func (*UnimplementedMsgServer) InstantiateContractCompat

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) WasmxModuleState

func (*UnimplementedQueryServer) WasmxParams

type ValueValidatorFn

type ValueValidatorFn func(value interface{}) error

type WasmContractOpsKeeper

type WasmContractOpsKeeper interface {
	wasmtypes.ContractOpsKeeper
}

type WasmViewKeeper

type WasmViewKeeper interface {
	wasmtypes.ViewKeeper
}

type WasmxPacketData

type WasmxPacketData struct {
	// Types that are valid to be assigned to Packet:
	//	*WasmxPacketData_NoData
	Packet isWasmxPacketData_Packet `protobuf_oneof:"packet"`
}

func (*WasmxPacketData) Descriptor

func (*WasmxPacketData) Descriptor() ([]byte, []int)

func (*WasmxPacketData) GetNoData

func (m *WasmxPacketData) GetNoData() *NoData

func (*WasmxPacketData) GetPacket

func (m *WasmxPacketData) GetPacket() isWasmxPacketData_Packet

func (*WasmxPacketData) Marshal

func (m *WasmxPacketData) Marshal() (dAtA []byte, err error)

func (*WasmxPacketData) MarshalTo

func (m *WasmxPacketData) MarshalTo(dAtA []byte) (int, error)

func (*WasmxPacketData) MarshalToSizedBuffer

func (m *WasmxPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WasmxPacketData) ProtoMessage

func (*WasmxPacketData) ProtoMessage()

func (*WasmxPacketData) Reset

func (m *WasmxPacketData) Reset()

func (*WasmxPacketData) Size

func (m *WasmxPacketData) Size() (n int)

func (*WasmxPacketData) String

func (m *WasmxPacketData) String() string

func (*WasmxPacketData) Unmarshal

func (m *WasmxPacketData) Unmarshal(dAtA []byte) error

func (*WasmxPacketData) XXX_DiscardUnknown

func (m *WasmxPacketData) XXX_DiscardUnknown()

func (*WasmxPacketData) XXX_Marshal

func (m *WasmxPacketData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WasmxPacketData) XXX_Merge

func (m *WasmxPacketData) XXX_Merge(src proto.Message)

func (*WasmxPacketData) XXX_OneofWrappers

func (*WasmxPacketData) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*WasmxPacketData) XXX_Size

func (m *WasmxPacketData) XXX_Size() int

func (*WasmxPacketData) XXX_Unmarshal

func (m *WasmxPacketData) XXX_Unmarshal(b []byte) error

type WasmxPacketData_NoData

type WasmxPacketData_NoData struct {
	NoData *NoData `protobuf:"bytes,1,opt,name=noData,proto3,oneof" json:"noData,omitempty"`
}

func (*WasmxPacketData_NoData) MarshalTo

func (m *WasmxPacketData_NoData) MarshalTo(dAtA []byte) (int, error)

func (*WasmxPacketData_NoData) MarshalToSizedBuffer

func (m *WasmxPacketData_NoData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WasmxPacketData_NoData) Size

func (m *WasmxPacketData_NoData) Size() (n int)

Jump to

Keyboard shortcuts

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