types

package
v0.8.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 39 Imported by: 8

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 (
	// PrivilegeTypeEmpty is empty value
	PrivilegeTypeEmpty PrivilegeType = 0

	// 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)
)
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 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 {
	Wasm                        types.GenesisState `protobuf:"bytes,1,opt,name=wasm,proto3" json:"wasm_genesis,omitempty"`
	PrivilegedContractAddresses []string           `` /* 144-byte string literal not displayed */
	PinnedCodeIDs               []uint64           `protobuf:"varint,3,rep,packed,name=pinned_code_ids,json=pinnedCodeIds,proto3" json:"pinned_code_ids,omitempty"`
}

func GenesisStateFixture

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

func (*GenesisState) Descriptor

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

func (*GenesisState) GetPinnedCodeIDs

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

func (*GenesisState) GetPrivilegedContractAddresses

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

func (*GenesisState) GetWasm

func (m *GenesisState) GetWasm() types.GenesisState

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

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 added in v0.8.0

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 returs 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