types

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package types adds AccountKeeper and CVMKeeper expected keeper.

Index

Constants

View Source
const (
	EventTypeLockedSendToVestingAccount = "locked_send_to_vesting_account"

	AttributeKeyUnlocker = "unlocker"
)
View Source
const (
	TypeMsgLockedSend = "locked_send"
)

bank message types

Variables

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 (
	ErrCodeExists = sdkerrors.Register(bankTypes.ModuleName, 8, "can't perform multisend to a contract address")
)
View Source
var (

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

Functions

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	NewAccount(ctx sdk.Context, acc types.AccountI) types.AccountI

	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
	GetAllAccounts(ctx sdk.Context) []types.AccountI
	SetAccount(ctx sdk.Context, acc types.AccountI)

	HasAccount(ctx sdk.Context, addr sdk.AccAddress) bool
	IterateAccounts(ctx sdk.Context, process func(types.AccountI) bool)

	ValidatePermissions(macc types.ModuleAccountI) error

	GetModuleAddress(moduleName string) sdk.AccAddress
	GetModuleAddressAndPermissions(moduleName string) (addr sdk.AccAddress, permissions []string)
	GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (types.ModuleAccountI, []string)
	GetModuleAccount(ctx sdk.Context, moduleName string) types.ModuleAccountI
	SetModuleAccount(ctx sdk.Context, macc types.ModuleAccountI)
}

AccountKeeper defines the account contract that must be fulfilled when creating a x/bank keeper.

type CVMKeeper

type CVMKeeper interface {
	Send(ctx sdk.Context, from, to sdk.AccAddress, value sdk.Coins) error
	GetCode(ctx sdk.Context, addr crypto.Address) ([]byte, error)
}

CVMKeeper defines the CVM interface that must be fulfilled when wrapping the basekeeper.

type MsgClient

type MsgClient interface {
	// LockedSend defines a method for sending coins and locking them from one
	// account to another account.
	LockedSend(ctx context.Context, in *MsgLockedSend, opts ...grpc.CallOption) (*MsgLockedSendResponse, 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 MsgLockedSend

type MsgLockedSend struct {
	FromAddress     string                                   `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"`
	ToAddress       string                                   `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"`
	UnlockerAddress string                                   `` /* 130-byte string literal not displayed */
	Amount          github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

MsgLockedSend represents a message to send and lock coins from one account to another.

func NewMsgLockedSend

func NewMsgLockedSend(from, to sdk.AccAddress, unlocker string, amount sdk.Coins) *MsgLockedSend

NewMsgLockedSend returns a MsgLockedSend object.

func (*MsgLockedSend) Descriptor

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

func (MsgLockedSend) GetSignBytes

func (m MsgLockedSend) GetSignBytes() []byte

GetSignBytes encodes the message for signing.

func (MsgLockedSend) GetSigners

func (m MsgLockedSend) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required.

func (*MsgLockedSend) Marshal

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

func (*MsgLockedSend) MarshalTo

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

func (*MsgLockedSend) MarshalToSizedBuffer

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

func (*MsgLockedSend) ProtoMessage

func (*MsgLockedSend) ProtoMessage()

func (*MsgLockedSend) Reset

func (m *MsgLockedSend) Reset()

func (MsgLockedSend) Route

func (m MsgLockedSend) Route() string

Route returns the name of the module.

func (*MsgLockedSend) Size

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

func (*MsgLockedSend) String

func (m *MsgLockedSend) String() string

func (MsgLockedSend) Type

func (m MsgLockedSend) Type() string

Type returns a human-readable string for the message.

func (*MsgLockedSend) Unmarshal

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

func (MsgLockedSend) ValidateBasic

func (m MsgLockedSend) ValidateBasic() error

ValidateBasic runs stateless checks on the message.

func (*MsgLockedSend) XXX_DiscardUnknown

func (m *MsgLockedSend) XXX_DiscardUnknown()

func (*MsgLockedSend) XXX_Marshal

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

func (*MsgLockedSend) XXX_Merge

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

func (*MsgLockedSend) XXX_Size

func (m *MsgLockedSend) XXX_Size() int

func (*MsgLockedSend) XXX_Unmarshal

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

type MsgLockedSendResponse

type MsgLockedSendResponse struct {
}

MsgLockedSendResponse defines the Msg/LockedSend response type.

func (*MsgLockedSendResponse) Descriptor

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

func (*MsgLockedSendResponse) Marshal

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

func (*MsgLockedSendResponse) MarshalTo

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

func (*MsgLockedSendResponse) MarshalToSizedBuffer

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

func (*MsgLockedSendResponse) ProtoMessage

func (*MsgLockedSendResponse) ProtoMessage()

func (*MsgLockedSendResponse) Reset

func (m *MsgLockedSendResponse) Reset()

func (*MsgLockedSendResponse) Size

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

func (*MsgLockedSendResponse) String

func (m *MsgLockedSendResponse) String() string

func (*MsgLockedSendResponse) Unmarshal

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

func (*MsgLockedSendResponse) XXX_DiscardUnknown

func (m *MsgLockedSendResponse) XXX_DiscardUnknown()

func (*MsgLockedSendResponse) XXX_Marshal

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

func (*MsgLockedSendResponse) XXX_Merge

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

func (*MsgLockedSendResponse) XXX_Size

func (m *MsgLockedSendResponse) XXX_Size() int

func (*MsgLockedSendResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// LockedSend defines a method for sending coins and locking them from one
	// account to another account.
	LockedSend(context.Context, *MsgLockedSend) (*MsgLockedSendResponse, error)
}

MsgServer is the server API for Msg service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) LockedSend

Jump to

Keyboard shortcuts

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