diff --git a/go.mod b/go.mod index 26d5273a54..789e8bf174 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/stretchr/testify v1.7.0 github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 - github.com/tharsis/ethermint v0.7.2 + github.com/tharsis/ethermint v0.6.1-0.20220105074136-4ec794204cc0 google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb google.golang.org/grpc v1.43.0 gopkg.in/yaml.v2 v2.4.0 @@ -155,14 +155,10 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp replace github.com/99designs/keyring => github.com/crypto-org-chain/keyring v1.1.6-fixes // TODO: remove when middleware will be implemented -replace github.com/cosmos/ibc-go/v3 => github.com/yihuang/ibc-go/v3 v3.0.0-hooks-1 +replace github.com/cosmos/ibc-go/v3 => github.com/crypto-org-chain/ibc-go/v3 v3.0.0-alpha1-hooks replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.17.3 -// https://github.com/crypto-org-chain/ethermint/tree/v0.9.x-cronos -// FIXME make a tag or point to upstream when ready -replace github.com/tharsis/ethermint => github.com/yihuang/ethermint v0.6.1-0.20220104083118-d2952cd929d4 - -replace github.com/cosmos/cosmos-sdk => github.com/yihuang/cosmos-sdk v0.44.6-0.20220104045229-ae4cf76ecfa2 +replace github.com/cosmos/cosmos-sdk => github.com/yihuang/cosmos-sdk v0.44.6-0.20220105084227-12b04a63d4dc replace github.com/peggyjv/gravity-bridge/module => github.com/yihuang/gravity-bridge/module v0.1.22-0.20220104062749-9171f5983539 diff --git a/go.sum b/go.sum index 28a65c99c5..bd166fdcb8 100644 --- a/go.sum +++ b/go.sum @@ -242,6 +242,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/crypto-org-chain/ibc-go/v3 v3.0.0-alpha1-hooks h1:MUg2ATPbsAW/boyUJDmFblWHIalSriwpFnUr0T6FwQc= +github.com/crypto-org-chain/ibc-go/v3 v3.0.0-alpha1-hooks/go.mod h1:NFKeysTorZ/HzqlNZOnE6YZpcbKR1zorHUyE9voOh8s= github.com/crypto-org-chain/keyring v1.1.6-fixes h1:AUFSu56NY6XobY6XfRoDx6v3loiOrHK5MNUm32GEjwA= github.com/crypto-org-chain/keyring v1.1.6-fixes/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -1017,6 +1019,8 @@ github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5Y github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= +github.com/tharsis/ethermint v0.6.1-0.20220105074136-4ec794204cc0 h1:UFPww0gM1VgU5BAbGqmRTsk7vysQRk2kWBOkLOEahFY= +github.com/tharsis/ethermint v0.6.1-0.20220105074136-4ec794204cc0/go.mod h1:gIJZT7HY/lLfJbg8Ime25bmnZOhsck1ahR51ApwlzqQ= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1056,14 +1060,10 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yihuang/cosmos-sdk v0.44.6-0.20220104045229-ae4cf76ecfa2 h1:6QHozithG/Oq8ys1TF9gIWYrBlnxBbGpCQAvsXLO1/k= -github.com/yihuang/cosmos-sdk v0.44.6-0.20220104045229-ae4cf76ecfa2/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= -github.com/yihuang/ethermint v0.6.1-0.20220104083118-d2952cd929d4 h1:WAnB5dvZYbZeAXP6ruX7QA3fFWdm94sGNbcLS2vSW8g= -github.com/yihuang/ethermint v0.6.1-0.20220104083118-d2952cd929d4/go.mod h1:36qCmZkeY2+wVNUH4Aezg2bG38epCKXTHS9kCJ5sOZo= +github.com/yihuang/cosmos-sdk v0.44.6-0.20220105084227-12b04a63d4dc h1:UgexLfsduyA18Q164q7QwwegbXDvnZmXV1sgMRhFBXU= +github.com/yihuang/cosmos-sdk v0.44.6-0.20220105084227-12b04a63d4dc/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= github.com/yihuang/gravity-bridge/module v0.1.22-0.20220104062749-9171f5983539 h1:M6l71l1iHHocMA8euNpdu1Sandm7frrAb+AX9DVAGg8= github.com/yihuang/gravity-bridge/module v0.1.22-0.20220104062749-9171f5983539/go.mod h1:vwB8Zr9B+vgF8z/Sz0e/yviMeJAqLouOfRPHnEnUgDc= -github.com/yihuang/ibc-go/v3 v3.0.0-hooks-1 h1:xHX98mZ1/1zIlM4bU7pyHnxSHLhi6z+segw2HKblifM= -github.com/yihuang/ibc-go/v3 v3.0.0-hooks-1/go.mod h1:NFKeysTorZ/HzqlNZOnE6YZpcbKR1zorHUyE9voOh8s= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/gomod2nix.toml b/gomod2nix.toml index 583c1ec560..0426498285 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -935,13 +935,13 @@ sha256 = "10x22k92ra1sdddj2pksprfhsm683sldflcnjm8nfz4rjjhjwkay" ["github.com/cosmos/cosmos-sdk"] - sumVersion = "v0.44.6-0.20220104045229-ae4cf76ecfa2" + sumVersion = "v0.44.6-0.20220105084227-12b04a63d4dc" vendorPath = "github.com/yihuang/cosmos-sdk" ["github.com/cosmos/cosmos-sdk".fetch] type = "git" url = "https://github.com/yihuang/cosmos-sdk" - rev = "ae4cf76ecfa218dd275d607b7f1e7a7bb2f2a2f9" - sha256 = "0xc24gnrkn4pbp9by9yr248s1p3x2f9f0cykfbd6547y54i4b9k7" + rev = "12b04a63d4dccf2dac004868badac5a8c5386202" + sha256 = "0m0w2ivigwz6kh6yhgmmdzkn6652av0snxdvyiv5wip0wmnz2wyg" ["github.com/cosmos/go-bip39"] sumVersion = "v1.0.0" @@ -960,13 +960,13 @@ sha256 = "115964xzwlr8j0l8f5x0v31f5hnxhd0rh5cvgy560l0dd77i735k" ["github.com/cosmos/ibc-go/v3"] - sumVersion = "v3.0.0-hooks-1" - vendorPath = "github.com/yihuang/ibc-go/v3" + sumVersion = "v3.0.0-alpha1-hooks" + vendorPath = "github.com/crypto-org-chain/ibc-go/v3" ["github.com/cosmos/ibc-go/v3".fetch] type = "git" - url = "https://github.com/yihuang/ibc-go" - rev = "e905e1e0f714868a00a5015481c91fdf00dc2951" - sha256 = "1jjnvpwfqcs84fpr4kjqrx7q86maw6jh7m8kgfbbzxmbj2g2g86i" + url = "https://github.com/crypto-org-chain/ibc-go" + rev = "994ab02d8aa87e7369b0c157f218213d0526b476" + sha256 = "1f50illlzza37vmgbf137nrd76lwn6mca66x3c36vm76rk0zhzcg" ["github.com/cosmos/ledger-cosmos-go"] sumVersion = "v0.11.1" @@ -3669,13 +3669,12 @@ sha256 = "1sgjf2vaq554ybc0cwkzn17cz2ibzph2rq0dgaw21c2hym09437x" ["github.com/tharsis/ethermint"] - sumVersion = "v0.6.1-0.20220104083118-d2952cd929d4" - vendorPath = "github.com/yihuang/ethermint" + sumVersion = "v0.6.1-0.20220105074136-4ec794204cc0" ["github.com/tharsis/ethermint".fetch] type = "git" - url = "https://github.com/yihuang/ethermint" - rev = "d2952cd929d41660badfa0db3191b75f1652d586" - sha256 = "1vykz60r2c39x3i4px36bgcpz4h67gd5igpg34ibk7fwsx73v2ij" + url = "https://github.com/tharsis/ethermint" + rev = "4ec794204cc0dcc2cb2287448607a601916f22d9" + sha256 = "149micdcpyzxcb003kn0nchfjm604xk18zs0zd6vpxnnqm53bwwb" ["github.com/tidwall/gjson"] sumVersion = "v1.6.7" diff --git a/x/cronos/keeper/evm.go b/x/cronos/keeper/evm.go index 31ab188eb7..28bf785a70 100644 --- a/x/cronos/keeper/evm.go +++ b/x/cronos/keeper/evm.go @@ -18,10 +18,7 @@ const DefaultGasCap uint64 = 25000000 // CallEVM execute an evm message from native module func (k Keeper) CallEVM(ctx sdk.Context, to *common.Address, data []byte, value *big.Int) (*ethtypes.Message, *evmtypes.MsgEthereumTxResponse, error) { - nonce, err := k.evmKeeper.GetNonce(ctx, types.EVMModuleAddress) - if err != nil { - return nil, nil, err - } + nonce := k.evmKeeper.GetNonce(ctx, types.EVMModuleAddress) msg := ethtypes.NewMessage( types.EVMModuleAddress, to, diff --git a/x/cronos/types/interfaces.go b/x/cronos/types/interfaces.go index b6e5cc0e05..3d9910b8aa 100644 --- a/x/cronos/types/interfaces.go +++ b/x/cronos/types/interfaces.go @@ -59,7 +59,7 @@ type EvmLogHandler interface { // EvmKeeper defines the interface for evm keeper type EvmKeeper interface { - GetNonce(ctx sdk.Context, addr common.Address) (uint64, error) + GetNonce(ctx sdk.Context, addr common.Address) uint64 ApplyMessage(ctx sdk.Context, msg core.Message, tracer vm.Tracer, commit bool) (*evmtypes.MsgEthereumTxResponse, error) GetParams(ctx sdk.Context) evmtypes.Params }