sei-protocol / sei-chain

Apache License 2.0
2.7k stars 805 forks source link

Set receipt for CW->EVM calls #1712

Closed codchen closed 2 months ago

codchen commented 3 months ago

Describe your changes and provide context

Create receipt for CosmWasm transactions that invoked EVM contracts. Tx hash for such receipt is set to be the Cosmos tx hash of the originating tx, which happens to also be a 20-byte array same as EVM tx hash.

Testing performed to validate your change

unit test integration tests

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 71.05263% with 22 lines in your changes missing coverage. Please review.

Project coverage is 61.13%. Comparing base (1c32f92) to head (5522407).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712/graphs/tree.svg?width=650&height=150&src=pr&token=DG7ZZJ3PVV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) ```diff @@ Coverage Diff @@ ## main #1712 +/- ## ========================================== + Coverage 60.96% 61.13% +0.17% ========================================== Files 251 251 Lines 21962 21975 +13 ========================================== + Hits 13389 13435 +46 + Misses 7622 7582 -40 - Partials 951 958 +7 ``` | [Files](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) | Coverage Δ | | |---|---|---| | [evmrpc/block.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=evmrpc%2Fblock.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-ZXZtcnBjL2Jsb2NrLmdv) | `67.77% <100.00%> (+0.54%)` | :arrow_up: | | [x/evm/keeper/deferred.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=x%2Fevm%2Fkeeper%2Fdeferred.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-eC9ldm0va2VlcGVyL2RlZmVycmVkLmdv) | `56.36% <100.00%> (-1.54%)` | :arrow_down: | | [x/evm/keeper/msg\_server.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=x%2Fevm%2Fkeeper%2Fmsg_server.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-eC9ldm0va2VlcGVyL21zZ19zZXJ2ZXIuZ28=) | `75.94% <100.00%> (-0.78%)` | :arrow_down: | | [evmrpc/simulate.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=evmrpc%2Fsimulate.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-ZXZtcnBjL3NpbXVsYXRlLmdv) | `64.72% <0.00%> (-1.09%)` | :arrow_down: | | [evmrpc/tx.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=evmrpc%2Ftx.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-ZXZtcnBjL3R4Lmdv) | `66.06% <66.66%> (-1.06%)` | :arrow_down: | | [x/evm/keeper/evm.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=x%2Fevm%2Fkeeper%2Fevm.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-eC9ldm0va2VlcGVyL2V2bS5nbw==) | `64.49% <50.00%> (-1.92%)` | :arrow_down: | | [x/evm/keeper/receipt.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712?src=pr&el=tree&filepath=x%2Fevm%2Fkeeper%2Freceipt.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-eC9ldm0va2VlcGVyL3JlY2VpcHQuZ28=) | `66.66% <81.57%> (+15.92%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1712/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)