Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 9, 2024
1 parent f68f3f7 commit cba0b15
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions rpc/backend/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (b *Backend) HeaderByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Heade
}
validator, err := b.getValidatorAccount(resBlock)
if err != nil {
return nil, fmt.Errorf("failed to get validator account %w", err)
return nil, err

Check warning on line 326 in rpc/backend/blocks.go

View check run for this annotation

Codecov / codecov/patch

rpc/backend/blocks.go#L326

Added line #L326 was not covered by tests
}
ethHeader := rpctypes.EthHeaderFromTendermint(resBlock.Block.Header, bloom, baseFee, validator)
return ethHeader, nil
Expand Down Expand Up @@ -356,7 +356,7 @@ func (b *Backend) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error)
}
validator, err := b.getValidatorAccount(resBlock)
if err != nil {
return nil, fmt.Errorf("failed to get validator account %w", err)
return nil, err

Check warning on line 359 in rpc/backend/blocks.go

View check run for this annotation

Codecov / codecov/patch

rpc/backend/blocks.go#L359

Added line #L359 was not covered by tests
}
ethHeader := rpctypes.EthHeaderFromTendermint(resBlock.Block.Header, bloom, baseFee, validator)
return ethHeader, nil
Expand Down Expand Up @@ -510,7 +510,7 @@ func (b *Backend) EthBlockFromTendermintBlock(
}
validator, err := b.getValidatorAccount(resBlock)
if err != nil {
return nil, fmt.Errorf("failed to get validator account %w", err)
return nil, err

Check warning on line 513 in rpc/backend/blocks.go

View check run for this annotation

Codecov / codecov/patch

rpc/backend/blocks.go#L513

Added line #L513 was not covered by tests
}
ethHeader := rpctypes.EthHeaderFromTendermint(block.Header, bloom, baseFee, validator)
msgs := b.EthMsgsFromTendermintBlock(resBlock, blockRes)
Expand Down
3 changes: 1 addition & 2 deletions rpc/backend/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (

"github.com/cometbft/cometbft/proto/tendermint/crypto"
"github.com/evmos/ethermint/rpc/types"
rpctypes "github.com/evmos/ethermint/rpc/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
)
Expand Down Expand Up @@ -321,7 +320,7 @@ func GetHexProofs(proof *crypto.ProofOps) []string {

func (b *Backend) getValidatorAccount(resBlock *tmrpctypes.ResultBlock) (sdk.AccAddress, error) {
res, err := b.queryClient.ValidatorAccount(
rpctypes.ContextWithHeight(resBlock.Block.Header.Height),
types.ContextWithHeight(resBlock.Block.Header.Height),
&evmtypes.QueryValidatorAccountRequest{
ConsAddress: sdk.ConsAddress(resBlock.Block.Header.ProposerAddress).String(),
},
Expand Down
7 changes: 4 additions & 3 deletions rpc/stream/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/evmos/ethermint/rpc/types"
rpctypes "github.com/evmos/ethermint/rpc/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
"google.golang.org/grpc"
)
Expand Down Expand Up @@ -46,7 +45,9 @@ type RPCHeader struct {
Hash common.Hash
}

type validatorAccountFunc func(ctx context.Context, in *evmtypes.QueryValidatorAccountRequest, opts ...grpc.CallOption) (*evmtypes.QueryValidatorAccountResponse, error)
type validatorAccountFunc func(
ctx context.Context, in *evmtypes.QueryValidatorAccountRequest, opts ...grpc.CallOption,
) (*evmtypes.QueryValidatorAccountResponse, error)

// RPCStream provides data streams for newHeads, logs, and pendingTransactions.
type RPCStream struct {
Expand Down Expand Up @@ -153,7 +154,7 @@ func (s *RPCStream) start(

baseFee := types.BaseFeeFromEvents(data.ResultFinalizeBlock.Events)
res, err := s.validatorAccount(
rpctypes.ContextWithHeight(data.Block.Height),
types.ContextWithHeight(data.Block.Height),
&evmtypes.QueryValidatorAccountRequest{
ConsAddress: sdk.ConsAddress(data.Block.Header.ProposerAddress).String(),
},
Expand Down
2 changes: 1 addition & 1 deletion rpc/websockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ type Header struct {
Nonce ethtypes.BlockNonce `json:"nonce"`
BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
//overwrite rlpHash
// overwrite rlpHash
Hash common.Hash `json:"hash"`
}

Expand Down

0 comments on commit cba0b15

Please sign in to comment.