Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions evmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
"encoding/json"
"errors"
"fmt"

"io"

"os"


"github.com/spf13/cast"

// Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes
Expand Down Expand Up @@ -246,6 +245,10 @@
)

tkeys := storetypes.NewTransientStoreKeys(evmtypes.TransientKey, feemarkettypes.TransientKey)
var nonTransientKeys []storetypes.StoreKey
for _, k := range keys {
nonTransientKeys = append(nonTransientKeys, k)
}
Comment on lines +249 to +251

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism

// load state streaming if enabled
if err := bApp.RegisterStreamingServices(appOpts, keys); err != nil {
Expand Down Expand Up @@ -388,7 +391,6 @@
app.IBCKeeper = ibckeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[ibcexported.StoreKey]),
nil,
app.UpgradeKeeper,
authAddr,
)
Expand Down Expand Up @@ -444,7 +446,7 @@
// NOTE: it's required to set up the EVM keeper before the ERC-20 keeper, because it is used in its instantiation.
app.EVMKeeper = evmkeeper.NewKeeper(
// TODO: check why this is not adjusted to use the runtime module methods like SDK native keepers
appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], keys,
appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], nonTransientKeys,
authtypes.NewModuleAddress(govtypes.ModuleName),
app.AccountKeeper,
app.PreciseBankKeeper,
Expand Down Expand Up @@ -482,16 +484,15 @@
// instantiate IBC transfer keeper AFTER the ERC-20 keeper to use it in the instantiation
app.TransferKeeper = transferkeeper.NewKeeper(
appCodec,
evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.ChannelKeeper,
app.MsgServiceRouter(),
app.AccountKeeper,
app.BankKeeper,
app.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers
authAddr,
)
app.TransferKeeper.SetAddressCodec(evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()))

/*
Create Transfer Stack
Expand Down Expand Up @@ -519,7 +520,10 @@
app.EVMKeeper,
app.Erc20Keeper,
)
transferStack = ibccallbacks.NewIBCMiddleware(transferStack, app.IBCKeeper.ChannelKeeper, app.CallbackKeeper, maxCallbackGas)
callbacksMiddleware := ibccallbacks.NewIBCMiddleware(app.CallbackKeeper, maxCallbackGas)
callbacksMiddleware.SetICS4Wrapper(app.IBCKeeper.ChannelKeeper)
callbacksMiddleware.SetUnderlyingApplication(transferStack)
transferStack = callbacksMiddleware

var transferStackV2 ibcapi.IBCModule
transferStackV2 = transferv2.NewIBCModule(app.TransferKeeper)
Expand Down
193 changes: 104 additions & 89 deletions evmd/go.mod

Large diffs are not rendered by default.

1,709 changes: 222 additions & 1,487 deletions evmd/go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions evmd/tests/ibc/v2_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func (suite *TransferTestSuiteV2) TestOnRecvPacket() {
originalCoin, suite.chainB.SenderAccount.GetAddress().String(),
suite.evmChainA.SenderAccount.GetAddress().String(), clienttypes.Height{},
timeoutTimestamp, "", types.EncodingProtobuf,
false,
)
_, err := suite.chainB.SendMsgs(msg)
suite.Require().NoError(err) // message committed
Expand Down Expand Up @@ -393,6 +394,7 @@ func (suite *TransferTestSuiteV2) TestOnAckPacket() {
originalCoin, suite.evmChainA.SenderAccount.GetAddress().String(),
suite.chainB.SenderAccount.GetAddress().String(), clienttypes.Height{},
timeoutTimestamp, "", types.EncodingProtobuf,
false,
)
_, err := suite.evmChainA.SendMsgs(msg)
suite.Require().NoError(err) // message committed
Expand Down Expand Up @@ -500,6 +502,7 @@ func (suite *TransferTestSuiteV2) TestOnTimeoutPacket() {
originalCoin, suite.evmChainA.SenderAccount.GetAddress().String(),
suite.chainB.SenderAccount.GetAddress().String(), clienttypes.Height{},
timeoutTimestamp, "", types.EncodingProtobuf,
false,
)
_, err := suite.evmChainA.SendMsgs(msg)
suite.Require().NoError(err) // message committed
Expand Down
Loading
Loading