keeper

package
v1.7.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VMBRIDGE_START_INNERTX = "vmbridge_start"
	VMBRIDGE_END_INNERTX   = "vmbridge_end"
)

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.

func PrecompileHooks added in v1.7.4

func PrecompileHooks(k *Keeper) vm.CallToWasmByPrecompile

func RegisterSendToEvmEncoder

func RegisterSendToEvmEncoder(cdc *codec.ProtoCodec) *wasm.MessageEncoders

RegisterSendToEvmEncoder needs to be registered in app setup to handle custom message callbacks

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
	SetAccount(ctx sdk.Context, acc authexported.Account)
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authexported.Account
}

AccountKeeper defines the expected account keeper interface

type BankKeeper added in v1.7.0

type BankKeeper interface {
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
}

type CallToWasmEventHandler added in v1.7.0

type CallToWasmEventHandler struct {
	Keeper
}

event __OKCCallToWasm(string wasmAddr,uint256 value, string calldata)

func NewCallToWasmEventHandler added in v1.7.0

func NewCallToWasmEventHandler(k Keeper) *CallToWasmEventHandler

func (CallToWasmEventHandler) EventID added in v1.7.0

func (h CallToWasmEventHandler) EventID() common.Hash

EventID Return the id of the log signature it handles

func (CallToWasmEventHandler) Handle added in v1.7.0

func (h CallToWasmEventHandler) Handle(ctx sdk.Context, contract common.Address, data []byte) error

Handle Process the log

type EVMKeeper

type EVMKeeper interface {
	GetChainConfig(ctx sdk.Context) (evmtypes.ChainConfig, bool)
	GenerateCSDBParams() evmtypes.CommitStateDBParams
	GetParams(ctx sdk.Context) evmtypes.Params
	GetCallToCM() vm.CallToWasmByPrecompile
	GetBlockHash() ethcmn.Hash
	AddInnerTx(...interface{})
	AddContract(...interface{})
}

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.CodecProxy, logger log.Logger, evmKeeper EVMKeeper, wasmKeeper WASMKeeper, accountKeeper AccountKeeper, bk BankKeeper) *Keeper

func (Keeper) CallEvm

func (k Keeper) CallEvm(ctx sdk.Context, callerAddr common.Address, to *common.Address, value *big.Int, data []byte) (*evmtypes.ExecutionResult, *evmtypes.ResultData, error)

callEvm execute an evm message from native module

func (Keeper) CallToEvm added in v1.7.0

func (k Keeper) CallToEvm(ctx sdk.Context, caller, contract string, calldata string, value sdk.Int) (response string, err error)

wasm call evm

func (Keeper) CallToWasm added in v1.7.0

func (k Keeper) CallToWasm(ctx sdk.Context, caller sdk.AccAddress, wasmContractAddr string, value sdk.Int, calldata string) ([]byte, error)

func (Keeper) GetProtoCodec

func (k Keeper) GetProtoCodec() *codec.ProtoCodec

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

func (Keeper) QueryToWasm added in v1.7.4

func (k Keeper) QueryToWasm(ctx sdk.Context, wasmContractAddr string, calldata []byte) ([]byte, error)

func (Keeper) SendToEvm

func (k Keeper) SendToEvm(ctx sdk.Context, caller, contract string, recipient string, amount sdk.Int) (success bool, err error)

wasm call evm for erc20 exchange cw20,

func (Keeper) SendToWasm

func (k Keeper) SendToWasm(ctx sdk.Context, caller sdk.AccAddress, wasmContractAddr, recipient string, amount sdk.Int) error

type SendToWasmEventHandler

type SendToWasmEventHandler struct {
	Keeper
}

event __SendToWasmEventName(string wasmAddr,string recipient, string amount)

func NewSendToWasmEventHandler

func NewSendToWasmEventHandler(k Keeper) *SendToWasmEventHandler

func (SendToWasmEventHandler) EventID

func (h SendToWasmEventHandler) EventID() common.Hash

EventID Return the id of the log signature it handles

func (SendToWasmEventHandler) Handle

func (h SendToWasmEventHandler) Handle(ctx sdk.Context, contract common.Address, data []byte) error

Handle Process the log

type WASMKeeper

type WASMKeeper interface {
	// Execute executes the contract instance
	Execute(ctx sdk.Context, contractAddress sdk.WasmAddress, caller sdk.WasmAddress, msg []byte, coins sdk.Coins) ([]byte, error)
	GetParams(ctx sdk.Context) wasmtypes.Params
	NewQueryHandler(ctx sdk.Context, contractAddress sdk.WasmAddress) wasmvmtypes.Querier
	RuntimeGasForContract(ctx sdk.Context) uint64
}

Jump to

Keyboard shortcuts

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