Skip to content

Commit

Permalink
Merge branch 'develop' into feat/read-chain-info
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Jun 26, 2024
2 parents 54dd10c + a97bf13 commit 30271ec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
* [2256](https://github.com/zeta-chain/node/pull/2256) - fix rate limiter falsely included reverted non-withdraw cctxs
* [2327](https://github.com/zeta-chain/node/pull/2327) - partially cherry picked the fix to Bitcoin outbound dust amount
* [2362](https://github.com/zeta-chain/node/pull/2362) - set 1000 satoshis as minimum BTC amount that can be withdrawn from zEVM
* [2382](https://github.com/zeta-chain/node/pull/2382) - add tx input and gas in rpc methods for synthetic eth txs

### CI

Expand Down
1 change: 1 addition & 0 deletions rpc/backend/backend_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func (suite *BackendTestSuite) buildSyntheticTxResult(txHash string) ([]byte, ab
{Type: evmtypes.EventTypeEthereumTx, Attributes: []abci.EventAttribute{
{Key: "ethereumTxHash", Value: txHash},
{Key: "txIndex", Value: "8888"},
{Key: "txData", Value: "0x1234"},
{Key: "amount", Value: "1000"},
{Key: "txGasUsed", Value: "21000"},
{Key: "txHash", Value: ""},
Expand Down
3 changes: 3 additions & 0 deletions rpc/backend/tx_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (suite *BackendTestSuite) TestGetSyntheticTransactionByHash() {
suite.Require().Equal(uint64(88), txType)
suite.Require().Equal(int64(7001), res.ChainID.ToInt().Int64())
suite.Require().Equal(int64(1000), res.Value.ToInt().Int64())
gas, _ := hexutil.DecodeUint64(res.Gas.String())
suite.Require().Equal(uint64(21000), gas)
suite.Require().Equal("0x1234", res.Input.String())
suite.Require().Nil(res.V)
suite.Require().Nil(res.R)
suite.Require().Nil(res.S)
Expand Down
4 changes: 3 additions & 1 deletion rpc/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error
}

// some old versions miss some events, fill it with tx result
if len(p.Txs) == 1 {
// txs with type CosmosEVMTxType will always emit GasUsed in events so no need to override for those
if len(p.Txs) == 1 && p.Txs[0].Type != CosmosEVMTxType {
// #nosec G701 always positive
p.Txs[0].GasUsed = uint64(result.GasUsed)
}
Expand Down Expand Up @@ -240,6 +241,7 @@ func ParseTxIndexerResult(
Type: parsedTx.Type,
Recipient: parsedTx.Recipient,
Sender: parsedTx.Sender,
GasUsed: parsedTx.GasUsed,
Data: parsedTx.Data,
Nonce: parsedTx.Nonce,
}, nil
Expand Down
2 changes: 1 addition & 1 deletion rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func NewRPCTransactionFromIncompleteMsg(
Gas: hexutil.Uint64(txAdditional.GasUsed),
GasPrice: (*hexutil.Big)(baseFee),
Hash: common.HexToHash(msg.Hash),
Input: []byte{},
Input: txAdditional.Data,
Nonce: hexutil.Uint64(txAdditional.Nonce), // TODO: get nonce for "from" from ethermint
To: to,
Value: (*hexutil.Big)(txAdditional.Value),
Expand Down

0 comments on commit 30271ec

Please sign in to comment.