types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the contract module
	ModuleName = "vmbridge"

	// StoreKey is the string store representation
	StoreKey = ModuleName

	// TStoreKey is the string transient store representation
	TStoreKey = "transient_" + ModuleName

	// QuerierRoute is the querier route for the wasm module
	QuerierRoute = ModuleName

	// RouterKey is the msg router key for the wasm module
	RouterKey = ModuleName
)
View Source
const (
	SendToWasmEventName  = "__FURYCSendToWasm"
	WasmCalledMethodName = "mintCW20"

	SendToEvmSubMsgName = "send-to-evm"
	EvmCalledMethodName = "mintERC20"
)

Variables

View Source
var (
	// ErrChainConfigNotFound returns an error if the chain config cannot be found on the store.
	ErrChainConfigNotFound = sdkerrors.Register(ModuleName, 1, "chain configuration not found")

	ErrCallerOfEvmEmpty = sdkerrors.Register(ModuleName, 2, "the caller of evm can not be nil")

	ErrCannotCreate = sdkerrors.Register(ModuleName, 3, "create is not supprot for vmbridge")

	ErrIsNotWasmAddr = sdkerrors.Register(ModuleName, 4, "call wasm contract must use wasmaddress")
	ErrIsNotEvmAddr  = sdkerrors.Register(ModuleName, 5, "call evm contract must use evmaddress")

	ErrAmountNegative   = sdkerrors.Register(ModuleName, 6, "the amount can not negative")
	ErrEvmExecuteFailed = sdkerrors.Register(ModuleName, 7, "the evm execute")

	ErrVMBridgeEnable = sdkerrors.Register(ModuleName, 8, "the vmbridge is disable")
	ErrIsNotFURYCAddr = sdkerrors.Register(ModuleName, 9, "the address prefix must be ex")
	ErrIsNotETHAddr   = sdkerrors.Register(ModuleName, 10, "the address prefix must be 0x")
)
View Source
var (
	// SendToWasmEventName represent the signature of
	// `event __SendToWasmEventName(string wasmAddr,string recipient, string amount)`
	SendToWasmEvent abi.Event

	EvmABI abi.ABI
)
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")
)

Functions

func ErrMsgSendToEvm

func ErrMsgSendToEvm(str string) sdk.EnvelopedErr

func GetEVMABIConfig

func GetEVMABIConfig(data []byte) (abi.ABI, abi.Event)

func GetMintCW20Input

func GetMintCW20Input(amount, recipient string) ([]byte, error)

func GetMintERC20Input

func GetMintERC20Input(callerAddr string, recipient common.Address, amount *big.Int) ([]byte, error)

func GetMintERC20Output

func GetMintERC20Output(data []byte) (bool, error)

func RegisterInterface

func RegisterInterface(registry interfacetypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

Types

type MintCW20Method

type MintCW20Method struct {
	Amount    string `json:"amount"`
	Recipient string `json:"recipient"`
}

type MintERC20Method

type MintERC20Method struct {
	ABI abi.ABI
}

type MsgClient

type MsgClient interface {
	// StoreCode to submit Wasm code to the system
	SendToEvmEvent(ctx context.Context, in *MsgSendToEvm, opts ...grpc.CallOption) (*MsgSendToEvmResponse, 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 MsgSendToEvm

type MsgSendToEvm struct {
	// Sender is the that actor that signed the messages
	Sender    string  `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Contract  string  `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty"`
	Recipient string  `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"`
	Amount    sdk.Int `protobuf:"bytes,4,opt,name=amount,proto3,customtype=Int" json:"amount"`
}

MsgStoreCode submit Wasm code to the system

func (*MsgSendToEvm) Descriptor

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

func (MsgSendToEvm) GetSignBytes

func (msg MsgSendToEvm) GetSignBytes() []byte

func (MsgSendToEvm) GetSigners

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

func (*MsgSendToEvm) Marshal

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

func (*MsgSendToEvm) MarshalTo

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

func (*MsgSendToEvm) MarshalToSizedBuffer

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

func (*MsgSendToEvm) ProtoMessage

func (*MsgSendToEvm) ProtoMessage()

func (*MsgSendToEvm) Reset

func (m *MsgSendToEvm) Reset()

func (MsgSendToEvm) Route

func (msg MsgSendToEvm) Route() string

func (*MsgSendToEvm) Size

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

func (*MsgSendToEvm) String

func (m *MsgSendToEvm) String() string

func (MsgSendToEvm) Type

func (msg MsgSendToEvm) Type() string

func (*MsgSendToEvm) Unmarshal

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

func (MsgSendToEvm) ValidateBasic

func (msg MsgSendToEvm) ValidateBasic() error

func (*MsgSendToEvm) XXX_DiscardUnknown

func (m *MsgSendToEvm) XXX_DiscardUnknown()

func (*MsgSendToEvm) XXX_Marshal

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

func (*MsgSendToEvm) XXX_Merge

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

func (*MsgSendToEvm) XXX_Size

func (m *MsgSendToEvm) XXX_Size() int

func (*MsgSendToEvm) XXX_Unmarshal

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

type MsgSendToEvmResponse

type MsgSendToEvmResponse struct {
	// CodeID is the reference to the stored WASM code
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
}

MsgStoreCodeResponse returns store result data.

func (*MsgSendToEvmResponse) Descriptor

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

func (*MsgSendToEvmResponse) Marshal

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

func (*MsgSendToEvmResponse) MarshalTo

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

func (*MsgSendToEvmResponse) MarshalToSizedBuffer

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

func (*MsgSendToEvmResponse) ProtoMessage

func (*MsgSendToEvmResponse) ProtoMessage()

func (*MsgSendToEvmResponse) Reset

func (m *MsgSendToEvmResponse) Reset()

func (*MsgSendToEvmResponse) Size

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

func (*MsgSendToEvmResponse) String

func (m *MsgSendToEvmResponse) String() string

func (*MsgSendToEvmResponse) Unmarshal

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

func (*MsgSendToEvmResponse) XXX_DiscardUnknown

func (m *MsgSendToEvmResponse) XXX_DiscardUnknown()

func (*MsgSendToEvmResponse) XXX_Marshal

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

func (*MsgSendToEvmResponse) XXX_Merge

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

func (*MsgSendToEvmResponse) XXX_Size

func (m *MsgSendToEvmResponse) XXX_Size() int

func (*MsgSendToEvmResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// StoreCode to submit Wasm code to the system
	SendToEvmEvent(context.Context, *MsgSendToEvm) (*MsgSendToEvmResponse, 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) SendToEvmEvent

Jump to

Keyboard shortcuts

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