types

package
v30.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ModuleName = "cw-hooks"
	StoreKey   = ModuleName
)
View Source
const DefaultMaxContracts = uint64(100)

DefaultMaxContracts is the default cap on the number of contracts registered per hook module (staking/gov). Each registered contract is sudo-executed on every matching hook under a child gas meter that is NOT charged to the block gas meter, so an unbounded registered set is a block-time DoS vector. Governance can raise/lower this via MsgUpdateParams.

Variables

View Source
var (
	ErrInvalidLengthContract        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowContract          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupContract = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ParamsKey             = collections.NewPrefix("params")
	ContractsKey          = collections.NewPrefix("contracts")
	ContractsByAddressKey = collections.NewPrefix("contract_addr_index")

	// supported modules
	StakingPrefixKey = collections.NewPrefix("staking")
	GovPrefixKey     = collections.NewPrefix("gov")
)
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 Msg_serviceDesc = _Msg_serviceDesc
View Source
var Query_serviceDesc = _Query_serviceDesc

Functions

func BuildContractPrimaryKey

func BuildContractPrimaryKey(prefix collections.Prefix, addr sdk.AccAddress) collections.Pair[[]byte, sdk.AccAddress]

func ModulePrefixFromModule

func ModulePrefixFromModule(module string) (collections.Prefix, error)

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec

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)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type ContractInfo

type ContractInfo struct {
	ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
	FailureCounter  uint32 `protobuf:"varint,2,opt,name=failure_counter,json=failureCounter,proto3" json:"failure_counter,omitempty"`
	LatestError     string `protobuf:"bytes,3,opt,name=latest_error,json=latestError,proto3" json:"latest_error,omitempty"`
}

ContractInfo defines the registered contract address and the address used for registering the contract.

func (*ContractInfo) Descriptor

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

func (*ContractInfo) Equal

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

func (*ContractInfo) GetContractAddress

func (m *ContractInfo) GetContractAddress() string

func (*ContractInfo) GetFailureCounter

func (m *ContractInfo) GetFailureCounter() uint32

func (*ContractInfo) GetLatestError

func (m *ContractInfo) GetLatestError() string

func (*ContractInfo) Marshal

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

func (*ContractInfo) MarshalTo

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

func (*ContractInfo) MarshalToSizedBuffer

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

func (*ContractInfo) ProtoMessage

func (*ContractInfo) ProtoMessage()

func (*ContractInfo) Reset

func (m *ContractInfo) Reset()

func (*ContractInfo) Size

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

func (*ContractInfo) String

func (m *ContractInfo) String() string

func (*ContractInfo) Unmarshal

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

func (*ContractInfo) XXX_DiscardUnknown

func (m *ContractInfo) XXX_DiscardUnknown()

func (*ContractInfo) XXX_Marshal

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

func (*ContractInfo) XXX_Merge

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

func (*ContractInfo) XXX_Size

func (m *ContractInfo) XXX_Size() int

func (*ContractInfo) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	// Params of this module
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// staking_contract_addresses
	StakingContractAddresses []ContractInfo `protobuf:"bytes,2,rep,name=staking_contract_addresses,json=stakingContractAddresses,proto3" json:"staking_contract_addresses"`
	// gov_contract_addresses
	GovContractAddresses []ContractInfo `protobuf:"bytes,3,rep,name=gov_contract_addresses,json=govContractAddresses,proto3" json:"gov_contract_addresses"`
}

GenesisState - initial state of module

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState - Return a default genesis state

func GetGenesisStateFromAppState

func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState

GetGenesisStateFromAppState returns x/cw-hooks GenesisState given raw application genesis state.

func NewGenesisState

func NewGenesisState(params Params, stakingContracts, govContracts map[string]ContractInfo) *GenesisState

NewGenesisState - Create a new genesis state.

Output slices are sorted by ContractAddress so that genesis state hashes deterministically across nodes — Go map iteration is randomised, and any caller passing a non-empty map (tests, fixtures, custom genesis) would otherwise produce a different InitGenesis byte sequence per run.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetGovContractAddresses

func (m *GenesisState) GetGovContractAddresses() []ContractInfo

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetStakingContractAddresses

func (m *GenesisState) GetStakingContractAddresses() []ContractInfo

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

type MsgClient interface {
	// UpdateParams defines a governance operation for updating the x/clock module
	// parameters. The authority is hard-coded to the x/gov module account.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
	// RegisterStaking.
	RegisterContract(ctx context.Context, in *MsgRegisterContract, opts ...grpc.CallOption) (*MsgRegisterContractResponse, error)
	// UnregisterContract.
	UnregisterContract(ctx context.Context, in *MsgUnregisterContract, opts ...grpc.CallOption) (*MsgUnregisterContractResponse, 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 MsgRegisterContract

type MsgRegisterContract struct {
	// The address of the sender
	SenderAddress string `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"`
	// The module key the contract is registered for
	Module string `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"`
	// The contract address to register
	ContractAddress string `protobuf:"bytes,3,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
}

MsgRegisterContract

func (*MsgRegisterContract) Descriptor

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

func (*MsgRegisterContract) Marshal

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

func (*MsgRegisterContract) MarshalTo

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

func (*MsgRegisterContract) MarshalToSizedBuffer

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

func (*MsgRegisterContract) ProtoMessage

func (*MsgRegisterContract) ProtoMessage()

func (*MsgRegisterContract) Reset

func (m *MsgRegisterContract) Reset()

func (*MsgRegisterContract) Size

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

func (*MsgRegisterContract) String

func (m *MsgRegisterContract) String() string

func (*MsgRegisterContract) Unmarshal

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

func (*MsgRegisterContract) XXX_DiscardUnknown

func (m *MsgRegisterContract) XXX_DiscardUnknown()

func (*MsgRegisterContract) XXX_Marshal

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

func (*MsgRegisterContract) XXX_Merge

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

func (*MsgRegisterContract) XXX_Size

func (m *MsgRegisterContract) XXX_Size() int

func (*MsgRegisterContract) XXX_Unmarshal

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

type MsgRegisterContractResponse

type MsgRegisterContractResponse struct {
}

MsgRegisterContractResponse

func (*MsgRegisterContractResponse) Descriptor

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

func (*MsgRegisterContractResponse) Marshal

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

func (*MsgRegisterContractResponse) MarshalTo

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

func (*MsgRegisterContractResponse) MarshalToSizedBuffer

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

func (*MsgRegisterContractResponse) ProtoMessage

func (*MsgRegisterContractResponse) ProtoMessage()

func (*MsgRegisterContractResponse) Reset

func (m *MsgRegisterContractResponse) Reset()

func (*MsgRegisterContractResponse) Size

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

func (*MsgRegisterContractResponse) String

func (m *MsgRegisterContractResponse) String() string

func (*MsgRegisterContractResponse) Unmarshal

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

func (*MsgRegisterContractResponse) XXX_DiscardUnknown

func (m *MsgRegisterContractResponse) XXX_DiscardUnknown()

func (*MsgRegisterContractResponse) XXX_Marshal

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

func (*MsgRegisterContractResponse) XXX_Merge

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

func (*MsgRegisterContractResponse) XXX_Size

func (m *MsgRegisterContractResponse) XXX_Size() int

func (*MsgRegisterContractResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// UpdateParams defines a governance operation for updating the x/clock module
	// parameters. The authority is hard-coded to the x/gov module account.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
	// RegisterStaking.
	RegisterContract(context.Context, *MsgRegisterContract) (*MsgRegisterContractResponse, error)
	// UnregisterContract.
	UnregisterContract(context.Context, *MsgUnregisterContract) (*MsgUnregisterContractResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUnregisterContract

type MsgUnregisterContract struct {
	// The address of the sender
	SenderAddress string `protobuf:"bytes,1,opt,name=sender_address,json=senderAddress,proto3" json:"sender_address,omitempty"`
	// The module key the contract is registered for
	Module string `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"`
	// The contract address to unregister
	ContractAddress string `protobuf:"bytes,3,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
}

MsgUnregisterContract

func (*MsgUnregisterContract) Descriptor

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

func (*MsgUnregisterContract) Marshal

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

func (*MsgUnregisterContract) MarshalTo

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

func (*MsgUnregisterContract) MarshalToSizedBuffer

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

func (*MsgUnregisterContract) ProtoMessage

func (*MsgUnregisterContract) ProtoMessage()

func (*MsgUnregisterContract) Reset

func (m *MsgUnregisterContract) Reset()

func (*MsgUnregisterContract) Size

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

func (*MsgUnregisterContract) String

func (m *MsgUnregisterContract) String() string

func (*MsgUnregisterContract) Unmarshal

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

func (*MsgUnregisterContract) XXX_DiscardUnknown

func (m *MsgUnregisterContract) XXX_DiscardUnknown()

func (*MsgUnregisterContract) XXX_Marshal

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

func (*MsgUnregisterContract) XXX_Merge

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

func (*MsgUnregisterContract) XXX_Size

func (m *MsgUnregisterContract) XXX_Size() int

func (*MsgUnregisterContract) XXX_Unmarshal

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

type MsgUnregisterContractResponse

type MsgUnregisterContractResponse struct {
}

MsgUnregisterContractResponse

func (*MsgUnregisterContractResponse) Descriptor

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

func (*MsgUnregisterContractResponse) Marshal

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

func (*MsgUnregisterContractResponse) MarshalTo

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

func (*MsgUnregisterContractResponse) MarshalToSizedBuffer

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

func (*MsgUnregisterContractResponse) ProtoMessage

func (*MsgUnregisterContractResponse) ProtoMessage()

func (*MsgUnregisterContractResponse) Reset

func (m *MsgUnregisterContractResponse) Reset()

func (*MsgUnregisterContractResponse) Size

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

func (*MsgUnregisterContractResponse) String

func (*MsgUnregisterContractResponse) Unmarshal

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

func (*MsgUnregisterContractResponse) XXX_DiscardUnknown

func (m *MsgUnregisterContractResponse) XXX_DiscardUnknown()

func (*MsgUnregisterContractResponse) XXX_Marshal

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

func (*MsgUnregisterContractResponse) XXX_Merge

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

func (*MsgUnregisterContractResponse) XXX_Size

func (m *MsgUnregisterContractResponse) XXX_Size() int

func (*MsgUnregisterContractResponse) XXX_Unmarshal

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

type MsgUpdateParams

type MsgUpdateParams struct {
	// authority is the address of the governance account
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the x/clock parameters to update.
	//
	// NOTE: All parameters must be supplied
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type

func (*MsgUpdateParams) Descriptor

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

func (*MsgUpdateParams) Marshal

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

func (*MsgUpdateParams) MarshalTo

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

func (*MsgUpdateParams) MarshalToSizedBuffer

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

func (*MsgUpdateParams) ProtoMessage

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size

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

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal

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

func (*MsgUpdateParams) XXX_DiscardUnknown

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal

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

func (*MsgUpdateParams) XXX_Merge

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

func (*MsgUpdateParams) XXX_Size

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal

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

type MsgUpdateParamsResponse

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

Since: cosmos-sdk 0.47

func (*MsgUpdateParamsResponse) Descriptor

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

func (*MsgUpdateParamsResponse) Marshal

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

func (*MsgUpdateParamsResponse) MarshalTo

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

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer

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

func (*MsgUpdateParamsResponse) ProtoMessage

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size

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

func (*MsgUpdateParamsResponse) String

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal

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

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal

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

func (*MsgUpdateParamsResponse) XXX_Merge

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

func (*MsgUpdateParamsResponse) XXX_Size

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal

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

type Params

type Params struct {
	// contract_gas_limit is the contract call gas limit
	ContractGasLimit uint64 `protobuf:"varint,1,opt,name=contract_gas_limit,json=contractGasLimit,proto3" json:"contract_gas_limit,omitempty"`
	// contract_failure_removal_threshold is the threshold for removing a contract after consecutive failures
	ContractFailureRemovalThreshold uint64 `` /* 159-byte string literal not displayed */
	// max_contracts caps the number of contracts that may be registered per hook
	// module (staking/gov). Each registered contract is sudo-executed on every
	// matching hook under a child gas meter not charged to the block meter, so
	// an unbounded set is a block-time DoS vector.
	MaxContracts uint64 `protobuf:"varint,3,opt,name=max_contracts,json=maxContracts,proto3" json:"max_contracts,omitempty"`
}

Params defines the set of module parameters.

func DefaultParams

func DefaultParams() Params

DefaultParams returns default parameters

func NewParams

func NewParams(contractGasLimit uint64, contractFailureRemovalThreshold uint64, maxContracts uint64) Params

NewParams creates a new Params object

func (*Params) Descriptor

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

func (*Params) Equal

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

func (*Params) GetContractFailureRemovalThreshold

func (m *Params) GetContractFailureRemovalThreshold() uint64

func (*Params) GetContractGasLimit

func (m *Params) GetContractGasLimit() uint64

func (*Params) GetMaxContracts

func (m *Params) GetMaxContracts() 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) 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.

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 {
	// Params gets all module params
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// Contracts gets all contracts for a module
	Contracts(ctx context.Context, in *QueryContractsRequest, opts ...grpc.CallOption) (*QueryContractsResponse, error)
	// ContractInfo gets a contract info for a module and contract address
	ContractInfo(ctx context.Context, in *QueryContractInfoRequest, opts ...grpc.CallOption) (*QueryContractInfoResponse, 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 QueryContractInfoRequest

type QueryContractInfoRequest struct {
	// The module key the contract is registered for
	Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"`
	// The contract address to get info for
	ContractAddress string `protobuf:"bytes,2,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
}

QueryContractInfoRequest is the request type to get a contract info for a module and contract address

func (*QueryContractInfoRequest) Descriptor

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

func (*QueryContractInfoRequest) GetContractAddress

func (m *QueryContractInfoRequest) GetContractAddress() string

func (*QueryContractInfoRequest) GetModule

func (m *QueryContractInfoRequest) GetModule() string

func (*QueryContractInfoRequest) Marshal

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

func (*QueryContractInfoRequest) MarshalTo

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

func (*QueryContractInfoRequest) MarshalToSizedBuffer

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

func (*QueryContractInfoRequest) ProtoMessage

func (*QueryContractInfoRequest) ProtoMessage()

func (*QueryContractInfoRequest) Reset

func (m *QueryContractInfoRequest) Reset()

func (*QueryContractInfoRequest) Size

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

func (*QueryContractInfoRequest) String

func (m *QueryContractInfoRequest) String() string

func (*QueryContractInfoRequest) Unmarshal

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

func (*QueryContractInfoRequest) XXX_DiscardUnknown

func (m *QueryContractInfoRequest) XXX_DiscardUnknown()

func (*QueryContractInfoRequest) XXX_Marshal

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

func (*QueryContractInfoRequest) XXX_Merge

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

func (*QueryContractInfoRequest) XXX_Size

func (m *QueryContractInfoRequest) XXX_Size() int

func (*QueryContractInfoRequest) XXX_Unmarshal

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

type QueryContractInfoResponse

type QueryContractInfoResponse struct {
	Contract ContractInfo `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract"`
}

QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method

func (*QueryContractInfoResponse) Descriptor

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

func (*QueryContractInfoResponse) GetContract

func (m *QueryContractInfoResponse) GetContract() ContractInfo

func (*QueryContractInfoResponse) Marshal

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

func (*QueryContractInfoResponse) MarshalTo

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

func (*QueryContractInfoResponse) MarshalToSizedBuffer

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

func (*QueryContractInfoResponse) ProtoMessage

func (*QueryContractInfoResponse) ProtoMessage()

func (*QueryContractInfoResponse) Reset

func (m *QueryContractInfoResponse) Reset()

func (*QueryContractInfoResponse) Size

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

func (*QueryContractInfoResponse) String

func (m *QueryContractInfoResponse) String() string

func (*QueryContractInfoResponse) Unmarshal

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

func (*QueryContractInfoResponse) XXX_DiscardUnknown

func (m *QueryContractInfoResponse) XXX_DiscardUnknown()

func (*QueryContractInfoResponse) XXX_Marshal

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

func (*QueryContractInfoResponse) XXX_Merge

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

func (*QueryContractInfoResponse) XXX_Size

func (m *QueryContractInfoResponse) XXX_Size() int

func (*QueryContractInfoResponse) XXX_Unmarshal

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

type QueryContractsRequest

type QueryContractsRequest struct {
	// The module key the contracts are registered for
	Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"`
}

QueryContractsRequest is the request type to get all contracts for a module

func (*QueryContractsRequest) Descriptor

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

func (*QueryContractsRequest) GetModule

func (m *QueryContractsRequest) GetModule() string

func (*QueryContractsRequest) Marshal

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

func (*QueryContractsRequest) MarshalTo

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

func (*QueryContractsRequest) MarshalToSizedBuffer

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

func (*QueryContractsRequest) ProtoMessage

func (*QueryContractsRequest) ProtoMessage()

func (*QueryContractsRequest) Reset

func (m *QueryContractsRequest) Reset()

func (*QueryContractsRequest) Size

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

func (*QueryContractsRequest) String

func (m *QueryContractsRequest) String() string

func (*QueryContractsRequest) Unmarshal

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

func (*QueryContractsRequest) XXX_DiscardUnknown

func (m *QueryContractsRequest) XXX_DiscardUnknown()

func (*QueryContractsRequest) XXX_Marshal

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

func (*QueryContractsRequest) XXX_Merge

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

func (*QueryContractsRequest) XXX_Size

func (m *QueryContractsRequest) XXX_Size() int

func (*QueryContractsRequest) XXX_Unmarshal

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

type QueryContractsResponse

type QueryContractsResponse struct {
	// The contracts registered for the module
	Contracts []ContractInfo `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts"`
}

QueryContractsResponse is the response type for the Query/Contracts RPC method

func (*QueryContractsResponse) Descriptor

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

func (*QueryContractsResponse) GetContracts

func (m *QueryContractsResponse) GetContracts() []ContractInfo

func (*QueryContractsResponse) Marshal

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

func (*QueryContractsResponse) MarshalTo

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

func (*QueryContractsResponse) MarshalToSizedBuffer

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

func (*QueryContractsResponse) ProtoMessage

func (*QueryContractsResponse) ProtoMessage()

func (*QueryContractsResponse) Reset

func (m *QueryContractsResponse) Reset()

func (*QueryContractsResponse) Size

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

func (*QueryContractsResponse) String

func (m *QueryContractsResponse) String() string

func (*QueryContractsResponse) Unmarshal

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

func (*QueryContractsResponse) XXX_DiscardUnknown

func (m *QueryContractsResponse) XXX_DiscardUnknown()

func (*QueryContractsResponse) XXX_Marshal

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

func (*QueryContractsResponse) XXX_Merge

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

func (*QueryContractsResponse) XXX_Size

func (m *QueryContractsResponse) XXX_Size() int

func (*QueryContractsResponse) XXX_Unmarshal

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

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type to get all module params

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Marshal

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

func (*QueryParamsRequest) MarshalTo

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

func (*QueryParamsRequest) MarshalToSizedBuffer

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

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

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

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

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

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

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

func (*QueryParamsRequest) XXX_Merge

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

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

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

type QueryParamsResponse

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

QueryParamsResponse is the response type for the Query/Params RPC method

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Params gets all module params
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// Contracts gets all contracts for a module
	Contracts(context.Context, *QueryContractsRequest) (*QueryContractsResponse, error)
	// ContractInfo gets a contract info for a module and contract address
	ContractInfo(context.Context, *QueryContractInfoRequest) (*QueryContractInfoResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) RegisterContract

func (*UnimplementedMsgServer) UnregisterContract

func (*UnimplementedMsgServer) UpdateParams

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) ContractInfo

func (*UnimplementedQueryServer) Contracts

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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