Skip to content

File tree

17 files changed

+2174
-2102
lines changed

17 files changed

+2174
-2102
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
5454

5555
### Improvements
5656

57+
- (deps) [\#458](https://github.com/tharsis/evmos/pull/458) Bump Ethermint to [`v0.13.0`](https://github.com/tharsis/ethermint/releases/tag/v0.13.0)
5758
- (deps) [\#457](https://github.com/tharsis/evmos/pull/457) Bump Cosmos SDK to [`v0.45.2`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.2)
5859
- (cmd) [\#446](https://github.com/tharsis/evmos/pull/446) Update `migrate` command to migrate Evmos, Ethermint and Cosmos SDK modules.
5960
- (app) [\#446](https://github.com/tharsis/evmos/pull/446) Refactor upgrade code.
60-
- (deps) [\#427](https://github.com/tharsis/evmos/pull/427) Bump Ethermint to [`v0.12.0`](https://github.com/tharsis/ethermint/releases/tag/v0.12.0)
6161
- (ibc) [\#412](https://github.com/tharsis/evmos/pull/412) Introduce boilerplate struct for IBC applications.
6262
- (deps) [\#402](https://github.com/tharsis/evmos/pull/402) Bump IBC go to [`v3.0.0`](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0)
6363
- (ibctesting) [\#388](https://github.com/tharsis/evmos/pull/388) Support Cosmos and EVM chains in IBC testing `Coordinator`.

‎client/docs/statik/statik.go

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎client/docs/swagger-ui/swagger.yaml

+2,002-2,033
Large diffs are not rendered by default.

‎go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ require (
2121
github.com/stretchr/testify v1.7.1
2222
github.com/tendermint/tendermint v0.34.16
2323
github.com/tendermint/tm-db v0.6.7
24-
github.com/tharsis/ethermint v0.12.2
24+
github.com/tharsis/ethermint v0.13.0
2525
go.opencensus.io v0.23.0
26-
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2
26+
google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de
2727
google.golang.org/grpc v1.45.0
2828
google.golang.org/protobuf v1.28.0
2929
)
@@ -137,7 +137,7 @@ require (
137137
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
138138
github.com/zondax/hid v0.9.0 // indirect
139139
go.etcd.io/bbolt v1.3.6 // indirect
140-
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
140+
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect
141141
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
142142
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
143143
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect

‎go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,8 @@ github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8
10851085
github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI=
10861086
github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8=
10871087
github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I=
1088-
github.com/tharsis/ethermint v0.12.2 h1:Zge9lY074zPrlY6NGgh2jMVt7G25zR8tss5n0w/zdqQ=
1089-
github.com/tharsis/ethermint v0.12.2/go.mod h1:5gZCBCY9A0T7h8dO76u+Pm5Gz2liv/urEQ7jPpqWtWQ=
1088+
github.com/tharsis/ethermint v0.13.0 h1:jww5CptG3nOln94JYvnJy33xPAc1urbtgeSHYOQTBCk=
1089+
github.com/tharsis/ethermint v0.13.0/go.mod h1:7hYNIhcpoNSAQediQPav3phiWG2AkgLVSf+zmTZg6O0=
10901090
github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI=
10911091
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
10921092
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
@@ -1205,8 +1205,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm
12051205
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
12061206
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
12071207
golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
1208-
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 h1:S25/rfnfsMVgORT4/J61MJ7rdyseOZOyvLIrZEZ7s6s=
1209-
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
1208+
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o=
1209+
golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
12101210
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
12111211
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
12121212
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -1665,8 +1665,8 @@ google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ6
16651665
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
16661666
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
16671667
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
1668-
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2 h1:3n0D2NdPGm0g0wrVJzXJWW5CBOoqgGBkDX9cRMJHZAY=
1669-
google.golang.org/genproto v0.0.0-20220322021311-435b647f9ef2/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
1668+
google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de h1:9Ti5SG2U4cAcluryUo/sFay3TQKoxiFMfaT0pbizU7k=
1669+
google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
16701670
google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
16711671
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
16721672
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=

‎third_party/proto/cosmos/authz/v1beta1/authz.proto

+12
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,15 @@ message Grant {
2525
google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
2626
google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
2727
}
28+
29+
// GrantAuthorization extends a grant with both the addresses of the grantee and granter.
30+
// It is used in genesis.proto and query.proto
31+
//
32+
// Since: cosmos-sdk 0.45.2
33+
message GrantAuthorization {
34+
string granter = 1;
35+
string grantee = 2;
36+
37+
google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
38+
google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
39+
}

‎third_party/proto/cosmos/authz/v1beta1/genesis.proto

+1-12
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,12 @@
22
syntax = "proto3";
33
package cosmos.authz.v1beta1;
44

5-
import "google/protobuf/timestamp.proto";
6-
import "google/protobuf/any.proto";
75
import "gogoproto/gogo.proto";
8-
import "cosmos_proto/cosmos.proto";
6+
import "cosmos/authz/v1beta1/authz.proto";
97

108
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
119

1210
// GenesisState defines the authz module's genesis state.
1311
message GenesisState {
1412
repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false];
1513
}
16-
17-
// GrantAuthorization defines the GenesisState/GrantAuthorization type.
18-
message GrantAuthorization {
19-
string granter = 1;
20-
string grantee = 2;
21-
22-
google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
23-
google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
24-
}

‎third_party/proto/cosmos/authz/v1beta1/query.proto

+47-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ service Query {
1414
rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) {
1515
option (google.api.http).get = "/cosmos/authz/v1beta1/grants";
1616
}
17+
18+
// GranterGrants returns list of `GrantAuthorization`, granted by granter.
19+
//
20+
// Since: cosmos-sdk 0.45.2
21+
rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) {
22+
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}";
23+
}
24+
25+
// GranteeGrants returns a list of `GrantAuthorization` by grantee.
26+
//
27+
// Since: cosmos-sdk 0.45.2
28+
rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) {
29+
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}";
30+
}
1731
}
1832

1933
// QueryGrantsRequest is the request type for the Query/Grants RPC method.
@@ -29,7 +43,39 @@ message QueryGrantsRequest {
2943
// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
3044
message QueryGrantsResponse {
3145
// authorizations is a list of grants granted for grantee by granter.
32-
repeated cosmos.authz.v1beta1.Grant grants = 1;
46+
repeated Grant grants = 1;
47+
// pagination defines an pagination for the response.
48+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
49+
}
50+
51+
// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.
52+
message QueryGranterGrantsRequest {
53+
string granter = 1;
54+
55+
// pagination defines an pagination for the request.
56+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
57+
}
58+
59+
// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.
60+
message QueryGranterGrantsResponse {
61+
// grants is a list of grants granted by the granter.
62+
repeated GrantAuthorization grants = 1;
63+
// pagination defines an pagination for the response.
64+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
65+
}
66+
67+
// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method.
68+
message QueryGranteeGrantsRequest {
69+
string grantee = 1;
70+
71+
// pagination defines an pagination for the request.
72+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
73+
}
74+
75+
// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.
76+
message QueryGranteeGrantsResponse {
77+
// grants is a list of grants granted to the grantee.
78+
repeated GrantAuthorization grants = 1;
3379
// pagination defines an pagination for the response.
3480
cosmos.base.query.v1beta1.PageResponse pagination = 2;
3581
}

‎third_party/proto/cosmos/bank/v1beta1/query.proto

+30
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ service Query {
2121
option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}";
2222
}
2323

24+
// SpendableBalances queries the spenable balance of all coins for a single
25+
// account.
26+
rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) {
27+
option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}";
28+
}
29+
2430
// TotalSupply queries the total supply of all coins.
2531
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
2632
option (google.api.http).get = "/cosmos/bank/v1beta1/supply";
@@ -88,6 +94,30 @@ message QueryAllBalancesResponse {
8894
cosmos.base.query.v1beta1.PageResponse pagination = 2;
8995
}
9096

97+
// QuerySpendableBalancesRequest defines the gRPC request structure for querying
98+
// an account's spendable balances.
99+
message QuerySpendableBalancesRequest {
100+
option (gogoproto.equal) = false;
101+
option (gogoproto.goproto_getters) = false;
102+
103+
// address is the address to query spendable balances for.
104+
string address = 1;
105+
106+
// pagination defines an optional pagination for the request.
107+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
108+
}
109+
110+
// QuerySpendableBalancesResponse defines the gRPC response structure for querying
111+
// an account's spendable balances.
112+
message QuerySpendableBalancesResponse {
113+
// balances is the spendable balances of all the coins.
114+
repeated cosmos.base.v1beta1.Coin balances = 1
115+
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
116+
117+
// pagination defines the pagination in the response.
118+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
119+
}
120+
91121
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
92122
// method.
93123
message QueryTotalSupplyRequest {

‎third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto

+38-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,41 @@ message Snapshot {
1717
// Metadata contains SDK-specific snapshot metadata.
1818
message Metadata {
1919
repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes
20-
}
20+
}
21+
22+
// SnapshotItem is an item contained in a rootmulti.Store snapshot.
23+
message SnapshotItem {
24+
// item is the specific type of snapshot item.
25+
oneof item {
26+
SnapshotStoreItem store = 1;
27+
SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"];
28+
SnapshotExtensionMeta extension = 3;
29+
SnapshotExtensionPayload extension_payload = 4;
30+
}
31+
}
32+
33+
// SnapshotStoreItem contains metadata about a snapshotted store.
34+
message SnapshotStoreItem {
35+
string name = 1;
36+
}
37+
38+
// SnapshotIAVLItem is an exported IAVL node.
39+
message SnapshotIAVLItem {
40+
bytes key = 1;
41+
bytes value = 2;
42+
// version is block height
43+
int64 version = 3;
44+
// height is depth of the tree.
45+
int32 height = 4;
46+
}
47+
48+
// SnapshotExtensionMeta contains metadata about an external snapshotter.
49+
message SnapshotExtensionMeta {
50+
string name = 1;
51+
uint32 format = 2;
52+
}
53+
54+
// SnapshotExtensionPayload contains payloads of an external snapshotter.
55+
message SnapshotExtensionPayload {
56+
bytes payload = 1;
57+
}

‎third_party/proto/cosmos/base/store/v1beta1/snapshot.proto

-28
This file was deleted.

‎third_party/proto/cosmos/tx/signing/v1beta1/signing.proto

+12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ enum SignMode {
2424
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
2525
// Amino JSON and will be removed in the future
2626
SIGN_MODE_LEGACY_AMINO_JSON = 127;
27+
28+
// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
29+
// SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
30+
//
31+
// Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
32+
// but is not implemented on the SDK by default. To enable EIP-191, you need
33+
// to pass a custom `TxConfig` that has an implementation of
34+
// `SignModeHandler` for EIP-191. The SDK may decide to fully support
35+
// EIP-191 in the future.
36+
//
37+
// Since: cosmos-sdk 0.45.2
38+
SIGN_MODE_EIP_191 = 191;
2739
}
2840

2941
// SignatureDescriptors wraps multiple SignatureDescriptor's.

‎third_party/proto/ethermint/feemarket/v1/query.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ option go_package = "github.com/tharsis/ethermint/x/feemarket/types";
1212
service Query {
1313
// Params queries the parameters of x/feemarket module.
1414
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
15-
option (google.api.http).get = "/feemarket/evm/v1/params";
15+
option (google.api.http).get = "/ethermint/feemarket/v1/params";
1616
}
1717

1818
// BaseFee queries the base fee of the parent block of the current block.
1919
rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) {
20-
option (google.api.http).get = "/feemarket/evm/v1/base_fee";
20+
option (google.api.http).get = "/ethermint/feemarket/v1/base_fee";
2121
}
2222

2323
// BlockGas queries the gas used at a given block height
2424
rpc BlockGas(QueryBlockGasRequest) returns (QueryBlockGasResponse) {
25-
option (google.api.http).get = "/feemarket/evm/v1/block_gas";
25+
option (google.api.http).get = "/ethermint/feemarket/v1/block_gas";
2626
}
2727
}
2828

‎x/claims/keeper/hooks.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
99
"github.com/cosmos/ibc-go/v3/modules/core/exported"
1010

11-
"github.com/ethereum/go-ethereum/common"
11+
"github.com/ethereum/go-ethereum/core"
1212
ethtypes "github.com/ethereum/go-ethereum/core/types"
1313

1414
evmtypes "github.com/tharsis/ethermint/x/evm/types"
@@ -80,9 +80,9 @@ func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress,
8080
// After a EVM state transition is successfully processed, the claimable amount
8181
// for the users's claims record evm action is claimed and transferred to the
8282
// user address.
83-
func (k Keeper) AfterEVMStateTransition(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error {
83+
func (k Keeper) AfterEVMStateTransition(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
8484
params := k.GetParams(ctx)
85-
fromAddr := sdk.AccAddress(from.Bytes())
85+
fromAddr := sdk.AccAddress(msg.From().Bytes())
8686

8787
claimsRecord, found := k.GetClaimsRecord(ctx, fromAddr)
8888
if !found {
@@ -104,8 +104,8 @@ func (k Keeper) AfterEVMStateTransition(ctx sdk.Context, from common.Address, to
104104
// ________________________________________________________________________________________
105105

106106
// evm hook
107-
func (h Hooks) PostTxProcessing(ctx sdk.Context, from common.Address, to *common.Address, receipt *ethtypes.Receipt) error {
108-
return h.k.AfterEVMStateTransition(ctx, from, to, receipt)
107+
func (h Hooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
108+
return h.k.AfterEVMStateTransition(ctx, msg, receipt)
109109
}
110110

111111
// governance hooks

‎x/erc20/keeper/evm_hooks.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
sdk "github.com/cosmos/cosmos-sdk/types"
99
"github.com/ethereum/go-ethereum/common"
10+
"github.com/ethereum/go-ethereum/core"
1011
ethtypes "github.com/ethereum/go-ethereum/core/types"
1112
evmtypes "github.com/tharsis/ethermint/x/evm/types"
1213

@@ -32,8 +33,7 @@ func (k Keeper) Hooks() Hooks {
3233
// PostTxProcessing implements EvmHooks.PostTxProcessing
3334
func (h Hooks) PostTxProcessing(
3435
ctx sdk.Context,
35-
from common.Address,
36-
to *common.Address,
36+
msg core.Message,
3737
receipt *ethtypes.Receipt,
3838
) error {
3939
params := h.k.GetParams(ctx)

‎x/incentives/keeper/evm_hooks.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package keeper
33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
55
"github.com/ethereum/go-ethereum/common"
6+
"github.com/ethereum/go-ethereum/core"
67
ethtypes "github.com/ethereum/go-ethereum/core/types"
78
evmtypes "github.com/tharsis/ethermint/x/evm/types"
89

@@ -14,13 +15,16 @@ var _ evmtypes.EvmHooks = Hooks{}
1415
// PostTxProcessing implements EvmHooks.PostTxProcessing. After each successful
1516
// interaction with an incentivized contract, the participants's GasUsed is
1617
// added to its gasMeter.
17-
func (h Hooks) PostTxProcessing(ctx sdk.Context, participant common.Address, contract *common.Address, receipt *ethtypes.Receipt) error {
18+
func (h Hooks) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
1819
// check if the Incentives are globally enabled
1920
params := h.k.GetParams(ctx)
2021
if !params.EnableIncentives {
2122
return nil
2223
}
2324

25+
contract := msg.To()
26+
participant := msg.From()
27+
2428
// If theres no incentive registered for the contract, do nothing
2529
if contract == nil || !h.k.IsIncentiveRegistered(ctx, *contract) {
2630
return nil

‎x/incentives/keeper/evm_hooks_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (suite *KeeperTestSuite) TestEvmHooksStoreTxGasUsed() {
3333
}{
3434
{
3535
"incentives are disabled globally",
36-
func(contractAddr common.Address) {
36+
func(_ common.Address) {
3737
params := types.DefaultParams()
3838
params.EnableIncentives = false
3939
suite.app.IncentivesKeeper.SetParams(suite.ctx, params)
@@ -59,7 +59,7 @@ func (suite *KeeperTestSuite) TestEvmHooksStoreTxGasUsed() {
5959
},
6060
{
6161
"tx with unincentivized contract",
62-
func(contractAddr common.Address) {
62+
func(_ common.Address) {
6363
suite.MintERC20Token(tests.GenerateAddress(), suite.address, suite.address, big.NewInt(1000))
6464
},
6565
false,

0 commit comments

Comments
 (0)
Please sign in to comment.