-
Notifications
You must be signed in to change notification settings - Fork 19
/
expected_keepers.go
43 lines (36 loc) · 1.84 KB
/
expected_keepers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package types
import (
"context"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/tharsis/ethermint/x/evm/types"
)
// AccountKeeper defines the expected interface needed to retrieve account info.
type AccountKeeper interface {
GetModuleAddress(moduleName string) sdk.AccAddress
GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
GetSequence(sdk.Context, sdk.AccAddress) (uint64, error)
}
// BankKeeper defines the expected interface needed to retrieve account balances.
type BankKeeper interface {
GetSupply(ctx sdk.Context, denom string) sdk.Coin
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool
BlockedAddr(addr sdk.AccAddress) bool
GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
HasSupply(ctx sdk.Context, denom string) bool
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}
// EvmKeeper defines the expected interface needed to make EVM transactions.
type EvmKeeper interface {
// This is actually a gRPC query method
EstimateGas(ctx context.Context, req *types.EthCallRequest) (*types.EstimateGasResponse, error)
ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.EVMLogger, commit bool) (*types.MsgEthereumTxResponse, error)
}