Skip to content

Commit

Permalink
fix: return proper synthetic tx in eth_getBlockByNumber RPC (#3634)
Browse files Browse the repository at this point in the history
* fix gas payment event indexing

* revert events changes

* changelog

* add todo
  • Loading branch information
skosito authored Mar 5, 2025
1 parent f7681d8 commit 33eb8ef
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* [3517](https://github.com/zeta-chain/node/pull/3517) - remove duplicate gateway event appending to fix false positive on multiple events in same tx
* [3602](https://github.com/zeta-chain/node/pull/3602) - hardcode gas limits to avoid estimate gas calls
* [3622](https://github.com/zeta-chain/node/pull/3622) - allow object for tracerConfig in `debug_traceTransaction` RPC
* [3634](https://github.com/zeta-chain/node/pull/3634) - return proper synthetic tx in `eth_getBlockByNumber` RPC

### Tests

Expand Down
3 changes: 2 additions & 1 deletion precompiles/bank/method_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package bank

import (
"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"
"math/big"
"testing"

"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"

sdkmath "cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"

Expand Down
3 changes: 2 additions & 1 deletion precompiles/staking/staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package staking

import (
"encoding/json"
"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"
"testing"

"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"

"math/big"

"cosmossdk.io/log"
Expand Down
3 changes: 2 additions & 1 deletion rpc/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ func ParseTxBlockResult(
if len(txs.Txs) == 0 {
return nil, nil, nil
}
parsedTx := txs.Txs[0]
// TODO: check why when there are multiple synthetic txs events are in reversed order
parsedTx := txs.Txs[len(txs.Txs)-1]
if parsedTx.Type == CosmosEVMTxType {
return &ethermint.TxResult{
Height: height,
Expand Down
3 changes: 2 additions & 1 deletion x/crosschain/keeper/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
package keeper_test

import (
"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"
"math/big"
"testing"

"github.com/zeta-chain/node/e2e/contracts/erc1967proxy"

sdkmath "cosmossdk.io/math"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
5 changes: 3 additions & 2 deletions x/fungible/keeper/deposits_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package keeper_test

import (
"math/big"
"testing"

"cosmossdk.io/math"
"github.com/pkg/errors"
"github.com/stretchr/testify/mock"
Expand All @@ -9,8 +12,6 @@ import (
"github.com/zeta-chain/node/e2e/contracts/reverter"
"github.com/zeta-chain/node/e2e/contracts/testdappv2"
crosschaintypes "github.com/zeta-chain/node/x/crosschain/types"
"math/big"
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
Expand Down

0 comments on commit 33eb8ef

Please sign in to comment.