types

package
v0.0.0-...-96587e2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeSetPrivileged     = "set_privileged_contract"
	EventTypeUnsetPrivileged   = "unset_privileged_contract"
	EventTypeRegisterPrivilege = "register_privilege"
	EventTypeReleasePrivilege  = "release_privilege"
	EventTypeMintTokens        = "mint"
	EventTypeDelegateTokens    = "delegate"
	EventTypeUndelegateTokens  = "undelegate"
)
View Source
const (
	AttributeKeyCallbackType = "privilege_type"
	AttributeKeyRecipient    = "recipient"
	AttributeKeySender       = "sender"
)
View Source
const (
	// ModuleName is the name of this module.
	ModuleName = wasmtypes.ModuleName

	// RouterKey is used to route governance proposals
	RouterKey = wasmtypes.RouterKey

	// StoreKey is the prefix under which we store this module's data
	StoreKey = wasmtypes.StoreKey
)
View Source
const (
	// DefaultParamspace for params keeper
	DefaultParamspace = ModuleName
)

Variables

View Source
var (
	ErrInvalidLengthContractExtension        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowContractExtension          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupContractExtension = 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 (
	PrivilegedContractsSecondaryIndexPrefix = []byte{0xa0}
	ContractCallbacksSecondaryIndexPrefix   = []byte{0xa1}
)

nolint

View Source
var (

	// PrivilegeTypeBeginBlock called every block before the TX are processed
	// Multiple contracts can register for this callback privilege
	PrivilegeTypeBeginBlock = registerCallbackType(0x1, "begin_blocker", false)

	// PrivilegeTypeEndBlock called every block after the TX are processed
	// Multiple contracts can register for this callback privilege
	PrivilegeTypeEndBlock = registerCallbackType(0x2, "end_blocker", false)

	// PrivilegeTypeValidatorSetUpdate end-blocker that can modify the validator set
	// This callback privilege is exclusive to one contract instance, only.
	PrivilegeTypeValidatorSetUpdate = registerCallbackType(0x3, "validator_set_updater", true)

	// PrivilegeTypeGovProposalExecutor is a permission privilege to execute governance proposals.
	PrivilegeTypeGovProposalExecutor = registerCallbackType(0x4, "gov_proposal_executor", false)

	// PrivilegeTypeTokenMinter is a permission to mint native tokens on the chain.
	PrivilegeTypeTokenMinter = registerCallbackType(0x5, "token_minter", false)

	// PrivilegeConsensusParamChanger is a permission to modify the consensus parameters
	PrivilegeConsensusParamChanger = registerCallbackType(0x6, "consensus_param_changer", false)

	// PrivilegeDelegator is a permission to let accounts send tokens via delegation to this contract. Can be used by vesting accounts
	PrivilegeDelegator = registerCallbackType(0x7, "delegator", false)

	// PrivilegeStateExporterImporter is a permission to let contracts manage their state export on a dump and genesis import (in non seed mode)
	// The contract receives a sudo message of type export where the result is stored in genesis. For the import path the json object containing state
	// is passed to the contract via sudo import method.
	PrivilegeStateExporterImporter = registerCallbackType(0x8, "state_exporter_importer", false)
)
View Source
var (
	ErrInvalidLengthProposal        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProposal          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group")
)
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")
)

EnableAllProposals contains all twasm gov types as keys.

View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func AllPrivilegeTypeNames

func AllPrivilegeTypeNames() []string

AllPrivilegeTypeNames returns a list of all callback type names

func ConsensusParamsFixture

func ConsensusParamsFixture(mutators ...func(*abci.ConsensusParams)) *abci.ConsensusParams

func DefaultParams

func DefaultParams() wasmtypes.Params

func RandomAddress

func RandomAddress(_ *testing.T) sdk.AccAddress

func RandomBech32Address

func RandomBech32Address(t *testing.T) string

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the account types and interface

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type BankKeeper

type BankKeeper interface {
	wasmtypes.BankKeeper
	Minter
	Staker
}

type Contract

type Contract struct {
	ContractAddress string             `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"`
	ContractInfo    types.ContractInfo `protobuf:"bytes,2,opt,name=contract_info,json=contractInfo,proto3" json:"contract_info"`
	// ContractSate is one of default wasmd Model or custom state model
	//
	// Types that are valid to be assigned to ContractState:
	//	*Contract_KvModel
	//	*Contract_CustomModel
	ContractState isContract_ContractState `protobuf_oneof:"contract_state"`
}

Contract struct encompasses ContractAddress, ContractInfo, and ContractState

func ContractFixture

func ContractFixture(t *testing.T, mutators ...func(contract *Contract)) Contract

ContractFixture test data factory

func (*Contract) Descriptor

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

func (*Contract) GetContractAddress

func (m *Contract) GetContractAddress() string

func (*Contract) GetContractInfo

func (m *Contract) GetContractInfo() types.ContractInfo

func (*Contract) GetContractState

func (m *Contract) GetContractState() isContract_ContractState

func (*Contract) GetCustomModel

func (m *Contract) GetCustomModel() *CustomModel

func (*Contract) GetKvModel

func (m *Contract) GetKvModel() *KVModel

func (*Contract) Marshal

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

func (*Contract) MarshalTo

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

func (*Contract) MarshalToSizedBuffer

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

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) Reset

func (m *Contract) Reset()

func (*Contract) Size

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

func (*Contract) String

func (m *Contract) String() string

func (*Contract) Unmarshal

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

func (*Contract) UnpackInterfaces

func (m *Contract) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements codectypes.UnpackInterfaces

func (*Contract) XXX_DiscardUnknown

func (m *Contract) XXX_DiscardUnknown()

func (*Contract) XXX_Marshal

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

func (*Contract) XXX_Merge

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

func (*Contract) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Contract) XXX_Size

func (m *Contract) XXX_Size() int

func (*Contract) XXX_Unmarshal

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

type Contract_CustomModel

type Contract_CustomModel struct {
	CustomModel *CustomModel `protobuf:"bytes,4,opt,name=custom_model,json=customModel,proto3,oneof" json:"custom_model,omitempty"`
}

func (*Contract_CustomModel) MarshalTo

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

func (*Contract_CustomModel) MarshalToSizedBuffer

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

func (*Contract_CustomModel) Size

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

type Contract_KvModel

type Contract_KvModel struct {
	KvModel *KVModel `protobuf:"bytes,3,opt,name=kv_model,json=kvModel,proto3,oneof" json:"kv_model,omitempty"`
}

func (*Contract_KvModel) MarshalTo

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

func (*Contract_KvModel) MarshalToSizedBuffer

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

func (*Contract_KvModel) Size

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

type CustomModel

type CustomModel struct {
	// Msg json encoded message to be passed to the contract on import
	Msg github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage `` /* 126-byte string literal not displayed */
}

CustomModel contains the raw json data for a contract to seed its state on import

func (*CustomModel) Descriptor

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

func (*CustomModel) Marshal

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

func (*CustomModel) MarshalTo

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

func (*CustomModel) MarshalToSizedBuffer

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

func (*CustomModel) ProtoMessage

func (*CustomModel) ProtoMessage()

func (*CustomModel) Reset

func (m *CustomModel) Reset()

func (*CustomModel) Size

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

func (*CustomModel) String

func (m *CustomModel) String() string

func (*CustomModel) Unmarshal

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

func (*CustomModel) XXX_DiscardUnknown

func (m *CustomModel) XXX_DiscardUnknown()

func (*CustomModel) XXX_Marshal

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

func (*CustomModel) XXX_Merge

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

func (*CustomModel) XXX_Size

func (m *CustomModel) XXX_Size() int

func (*CustomModel) XXX_Unmarshal

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

type DemotePrivilegedContractProposal

type DemotePrivilegedContractProposal struct {
	// Title is a short summary
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"`
	// Description is a human readable text
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"`
	// Contract is the address of the smart contract
	Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty" yaml:"contract"`
}

PromoteToPrivilegedContractProposal gov proposal content type to remove "privileges" from a contract

func DemoteProposalFixture

func DemoteProposalFixture(mutators ...func(proposal *DemotePrivilegedContractProposal)) *DemotePrivilegedContractProposal

func (*DemotePrivilegedContractProposal) Descriptor

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

func (*DemotePrivilegedContractProposal) Equal

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

func (DemotePrivilegedContractProposal) GetDescription

func (p DemotePrivilegedContractProposal) GetDescription() string

GetDescription returns the human readable description of the proposal

func (*DemotePrivilegedContractProposal) GetTitle

GetTitle returns the title of the proposal

func (*DemotePrivilegedContractProposal) Marshal

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

func (*DemotePrivilegedContractProposal) MarshalTo

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

func (*DemotePrivilegedContractProposal) MarshalToSizedBuffer

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

func (DemotePrivilegedContractProposal) MarshalYAML

func (p DemotePrivilegedContractProposal) MarshalYAML() (interface{}, error)

MarshalYAML pretty prints the wasm byte code

func (DemotePrivilegedContractProposal) ProposalRoute

func (p DemotePrivilegedContractProposal) ProposalRoute() string

ProposalRoute returns the routing key of a parameter change proposal.

func (DemotePrivilegedContractProposal) ProposalType

func (p DemotePrivilegedContractProposal) ProposalType() string

ProposalType returns the type

func (*DemotePrivilegedContractProposal) ProtoMessage

func (*DemotePrivilegedContractProposal) ProtoMessage()

func (*DemotePrivilegedContractProposal) Reset

func (*DemotePrivilegedContractProposal) Size

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

func (DemotePrivilegedContractProposal) String

String implements the Stringer interface.

func (*DemotePrivilegedContractProposal) Unmarshal

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

func (DemotePrivilegedContractProposal) ValidateBasic

func (p DemotePrivilegedContractProposal) ValidateBasic() error

ValidateBasic validates the proposal

func (*DemotePrivilegedContractProposal) XXX_DiscardUnknown

func (m *DemotePrivilegedContractProposal) XXX_DiscardUnknown()

func (*DemotePrivilegedContractProposal) XXX_Marshal

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

func (*DemotePrivilegedContractProposal) XXX_Merge

func (*DemotePrivilegedContractProposal) XXX_Size

func (m *DemotePrivilegedContractProposal) XXX_Size() int

func (*DemotePrivilegedContractProposal) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	// Params sdk type Params for wasmd
	Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// Codes has all stored wasm codes and metadata
	Codes []types.Code `protobuf:"bytes,2,rep,name=codes,proto3" json:"codes,omitempty"`
	// Contracts contains all instantiated contracts, state and metadata
	Contracts []Contract `protobuf:"bytes,3,rep,name=contracts,proto3" json:"contracts,omitempty"`
	// Sequences names and values
	Sequences []types.Sequence `protobuf:"bytes,4,rep,name=sequences,proto3" json:"sequences,omitempty"`
	// GenMsgs has wasmd sdk type messages to execute in the genesis phase
	GenMsgs []types.GenesisState_GenMsgs `protobuf:"bytes,5,rep,name=gen_msgs,json=genMsgs,proto3" json:"gen_msgs,omitempty"`
	// PrivilegedContractAddresses is a list of contract addresses that can have
	// special permissions
	PrivilegedContractAddresses []string `` /* 144-byte string literal not displayed */
	// PinnedCodeIDs has codeInfo ids for wasm codes that are pinned in cache
	PinnedCodeIDs []uint64 `protobuf:"varint,7,rep,packed,name=pinned_code_ids,json=pinnedCodeIds,proto3" json:"pinned_code_ids,omitempty"`
}

func DeterministicGenesisStateFixture

func DeterministicGenesisStateFixture(t *testing.T, mutators ...func(*GenesisState)) GenesisState

DeterministicGenesisStateFixture is the same as GenesisStateFixture but with deterministic addresses and codes

func GenesisStateFixture

func GenesisStateFixture(t *testing.T, mutators ...func(*GenesisState)) GenesisState

GenesisStateFixture test data fixture

func (*GenesisState) Descriptor

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

func (*GenesisState) GetCodes

func (m *GenesisState) GetCodes() []types.Code

func (*GenesisState) GetContracts

func (m *GenesisState) GetContracts() []Contract

func (*GenesisState) GetGenMsgs

func (m *GenesisState) GetGenMsgs() []types.GenesisState_GenMsgs

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() types.Params

func (*GenesisState) GetPinnedCodeIDs

func (m *GenesisState) GetPinnedCodeIDs() []uint64

func (*GenesisState) GetPrivilegedContractAddresses

func (m *GenesisState) GetPrivilegedContractAddresses() []string

func (*GenesisState) GetSequences

func (m *GenesisState) GetSequences() []types.Sequence

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

func (g GenesisState) RawWasmState() wasmtypes.GenesisState

RawWasmState convert to wasm genesis state for vanilla import. Custom data models for privileged contracts are not included

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

func (g GenesisState) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements codectypes.UnpackInterfaces

func (GenesisState) ValidateBasic

func (g GenesisState) ValidateBasic() 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 KVModel

type KVModel struct {
	Models []types.Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models"`
}

KVModel is a wrapper around the wasmd default key value model.

func (*KVModel) Descriptor

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

func (*KVModel) GetModels

func (m *KVModel) GetModels() []types.Model

func (*KVModel) Marshal

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

func (*KVModel) MarshalTo

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

func (*KVModel) MarshalToSizedBuffer

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

func (*KVModel) ProtoMessage

func (*KVModel) ProtoMessage()

func (*KVModel) Reset

func (m *KVModel) Reset()

func (*KVModel) Size

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

func (*KVModel) String

func (m *KVModel) String() string

func (*KVModel) Unmarshal

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

func (*KVModel) XXX_DiscardUnknown

func (m *KVModel) XXX_DiscardUnknown()

func (*KVModel) XXX_Marshal

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

func (*KVModel) XXX_Merge

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

func (*KVModel) XXX_Size

func (m *KVModel) XXX_Size() int

func (*KVModel) XXX_Unmarshal

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

type Minter

type Minter interface {
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
	MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
}

type PrivilegeType

type PrivilegeType byte

PrivilegeType is a system callback to a contract

const PrivilegeTypeEmpty PrivilegeType = 0

PrivilegeTypeEmpty is empty value

func PrivilegeTypeFrom

func PrivilegeTypeFrom(name string) *PrivilegeType

PrivilegeTypeFrom convert name to type. Returns nil when none matches

func (PrivilegeType) IsSingleton

func (t PrivilegeType) IsSingleton() bool

IsSingleton returns if only a single contract instance for this type can register (true) or multiple (false)

func (PrivilegeType) MarshalJSON

func (t PrivilegeType) MarshalJSON() ([]byte, error)

func (PrivilegeType) String

func (t PrivilegeType) String() string

func (*PrivilegeType) UnmarshalJSON

func (t *PrivilegeType) UnmarshalJSON(raw []byte) error

func (PrivilegeType) ValidateBasic

func (t PrivilegeType) ValidateBasic() error

ValidateBasic checks if the callback type was registered

type PromoteToPrivilegedContractProposal

type PromoteToPrivilegedContractProposal struct {
	// Title is a short summary
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"`
	// Description is a human readable text
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"`
	// Contract is the address of the smart contract
	Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty" yaml:"contract"`
}

PromoteToPrivilegedContractProposal gov proposal content type to add "privileges" to a contract

func (*PromoteToPrivilegedContractProposal) Descriptor

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

func (*PromoteToPrivilegedContractProposal) Equal

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

func (PromoteToPrivilegedContractProposal) GetDescription

func (p PromoteToPrivilegedContractProposal) GetDescription() string

GetDescription returns the human readable description of the proposal

func (*PromoteToPrivilegedContractProposal) GetTitle

GetTitle returns the title of the proposal

func (*PromoteToPrivilegedContractProposal) Marshal

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

func (*PromoteToPrivilegedContractProposal) MarshalTo

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

func (*PromoteToPrivilegedContractProposal) MarshalToSizedBuffer

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

func (PromoteToPrivilegedContractProposal) MarshalYAML

func (p PromoteToPrivilegedContractProposal) MarshalYAML() (interface{}, error)

MarshalYAML pretty prints the wasm byte code

func (PromoteToPrivilegedContractProposal) ProposalRoute

func (p PromoteToPrivilegedContractProposal) ProposalRoute() string

ProposalRoute returns the routing key of a parameter change proposal.

func (PromoteToPrivilegedContractProposal) ProposalType

ProposalType returns the type

func (*PromoteToPrivilegedContractProposal) ProtoMessage

func (*PromoteToPrivilegedContractProposal) ProtoMessage()

func (*PromoteToPrivilegedContractProposal) Reset

func (*PromoteToPrivilegedContractProposal) Size

func (PromoteToPrivilegedContractProposal) String

String implements the Stringer interface.

func (*PromoteToPrivilegedContractProposal) Unmarshal

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

func (PromoteToPrivilegedContractProposal) ValidateBasic

func (p PromoteToPrivilegedContractProposal) ValidateBasic() error

ValidateBasic validates the proposal

func (*PromoteToPrivilegedContractProposal) XXX_DiscardUnknown

func (m *PromoteToPrivilegedContractProposal) XXX_DiscardUnknown()

func (*PromoteToPrivilegedContractProposal) XXX_Marshal

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

func (*PromoteToPrivilegedContractProposal) XXX_Merge

func (*PromoteToPrivilegedContractProposal) XXX_Size

func (*PromoteToPrivilegedContractProposal) XXX_Unmarshal

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

type ProposalType

type ProposalType string
const (
	ProposalTypePromoteContract ProposalType = "PromoteToPrivilegedContract"
	ProposalTypeDemoteContract  ProposalType = "DemotePrivilegedContract"
)

type QueryClient

type QueryClient interface {
	// PrivilegedContracts returns all privileged contracts
	PrivilegedContracts(ctx context.Context, in *QueryPrivilegedContractsRequest, opts ...grpc.CallOption) (*QueryPrivilegedContractsResponse, error)
	// ContractsByPrivilegeType returns all contracts that have registered for the
	// privilege type
	ContractsByPrivilegeType(ctx context.Context, in *QueryContractsByPrivilegeTypeRequest, opts ...grpc.CallOption) (*QueryContractsByPrivilegeTypeResponse, 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 QueryContractsByPrivilegeTypeRequest

type QueryContractsByPrivilegeTypeRequest struct {
	PrivilegeType string `protobuf:"bytes,1,opt,name=privilege_type,json=privilegeType,proto3" json:"privilege_type,omitempty"`
}

QueryContractsByPrivilegeTypeRequest is the request type for the Query/ContractsByPrivilegeType RPC method

func (*QueryContractsByPrivilegeTypeRequest) Descriptor

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

func (*QueryContractsByPrivilegeTypeRequest) GetPrivilegeType

func (m *QueryContractsByPrivilegeTypeRequest) GetPrivilegeType() string

func (*QueryContractsByPrivilegeTypeRequest) Marshal

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

func (*QueryContractsByPrivilegeTypeRequest) MarshalTo

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

func (*QueryContractsByPrivilegeTypeRequest) MarshalToSizedBuffer

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

func (*QueryContractsByPrivilegeTypeRequest) ProtoMessage

func (*QueryContractsByPrivilegeTypeRequest) ProtoMessage()

func (*QueryContractsByPrivilegeTypeRequest) Reset

func (*QueryContractsByPrivilegeTypeRequest) Size

func (*QueryContractsByPrivilegeTypeRequest) String

func (*QueryContractsByPrivilegeTypeRequest) Unmarshal

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

func (*QueryContractsByPrivilegeTypeRequest) XXX_DiscardUnknown

func (m *QueryContractsByPrivilegeTypeRequest) XXX_DiscardUnknown()

func (*QueryContractsByPrivilegeTypeRequest) XXX_Marshal

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

func (*QueryContractsByPrivilegeTypeRequest) XXX_Merge

func (*QueryContractsByPrivilegeTypeRequest) XXX_Size

func (*QueryContractsByPrivilegeTypeRequest) XXX_Unmarshal

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

type QueryContractsByPrivilegeTypeResponse

type QueryContractsByPrivilegeTypeResponse struct {
	// contracts are a set of contract addresses
	Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"`
}

QueryContractsByPrivilegeTypeResponse is the response type for the Query/ContractsByPrivilegeType RPC method

func (*QueryContractsByPrivilegeTypeResponse) Descriptor

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

func (*QueryContractsByPrivilegeTypeResponse) GetContracts

func (m *QueryContractsByPrivilegeTypeResponse) GetContracts() []string

func (*QueryContractsByPrivilegeTypeResponse) Marshal

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

func (*QueryContractsByPrivilegeTypeResponse) MarshalTo

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

func (*QueryContractsByPrivilegeTypeResponse) MarshalToSizedBuffer

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

func (*QueryContractsByPrivilegeTypeResponse) ProtoMessage

func (*QueryContractsByPrivilegeTypeResponse) ProtoMessage()

func (*QueryContractsByPrivilegeTypeResponse) Reset

func (*QueryContractsByPrivilegeTypeResponse) Size

func (*QueryContractsByPrivilegeTypeResponse) String

func (*QueryContractsByPrivilegeTypeResponse) Unmarshal

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

func (*QueryContractsByPrivilegeTypeResponse) XXX_DiscardUnknown

func (m *QueryContractsByPrivilegeTypeResponse) XXX_DiscardUnknown()

func (*QueryContractsByPrivilegeTypeResponse) XXX_Marshal

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

func (*QueryContractsByPrivilegeTypeResponse) XXX_Merge

func (*QueryContractsByPrivilegeTypeResponse) XXX_Size

func (*QueryContractsByPrivilegeTypeResponse) XXX_Unmarshal

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

type QueryPrivilegedContractsRequest

type QueryPrivilegedContractsRequest struct{}

QueryPrivilegedContractsResponse is the request type for the Query/PrivilegedContracts RPC method

func (*QueryPrivilegedContractsRequest) Descriptor

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

func (*QueryPrivilegedContractsRequest) Marshal

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

func (*QueryPrivilegedContractsRequest) MarshalTo

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

func (*QueryPrivilegedContractsRequest) MarshalToSizedBuffer

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

func (*QueryPrivilegedContractsRequest) ProtoMessage

func (*QueryPrivilegedContractsRequest) ProtoMessage()

func (*QueryPrivilegedContractsRequest) Reset

func (*QueryPrivilegedContractsRequest) Size

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

func (*QueryPrivilegedContractsRequest) String

func (*QueryPrivilegedContractsRequest) Unmarshal

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

func (*QueryPrivilegedContractsRequest) XXX_DiscardUnknown

func (m *QueryPrivilegedContractsRequest) XXX_DiscardUnknown()

func (*QueryPrivilegedContractsRequest) XXX_Marshal

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

func (*QueryPrivilegedContractsRequest) XXX_Merge

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

func (*QueryPrivilegedContractsRequest) XXX_Size

func (m *QueryPrivilegedContractsRequest) XXX_Size() int

func (*QueryPrivilegedContractsRequest) XXX_Unmarshal

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

type QueryPrivilegedContractsResponse

type QueryPrivilegedContractsResponse struct {
	// contracts are a set of contract addresses
	Contracts []string `protobuf:"bytes,1,rep,name=contracts,proto3" json:"contracts,omitempty"`
}

QueryPrivilegedContractsResponse is the response type for the Query/PrivilegedContracts RPC method

func (*QueryPrivilegedContractsResponse) Descriptor

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

func (*QueryPrivilegedContractsResponse) GetContracts

func (m *QueryPrivilegedContractsResponse) GetContracts() []string

func (*QueryPrivilegedContractsResponse) Marshal

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

func (*QueryPrivilegedContractsResponse) MarshalTo

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

func (*QueryPrivilegedContractsResponse) MarshalToSizedBuffer

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

func (*QueryPrivilegedContractsResponse) ProtoMessage

func (*QueryPrivilegedContractsResponse) ProtoMessage()

func (*QueryPrivilegedContractsResponse) Reset

func (*QueryPrivilegedContractsResponse) Size

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

func (*QueryPrivilegedContractsResponse) String

func (*QueryPrivilegedContractsResponse) Unmarshal

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

func (*QueryPrivilegedContractsResponse) XXX_DiscardUnknown

func (m *QueryPrivilegedContractsResponse) XXX_DiscardUnknown()

func (*QueryPrivilegedContractsResponse) XXX_Marshal

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

func (*QueryPrivilegedContractsResponse) XXX_Merge

func (*QueryPrivilegedContractsResponse) XXX_Size

func (m *QueryPrivilegedContractsResponse) XXX_Size() int

func (*QueryPrivilegedContractsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// PrivilegedContracts returns all privileged contracts
	PrivilegedContracts(context.Context, *QueryPrivilegedContractsRequest) (*QueryPrivilegedContractsResponse, error)
	// ContractsByPrivilegeType returns all contracts that have registered for the
	// privilege type
	ContractsByPrivilegeType(context.Context, *QueryContractsByPrivilegeTypeRequest) (*QueryContractsByPrivilegeTypeResponse, error)
}

QueryServer is the server API for Query service.

type RegisteredPrivilege

type RegisteredPrivilege struct {
	Position      uint32 `protobuf:"varint,1,opt,name=position,proto3" json:"position,omitempty"`
	PrivilegeType string `protobuf:"bytes,2,opt,name=privilege_type,json=privilegeType,proto3" json:"privilege_type,omitempty"`
}

RegisteredPrivilege stores position and privilege name

func (*RegisteredPrivilege) Descriptor

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

func (*RegisteredPrivilege) Equal

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

func (*RegisteredPrivilege) Marshal

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

func (*RegisteredPrivilege) MarshalTo

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

func (*RegisteredPrivilege) MarshalToSizedBuffer

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

func (*RegisteredPrivilege) ProtoMessage

func (*RegisteredPrivilege) ProtoMessage()

func (*RegisteredPrivilege) Reset

func (m *RegisteredPrivilege) Reset()

func (*RegisteredPrivilege) Size

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

func (*RegisteredPrivilege) String

func (m *RegisteredPrivilege) String() string

func (*RegisteredPrivilege) Unmarshal

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

func (RegisteredPrivilege) ValidateBasic

func (r RegisteredPrivilege) ValidateBasic() error

ValidateBasic syntax checks

func (*RegisteredPrivilege) XXX_DiscardUnknown

func (m *RegisteredPrivilege) XXX_DiscardUnknown()

func (*RegisteredPrivilege) XXX_Marshal

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

func (*RegisteredPrivilege) XXX_Merge

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

func (*RegisteredPrivilege) XXX_Size

func (m *RegisteredPrivilege) XXX_Size() int

func (*RegisteredPrivilege) XXX_Unmarshal

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

type Staker

type Staker interface {
	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
	DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
	UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

Staker for vesting account staking

type TWasmConfig

type TWasmConfig struct {
	WasmConfig wasmtypes.WasmConfig
}

func DefaultTWasmConfig

func DefaultTWasmConfig() TWasmConfig

type TgradeContractDetails

type TgradeContractDetails struct {
	RegisteredPrivileges []RegisteredPrivilege `protobuf:"bytes,1,rep,name=registered_privileges,json=registeredPrivileges,proto3" json:"registered_privileges"`
}

TgradeContractDetails is a custom extension to the wasmd ContractInfo

func TgradeContractDetailsFixture

func TgradeContractDetailsFixture(t *testing.T, mutators ...func(d *TgradeContractDetails)) TgradeContractDetails

func (*TgradeContractDetails) AddRegisteredPrivilege

func (d *TgradeContractDetails) AddRegisteredPrivilege(t PrivilegeType, pos uint8)

AddRegisteredPrivilege add privilege type to list

func (*TgradeContractDetails) Descriptor

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

func (*TgradeContractDetails) Equal

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

func (*TgradeContractDetails) HasRegisteredPrivilege

func (d *TgradeContractDetails) HasRegisteredPrivilege(c PrivilegeType) bool

HasRegisteredPrivilege returns true when given type was registered by this contract

func (TgradeContractDetails) IterateRegisteredPrivileges

func (d TgradeContractDetails) IterateRegisteredPrivileges(cb func(c PrivilegeType, pos uint8) bool)

func (*TgradeContractDetails) Marshal

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

func (*TgradeContractDetails) MarshalTo

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

func (*TgradeContractDetails) MarshalToSizedBuffer

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

func (*TgradeContractDetails) ProtoMessage

func (*TgradeContractDetails) ProtoMessage()

func (*TgradeContractDetails) RemoveRegisteredPrivilege

func (d *TgradeContractDetails) RemoveRegisteredPrivilege(t PrivilegeType, pos uint8)

RemoveRegisteredPrivilege remove privilege type from list

func (*TgradeContractDetails) Reset

func (m *TgradeContractDetails) Reset()

func (*TgradeContractDetails) Size

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

func (*TgradeContractDetails) String

func (m *TgradeContractDetails) String() string

func (*TgradeContractDetails) Unmarshal

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

func (TgradeContractDetails) ValidateBasic

func (d TgradeContractDetails) ValidateBasic() error

ValidateBasic syntax checks

func (*TgradeContractDetails) XXX_DiscardUnknown

func (m *TgradeContractDetails) XXX_DiscardUnknown()

func (*TgradeContractDetails) XXX_Marshal

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

func (*TgradeContractDetails) XXX_Merge

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

func (*TgradeContractDetails) XXX_Size

func (m *TgradeContractDetails) XXX_Size() int

func (*TgradeContractDetails) XXX_Unmarshal

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

type UnimplementedQueryServer

type UnimplementedQueryServer struct{}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) PrivilegedContracts

Jump to

Keyboard shortcuts

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