types

package
v0.0.4-testnet.mage Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AttributeValueCategory = ModuleName

	// Event Types
	EventTypeConvertERC20ToCoin = "convert_erc20_to_coin"
	EventTypeConvertCoinToERC20 = "convert_coin_to_erc20"

	// Event Attributes - Common
	AttributeKeyReceiver = "receiver"
	AttributeKeyAmount   = "amount"

	// Event Attributes - Conversions
	AttributeKeyInitiator    = "initiator"
	AttributeKeyERC20Address = "erc20_address"
)

Events for the module

View Source
const (
	// ModuleName name that will be used throughout the module
	ModuleName = "evmutil"

	StoreKey = "utilevm" // note: cannot be emvutil due to collision with x/evm

	// RouterKey Top level router key
	RouterKey = ModuleName
)
View Source
const (
	TypeMsgConvertCoinToERC20 = "evmutil_convert_coin_to_erc20"
	TypeMsgConvertERC20ToCoin = "evmutil_convert_erc20_to_coin"
)

legacy message types

Variables

View Source
var (
	//go:embed ethermint_json/ERC20MintableBurnable.json
	ERC20MintableBurnableJSON []byte

	// ERC20MintableBurnableContract is the compiled erc20 contract
	ERC20MintableBurnableContract evmtypes.CompiledContract

	// ERC20MintableBurnableAddress is the erc20 module address
	ERC20MintableBurnableAddress common.Address
)
View Source
var (
	ErrInvalidLengthConversionPair        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConversionPair          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConversionPair = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrABIPack                 = sdkerrors.Register(ModuleName, 2, "contract ABI pack failed")
	ErrEVMCall                 = sdkerrors.Register(ModuleName, 3, "EVM call unexpected error")
	ErrConversionNotEnabled    = sdkerrors.Register(ModuleName, 4, "ERC20 token not enabled to convert to sdk.Coin")
	ErrBalanceInvariance       = sdkerrors.Register(ModuleName, 5, "post EVM transfer balance invariant failed")
	ErrUnexpectedContractEvent = sdkerrors.Register(ModuleName, 6, "unexpected contract event")
)

errors

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 (
	KeyEnabledConversionPairs = []byte("EnabledConversionPairs")
	DefaultConversionPairs    = ConversionPairs{}
)

Parameter keys and default values

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 AccountStoreKeyPrefix = []byte{0x00} // prefix for keys that store accounts
View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)
View Source
var ModuleEVMAddress common.Address

ModuleAddress is the native module address for EVM

Functions

func AccountStoreKey

func AccountStoreKey(addr sdk.AccAddress) []byte

AccountStoreKey turns an address to a key used to get the account from the store

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable for evmutil module.

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

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

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

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

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

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

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

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Account

type Account struct {
	Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
	// balance indicates the amount of amage owned by the address.
	Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"`
}

BalanceAccount defines an account in the evmutil module.

func NewAccount

func NewAccount(addr sdk.AccAddress, balance sdk.Int) *Account

func (*Account) Descriptor

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

func (*Account) Equal

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

func (*Account) Marshal

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

func (*Account) MarshalTo

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

func (*Account) MarshalToSizedBuffer

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

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) Reset

func (m *Account) Reset()

func (*Account) Size

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

func (*Account) String

func (m *Account) String() string

func (*Account) Unmarshal

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

func (Account) Validate

func (b Account) Validate() error

func (*Account) VerboseEqual

func (this *Account) VerboseEqual(that interface{}) error

func (*Account) XXX_DiscardUnknown

func (m *Account) XXX_DiscardUnknown()

func (*Account) XXX_Marshal

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

func (*Account) XXX_Merge

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

func (*Account) XXX_Size

func (m *Account) XXX_Size() int

func (*Account) XXX_Unmarshal

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

type AccountKeeper

type AccountKeeper interface {
	GetModuleAddress(moduleName string) sdk.AccAddress
	GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
}

AccountKeeper defines the expected account keeper interface

type BankKeeper

type BankKeeper interface {
	evmtypes.BankKeeper

	GetSupply(ctx sdk.Context, denom string) sdk.Coin
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected bank keeper interface

type ConversionPair

type ConversionPair struct {
	// ERC20 address of the token on the mage EVM
	MageERC20Address HexBytes `` /* 129-byte string literal not displayed */
	// Denom of the corresponding sdk.Coin
	Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"`
}

ConversionPair defines a mage ERC20 address and corresponding denom that is allowed to be converted between ERC20 and sdk.Coin

func NewConversionPair

func NewConversionPair(address InternalEVMAddress, denom string) ConversionPair

NewConversionPair returns a new ConversionPair.

func (*ConversionPair) Descriptor

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

func (*ConversionPair) Equal

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

func (ConversionPair) GetAddress

func (pair ConversionPair) GetAddress() InternalEVMAddress

GetAddress returns the InternalEVMAddress of the mage ERC20 address.

func (*ConversionPair) Marshal

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

func (*ConversionPair) MarshalTo

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

func (*ConversionPair) MarshalToSizedBuffer

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

func (*ConversionPair) ProtoMessage

func (*ConversionPair) ProtoMessage()

func (*ConversionPair) Reset

func (m *ConversionPair) Reset()

func (*ConversionPair) Size

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

func (*ConversionPair) String

func (m *ConversionPair) String() string

func (*ConversionPair) Unmarshal

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

func (ConversionPair) Validate

func (pair ConversionPair) Validate() error

Validate returns an error if the ConversionPair is invalid.

func (*ConversionPair) VerboseEqual

func (this *ConversionPair) VerboseEqual(that interface{}) error

func (*ConversionPair) XXX_DiscardUnknown

func (m *ConversionPair) XXX_DiscardUnknown()

func (*ConversionPair) XXX_Marshal

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

func (*ConversionPair) XXX_Merge

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

func (*ConversionPair) XXX_Size

func (m *ConversionPair) XXX_Size() int

func (*ConversionPair) XXX_Unmarshal

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

type ConversionPairs

type ConversionPairs []ConversionPair

ConversionPairs defines a slice of ConversionPair.

func NewConversionPairs

func NewConversionPairs(pairs ...ConversionPair) ConversionPairs

NewConversionPairs returns ConversionPairs from the provided values.

func (ConversionPairs) Validate

func (pairs ConversionPairs) Validate() error

type EvmKeeper

type EvmKeeper interface {
	// This is actually a gRPC query method
	EstimateGas(ctx context.Context, req *evmtypes.EthCallRequest) (*evmtypes.EstimateGasResponse, error)
	ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*evmtypes.MsgEthereumTxResponse, error)
}

EvmKeeper defines the expected interface needed to make EVM transactions.

type GenesisState

type GenesisState struct {
	Accounts []Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"`
	// params defines all the parameters of the module.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

GenesisState defines the evmutil module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns the default genesis state for the module.

func NewGenesisState

func NewGenesisState(accounts []Account, params Params) *GenesisState

NewGenesisState returns a new genesis state object for the module.

func (*GenesisState) Descriptor

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

func (*GenesisState) Equal

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

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic validation of genesis data.

func (*GenesisState) VerboseEqual

func (this *GenesisState) VerboseEqual(that interface{}) 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 HexBytes

type HexBytes []byte

HexBytes represents a byte slice that marshals into a 0x representation

func (HexBytes) MarshalJSON

func (b HexBytes) MarshalJSON() ([]byte, error)

MarshalJSON marshals HexBytes into a 0x json string

func (HexBytes) String

func (b HexBytes) String() string

String implements Stringer and returns the 0x representation

func (*HexBytes) UnmarshalJSON

func (b *HexBytes) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals a 0x json string into bytes

type InternalEVMAddress

type InternalEVMAddress struct {
	common.Address
}

InternalEVMAddress is a type alias of common.Address to represent an address on the mage EVM.

func NewInternalEVMAddress

func NewInternalEVMAddress(addr common.Address) InternalEVMAddress

NewInternalEVMAddress returns a new InternalEVMAddress from a common.Address.

func NewInternalEVMAddressFromString

func NewInternalEVMAddressFromString(addrStr string) (InternalEVMAddress, error)

NewInternalEVMAddressFromString returns a new InternalEVMAddress from a hex string. Returns an error if hex string is invalid.

type MsgClient

type MsgClient interface {
	// ConvertCoinToERC20 defines a method for converting sdk.Coin to mage ERC20.
	ConvertCoinToERC20(ctx context.Context, in *MsgConvertCoinToERC20, opts ...grpc.CallOption) (*MsgConvertCoinToERC20Response, error)
	// ConvertERC20ToCoin defines a method for converting mage ERC20 to sdk.Coin.
	ConvertERC20ToCoin(ctx context.Context, in *MsgConvertERC20ToCoin, opts ...grpc.CallOption) (*MsgConvertERC20ToCoinResponse, 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 MsgConvertCoinToERC20

type MsgConvertCoinToERC20 struct {
	// mage bech32 address initiating the conversion.
	Initiator string `protobuf:"bytes,1,opt,name=initiator,proto3" json:"initiator,omitempty"`
	// EVM 0x hex address that will receive the converted mage ERC20 tokens.
	Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"`
	// Amount is the sdk.Coin amount to convert.
	Amount *types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"`
}

MsgConvertCoinToERC20 defines a conversion from sdk.Coin to mage ERC20.

func NewMsgConvertCoinToERC20

func NewMsgConvertCoinToERC20(
	initiator string,
	receiver string,
	amount sdk.Coin,
) MsgConvertCoinToERC20

NewMsgConvertCoinToERC20 returns a new MsgConvertCoinToERC20

func (*MsgConvertCoinToERC20) Descriptor

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

func (*MsgConvertCoinToERC20) Equal

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

func (*MsgConvertCoinToERC20) GetAmount

func (m *MsgConvertCoinToERC20) GetAmount() *types.Coin

func (*MsgConvertCoinToERC20) GetInitiator

func (m *MsgConvertCoinToERC20) GetInitiator() string

func (*MsgConvertCoinToERC20) GetReceiver

func (m *MsgConvertCoinToERC20) GetReceiver() string

func (MsgConvertCoinToERC20) GetSignBytes

func (msg MsgConvertCoinToERC20) GetSignBytes() []byte

GetSignBytes implements the LegacyMsg.GetSignBytes method.

func (MsgConvertCoinToERC20) GetSigners

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

GetSigners returns the addresses of signers that must sign.

func (*MsgConvertCoinToERC20) Marshal

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

func (*MsgConvertCoinToERC20) MarshalTo

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

func (*MsgConvertCoinToERC20) MarshalToSizedBuffer

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

func (*MsgConvertCoinToERC20) ProtoMessage

func (*MsgConvertCoinToERC20) ProtoMessage()

func (*MsgConvertCoinToERC20) Reset

func (m *MsgConvertCoinToERC20) Reset()

func (MsgConvertCoinToERC20) Route

func (msg MsgConvertCoinToERC20) Route() string

Route implements the LegacyMsg.Route method.

func (*MsgConvertCoinToERC20) Size

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

func (*MsgConvertCoinToERC20) String

func (m *MsgConvertCoinToERC20) String() string

func (MsgConvertCoinToERC20) Type

func (msg MsgConvertCoinToERC20) Type() string

Type implements the LegacyMsg.Type method.

func (*MsgConvertCoinToERC20) Unmarshal

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

func (MsgConvertCoinToERC20) ValidateBasic

func (msg MsgConvertCoinToERC20) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgConvertCoinToERC20) VerboseEqual

func (this *MsgConvertCoinToERC20) VerboseEqual(that interface{}) error

func (*MsgConvertCoinToERC20) XXX_DiscardUnknown

func (m *MsgConvertCoinToERC20) XXX_DiscardUnknown()

func (*MsgConvertCoinToERC20) XXX_Marshal

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

func (*MsgConvertCoinToERC20) XXX_Merge

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

func (*MsgConvertCoinToERC20) XXX_Size

func (m *MsgConvertCoinToERC20) XXX_Size() int

func (*MsgConvertCoinToERC20) XXX_Unmarshal

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

type MsgConvertCoinToERC20Response

type MsgConvertCoinToERC20Response struct {
}

MsgConvertCoinToERC20Response defines the response value from Msg/ConvertCoinToERC20.

func (*MsgConvertCoinToERC20Response) Descriptor

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

func (*MsgConvertCoinToERC20Response) Equal

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

func (*MsgConvertCoinToERC20Response) Marshal

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

func (*MsgConvertCoinToERC20Response) MarshalTo

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

func (*MsgConvertCoinToERC20Response) MarshalToSizedBuffer

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

func (*MsgConvertCoinToERC20Response) ProtoMessage

func (*MsgConvertCoinToERC20Response) ProtoMessage()

func (*MsgConvertCoinToERC20Response) Reset

func (m *MsgConvertCoinToERC20Response) Reset()

func (*MsgConvertCoinToERC20Response) Size

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

func (*MsgConvertCoinToERC20Response) String

func (*MsgConvertCoinToERC20Response) Unmarshal

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

func (*MsgConvertCoinToERC20Response) VerboseEqual

func (this *MsgConvertCoinToERC20Response) VerboseEqual(that interface{}) error

func (*MsgConvertCoinToERC20Response) XXX_DiscardUnknown

func (m *MsgConvertCoinToERC20Response) XXX_DiscardUnknown()

func (*MsgConvertCoinToERC20Response) XXX_Marshal

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

func (*MsgConvertCoinToERC20Response) XXX_Merge

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

func (*MsgConvertCoinToERC20Response) XXX_Size

func (m *MsgConvertCoinToERC20Response) XXX_Size() int

func (*MsgConvertCoinToERC20Response) XXX_Unmarshal

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

type MsgConvertERC20ToCoin

type MsgConvertERC20ToCoin struct {
	// EVM 0x hex address initiating the conversion.
	Initiator string `protobuf:"bytes,1,opt,name=initiator,proto3" json:"initiator,omitempty"`
	// mage bech32 address that will receive the converted sdk.Coin.
	Receiver string `protobuf:"bytes,2,opt,name=receiver,proto3" json:"receiver,omitempty"`
	// EVM 0x hex address of the ERC20 contract.
	MageERC20Address string `protobuf:"bytes,3,opt,name=mage_erc20_address,json=mageErc20Address,proto3" json:"mage_erc20_address,omitempty"`
	// ERC20 token amount to convert.
	Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

MsgConvertERC20ToCoin defines a conversion from mage ERC20 to sdk.Coin.

func NewMsgConvertERC20ToCoin

func NewMsgConvertERC20ToCoin(
	initiator InternalEVMAddress,
	receiver sdk.AccAddress,
	contractAddr InternalEVMAddress,
	amount sdk.Int,
) MsgConvertERC20ToCoin

NewMsgConvertERC20ToCoin returns a new MsgConvertERC20ToCoin

func (*MsgConvertERC20ToCoin) Descriptor

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

func (*MsgConvertERC20ToCoin) Equal

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

func (*MsgConvertERC20ToCoin) GetInitiator

func (m *MsgConvertERC20ToCoin) GetInitiator() string

func (*MsgConvertERC20ToCoin) GetMageERC20Address

func (m *MsgConvertERC20ToCoin) GetMageERC20Address() string

func (*MsgConvertERC20ToCoin) GetReceiver

func (m *MsgConvertERC20ToCoin) GetReceiver() string

func (MsgConvertERC20ToCoin) GetSignBytes

func (msg MsgConvertERC20ToCoin) GetSignBytes() []byte

GetSignBytes implements the LegacyMsg.GetSignBytes method.

func (MsgConvertERC20ToCoin) GetSigners

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

GetSigners returns the addresses of signers that must sign.

func (*MsgConvertERC20ToCoin) Marshal

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

func (*MsgConvertERC20ToCoin) MarshalTo

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

func (*MsgConvertERC20ToCoin) MarshalToSizedBuffer

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

func (*MsgConvertERC20ToCoin) ProtoMessage

func (*MsgConvertERC20ToCoin) ProtoMessage()

func (*MsgConvertERC20ToCoin) Reset

func (m *MsgConvertERC20ToCoin) Reset()

func (MsgConvertERC20ToCoin) Route

func (msg MsgConvertERC20ToCoin) Route() string

Route implements the LegacyMsg.Route method.

func (*MsgConvertERC20ToCoin) Size

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

func (*MsgConvertERC20ToCoin) String

func (m *MsgConvertERC20ToCoin) String() string

func (MsgConvertERC20ToCoin) Type

func (msg MsgConvertERC20ToCoin) Type() string

Type implements the LegacyMsg.Type method.

func (*MsgConvertERC20ToCoin) Unmarshal

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

func (MsgConvertERC20ToCoin) ValidateBasic

func (msg MsgConvertERC20ToCoin) ValidateBasic() error

ValidateBasic does a simple validation check that doesn't require access to any other information.

func (*MsgConvertERC20ToCoin) VerboseEqual

func (this *MsgConvertERC20ToCoin) VerboseEqual(that interface{}) error

func (*MsgConvertERC20ToCoin) XXX_DiscardUnknown

func (m *MsgConvertERC20ToCoin) XXX_DiscardUnknown()

func (*MsgConvertERC20ToCoin) XXX_Marshal

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

func (*MsgConvertERC20ToCoin) XXX_Merge

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

func (*MsgConvertERC20ToCoin) XXX_Size

func (m *MsgConvertERC20ToCoin) XXX_Size() int

func (*MsgConvertERC20ToCoin) XXX_Unmarshal

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

type MsgConvertERC20ToCoinResponse

type MsgConvertERC20ToCoinResponse struct {
}

MsgConvertERC20ToCoinResponse defines the response value from Msg/MsgConvertERC20ToCoin.

func (*MsgConvertERC20ToCoinResponse) Descriptor

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

func (*MsgConvertERC20ToCoinResponse) Equal

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

func (*MsgConvertERC20ToCoinResponse) Marshal

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

func (*MsgConvertERC20ToCoinResponse) MarshalTo

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

func (*MsgConvertERC20ToCoinResponse) MarshalToSizedBuffer

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

func (*MsgConvertERC20ToCoinResponse) ProtoMessage

func (*MsgConvertERC20ToCoinResponse) ProtoMessage()

func (*MsgConvertERC20ToCoinResponse) Reset

func (m *MsgConvertERC20ToCoinResponse) Reset()

func (*MsgConvertERC20ToCoinResponse) Size

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

func (*MsgConvertERC20ToCoinResponse) String

func (*MsgConvertERC20ToCoinResponse) Unmarshal

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

func (*MsgConvertERC20ToCoinResponse) VerboseEqual

func (this *MsgConvertERC20ToCoinResponse) VerboseEqual(that interface{}) error

func (*MsgConvertERC20ToCoinResponse) XXX_DiscardUnknown

func (m *MsgConvertERC20ToCoinResponse) XXX_DiscardUnknown()

func (*MsgConvertERC20ToCoinResponse) XXX_Marshal

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

func (*MsgConvertERC20ToCoinResponse) XXX_Merge

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

func (*MsgConvertERC20ToCoinResponse) XXX_Size

func (m *MsgConvertERC20ToCoinResponse) XXX_Size() int

func (*MsgConvertERC20ToCoinResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// ConvertCoinToERC20 defines a method for converting sdk.Coin to mage ERC20.
	ConvertCoinToERC20(context.Context, *MsgConvertCoinToERC20) (*MsgConvertCoinToERC20Response, error)
	// ConvertERC20ToCoin defines a method for converting mage ERC20 to sdk.Coin.
	ConvertERC20ToCoin(context.Context, *MsgConvertERC20ToCoin) (*MsgConvertERC20ToCoinResponse, error)
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
	// enabled_conversion_pairs defines the list of conversion pairs allowed to be
	// converted between mage ERC20 and sdk.Coin
	EnabledConversionPairs ConversionPairs `` /* 148-byte string literal not displayed */
}

Params defines the evmutil module params

func DefaultParams

func DefaultParams() Params

DefaultParams returns the default parameters for evmutil.

func NewParams

func NewParams(
	conversionPairs ConversionPairs,
) Params

NewParams returns new evmutil module Params.

func (*Params) Descriptor

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

func (*Params) Equal

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

func (*Params) GetEnabledConversionPairs

func (m *Params) GetEnabledConversionPairs() ConversionPairs

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

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

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of the evmutil module's parameters.

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 returns an error if the Parmas is invalid.

func (*Params) VerboseEqual

func (this *Params) VerboseEqual(that interface{}) error

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 queries all parameters of the evmutil module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, 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 QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest defines the request type for querying x/evmutil parameters.

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Equal

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

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

func (this *QueryParamsRequest) VerboseEqual(that interface{}) 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 defines the response type for querying x/evmutil parameters.

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) Equal

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

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

func (this *QueryParamsResponse) VerboseEqual(that interface{}) 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 queries all parameters of the evmutil module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, 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) ConvertCoinToERC20

func (*UnimplementedMsgServer) ConvertERC20ToCoin

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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