Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AfterBatchExecutedEvent(ctx sdk.Context, event gravitytypes.BatchExecutedEvent)
- func (k Keeper) AfterContractCallExecutedEvent(ctx sdk.Context, event gravitytypes.ContractCallExecutedEvent)
- func (k Keeper) AfterERC20DeployedEvent(ctx sdk.Context, event gravitytypes.ERC20DeployedEvent)
- func (k Keeper) AfterSendToCosmosEvent(ctx sdk.Context, event gravitytypes.SendToCosmosEvent)
- func (k Keeper) AfterSignerSetExecutedEvent(ctx sdk.Context, event gravitytypes.SignerSetTxExecutedEvent)
- func (k Keeper) CallEVM(ctx sdk.Context, to *common.Address, data []byte, value *big.Int) (*ethtypes.Message, *evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallModuleCRC21(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
- func (k Keeper) ContractByDenom(goCtx context.Context, req *types.ContractByDenomRequest) (*types.ContractByDenomResponse, error)
- func (k Keeper) ConvertCoinFromCRC21ToNative(ctx sdk.Context, contract common.Address, receiver common.Address, ...) error
- func (k Keeper) ConvertCoinFromNativeToCRC21(ctx sdk.Context, sender common.Address, coin sdk.Coin, autoDeploy bool) error
- func (k Keeper) ConvertCoinsFromNativeToCRC21(ctx sdk.Context, sender common.Address, coins sdk.Coins, autoDeploy bool) error
- func (k Keeper) ConvertVouchersToEvmCoins(ctx sdk.Context, from string, coins sdk.Coins) error
- func (k Keeper) DeleteExternalContractForDenom(ctx sdk.Context, denom string) bool
- func (k Keeper) DenomByContract(goCtx context.Context, req *types.DenomByContractRequest) (*types.DenomByContractResponse, error)
- func (k Keeper) DeployModuleCRC21(ctx sdk.Context, denom string) (common.Address, error)
- func (k Keeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
- func (k Keeper) GetAutoContracts(ctx sdk.Context) (out []types.TokenMapping)
- func (k Keeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
- func (k Keeper) GetContractByDenom(ctx sdk.Context, denom string) (contract common.Address, found bool)
- func (k Keeper) GetDenomByContract(ctx sdk.Context, contract common.Address) (denom string, found bool)
- func (k Keeper) GetEvmParams(ctx sdk.Context) evmTypes.Params
- func (k Keeper) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSourceChannelID(ctx sdk.Context, ibcVoucherDenom string) (channelID string, err error)
- func (k Keeper) IbcTransferCoins(ctx sdk.Context, from, destination string, coins sdk.Coins) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnRecvVouchers(ctx sdk.Context, tokens sdk.Coins, receiver string)
- func (k Keeper) RegisterOrUpdateTokenMapping(ctx sdk.Context, msg *types.MsgUpdateTokenMapping) error
- func (k Keeper) ReplayBlock(goCtx context.Context, req *types.ReplayBlockRequest) (*types.ReplayBlockResponse, error)
- func (k Keeper) SetAutoContractForDenom(ctx sdk.Context, denom string, address common.Address)
- func (k Keeper) SetExternalContractForDenom(ctx sdk.Context, denom string, address common.Address) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type LogProcessEvmHook
Constants ¶
const DefaultGasCap uint64 = 25000000
DefaultGasCap defines the gas limit used to run internal evm call
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey, memKey sdk.StoreKey, paramSpace paramtypes.Subspace, bankKeeper types.BankKeeper, transferKeeper types.TransferKeeper, gravityKeeper types.GravityKeeper, evmKeeper types.EvmKeeper, accountKeeper types.AccountKeeper, ) *Keeper
func (Keeper) AfterBatchExecutedEvent ¶ added in v0.7.0
func (k Keeper) AfterBatchExecutedEvent(ctx sdk.Context, event gravitytypes.BatchExecutedEvent)
func (Keeper) AfterContractCallExecutedEvent ¶ added in v0.7.0
func (k Keeper) AfterContractCallExecutedEvent(ctx sdk.Context, event gravitytypes.ContractCallExecutedEvent)
TODO Implements GravityHooks interface
func (Keeper) AfterERC20DeployedEvent ¶ added in v0.7.0
func (k Keeper) AfterERC20DeployedEvent(ctx sdk.Context, event gravitytypes.ERC20DeployedEvent)
func (Keeper) AfterSendToCosmosEvent ¶ added in v0.7.0
func (k Keeper) AfterSendToCosmosEvent(ctx sdk.Context, event gravitytypes.SendToCosmosEvent)
func (Keeper) AfterSignerSetExecutedEvent ¶ added in v0.7.0
func (k Keeper) AfterSignerSetExecutedEvent(ctx sdk.Context, event gravitytypes.SignerSetTxExecutedEvent)
func (Keeper) CallEVM ¶ added in v0.6.1
func (k Keeper) CallEVM(ctx sdk.Context, to *common.Address, data []byte, value *big.Int) (*ethtypes.Message, *evmtypes.MsgEthereumTxResponse, error)
CallEVM execute an evm message from native module
func (Keeper) CallModuleCRC21 ¶ added in v1.0.0
func (k Keeper) CallModuleCRC21(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
CallModuleCRC21 call a method of ModuleCRC21 contract
func (Keeper) ContractByDenom ¶ added in v0.6.1
func (k Keeper) ContractByDenom(goCtx context.Context, req *types.ContractByDenomRequest) (*types.ContractByDenomResponse, error)
ContractByDenom query contract by denom, returns both external contract and auto deployed contract
func (Keeper) ConvertCoinFromCRC21ToNative ¶ added in v1.0.0
func (k Keeper) ConvertCoinFromCRC21ToNative(ctx sdk.Context, contract common.Address, receiver common.Address, amount sdk.Int) error
ConvertCoinFromCRC21ToNative convert erc20 token to native token
func (Keeper) ConvertCoinFromNativeToCRC21 ¶ added in v1.0.0
func (k Keeper) ConvertCoinFromNativeToCRC21(ctx sdk.Context, sender common.Address, coin sdk.Coin, autoDeploy bool) error
ConvertCoinFromNativeToCRC21 convert native token to erc20 token
func (Keeper) ConvertCoinsFromNativeToCRC21 ¶ added in v1.0.0
func (k Keeper) ConvertCoinsFromNativeToCRC21(ctx sdk.Context, sender common.Address, coins sdk.Coins, autoDeploy bool) error
ConvertCoinsFromNativeToCRC21 convert native tokens to erc20 tokens
func (Keeper) ConvertVouchersToEvmCoins ¶ added in v0.6.1
func (Keeper) DeleteExternalContractForDenom ¶ added in v0.6.1
DeleteExternalContractForDenom delete the external contract mapping for native denom, returns false if mapping not exists.
func (Keeper) DenomByContract ¶ added in v0.6.1
func (k Keeper) DenomByContract(goCtx context.Context, req *types.DenomByContractRequest) (*types.DenomByContractResponse, error)
DenomByContract query denom by contract
func (Keeper) DeployModuleCRC21 ¶ added in v1.0.0
DeployModuleCRC21 deploy an embed crc21 contract
func (Keeper) GetAccount ¶ added in v1.0.0
func (Keeper) GetAutoContracts ¶ added in v0.6.1
func (k Keeper) GetAutoContracts(ctx sdk.Context) (out []types.TokenMapping)
GetAutoContracts returns all auto-deployed contract mappings
func (Keeper) GetBalance ¶
func (Keeper) GetContractByDenom ¶ added in v0.6.1
func (k Keeper) GetContractByDenom(ctx sdk.Context, denom string) (contract common.Address, found bool)
GetContractByDenom find the corresponding contract for the denom, external contract is taken in preference to auto-deployed one
func (Keeper) GetDenomByContract ¶ added in v0.6.1
func (k Keeper) GetDenomByContract(ctx sdk.Context, contract common.Address) (denom string, found bool)
GetDenomByContract find native denom by contract address
func (Keeper) GetEvmParams ¶ added in v0.6.1
GetEvmParams returns the total set of evm parameters.
func (Keeper) GetExternalContracts ¶ added in v0.6.1
func (k Keeper) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
GetExternalContracts returns all external contract mappings
func (Keeper) GetSourceChannelID ¶ added in v0.6.1
func (k Keeper) GetSourceChannelID(ctx sdk.Context, ibcVoucherDenom string) (channelID string, err error)
GetSourceChannelID returns the channel id for an ibc voucher The voucher has for format ibc/hash(path)
func (Keeper) IbcTransferCoins ¶ added in v0.6.1
func (Keeper) OnRecvVouchers ¶ added in v0.6.1
OnRecvVouchers try to convert ibc voucher to evm coins, revert the state in case of failure
func (Keeper) RegisterOrUpdateTokenMapping ¶ added in v1.0.0
func (k Keeper) RegisterOrUpdateTokenMapping(ctx sdk.Context, msg *types.MsgUpdateTokenMapping) error
RegisterOrUpdateTokenMapping update the token mapping, register a coin metadata if needed
func (Keeper) ReplayBlock ¶ added in v0.6.10
func (k Keeper) ReplayBlock(goCtx context.Context, req *types.ReplayBlockRequest) (*types.ReplayBlockResponse, error)
ReplayBlock replay the eth messages in the block to recover the results of false-failed txs.
func (Keeper) SetAutoContractForDenom ¶ added in v0.6.1
SetAutoContractForDenom set the auto deployed contract for native denom
type LogProcessEvmHook ¶ added in v0.6.1
type LogProcessEvmHook struct {
// contains filtered or unexported fields
}
LogProcessEvmHook is an evm hook that convert specific contract logs into native module calls
func NewLogProcessEvmHook ¶ added in v0.6.1
func NewLogProcessEvmHook(handlers ...types.EvmLogHandler) *LogProcessEvmHook
func (LogProcessEvmHook) PostTxProcessing ¶ added in v0.6.1
func (h LogProcessEvmHook) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error
PostTxProcessing implements EvmHook interface