Skip to content

Commit

Permalink
changelog and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Oct 25, 2024
1 parent 10be631 commit e60cb0f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
* [2909](https://github.com/zeta-chain/node/pull/2909) - add legacy messages back to codec for querier backward compatibility
* [3018](https://github.com/zeta-chain/node/pull/3018) - support `DepositAndCall` and `WithdrawAndCall` with empty payload
* [3030](https://github.com/zeta-chain/node/pull/3030) - Avoid storing invalid Solana gateway address in the `SetGatewayAddress`
* [3047](https://github.com/zeta-chain/node/pull/3047) - wrong block hash in subscribe new heads

## v20.0.0

Expand Down
14 changes: 12 additions & 2 deletions rpc/backend/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,12 @@ func (suite *BackendTestSuite) TestHeaderByNumber() {
header, err := suite.backend.HeaderByNumber(tc.blockNumber)

if tc.expPass {
expHeader := ethrpc.EthHeaderFromTendermint(expResultBlock.Block.Header, ethtypes.Bloom{}, tc.baseFee, validator)
expHeader := ethrpc.EthHeaderFromTendermint(
expResultBlock.Block.Header,
ethtypes.Bloom{},
tc.baseFee,
validator,
)
suite.Require().NoError(err)
suite.Require().Equal(expHeader, header)
} else {
Expand Down Expand Up @@ -1406,7 +1411,12 @@ func (suite *BackendTestSuite) TestHeaderByHash() {
header, err := suite.backend.HeaderByHash(tc.hash)

if tc.expPass {
expHeader := ethrpc.EthHeaderFromTendermint(expResultBlock.Block.Header, ethtypes.Bloom{}, tc.baseFee, validator)
expHeader := ethrpc.EthHeaderFromTendermint(
expResultBlock.Block.Header,
ethtypes.Bloom{},
tc.baseFee,
validator,
)
suite.Require().NoError(err)
suite.Require().Equal(expHeader, header)
} else {
Expand Down
2 changes: 1 addition & 1 deletion rpc/backend/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/cometbft/cometbft/libs/log"
"github.com/cometbft/cometbft/proto/tendermint/crypto"
tmrpctypes "github.com/cometbft/cometbft/rpc/core/types"
tmtypes "github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -36,7 +37,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

tmtypes "github.com/cometbft/cometbft/types"
"github.com/zeta-chain/node/rpc/types"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ type Header struct {
Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
MixDigest common.Hash `json:"mixHash"`
Nonce ethtypes.BlockNonce `json:"nonce"`
BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
// overwrite rlpHash
Hash common.Hash `json:"hash"`
}
7 changes: 6 additions & 1 deletion rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ func RawTxToEthTx(clientCtx client.Context, txBz tmtypes.Tx) ([]*evmtypes.MsgEth

// EthHeaderFromTendermint is an util function that returns an Ethereum Header
// from a tendermint Header.
func EthHeaderFromTendermint(header tmtypes.Header, bloom ethtypes.Bloom, baseFee *big.Int, miner sdk.AccAddress) *ethtypes.Header {
func EthHeaderFromTendermint(
header tmtypes.Header,
bloom ethtypes.Bloom,
baseFee *big.Int,
miner sdk.AccAddress,
) *ethtypes.Header {
txHash := ethtypes.EmptyRootHash
if len(header.DataHash) == 0 {
txHash = common.BytesToHash(header.DataHash)
Expand Down

0 comments on commit e60cb0f

Please sign in to comment.