Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Fix blockbloom in header error #258

Merged
merged 8 commits into from
Jul 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unused method
  • Loading branch information
thomas-nguy committed Jul 14, 2021
commit 105de8928c6e4fc118bf0b6757a8912e5add56ef
24 changes: 0 additions & 24 deletions ethereum/rpc/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,6 @@ func RawTxToEthTx(clientCtx client.Context, txBz tmtypes.Tx) (*evmtypes.MsgEther
return ethTx, nil
}

// EthBlockFromTendermint returns a JSON-RPC compatible Ethereum blockfrom a given Tendermint block.
func EthBlockFromTendermint(clientCtx client.Context, queryClient *QueryClient, block *tmtypes.Block) (map[string]interface{}, error) {
gasLimit, err := BlockMaxGasFromConsensusParams(context.Background(), clientCtx)
if err != nil {
return nil, err
}

transactions, gasUsed, err := EthTransactionsFromTendermint(clientCtx, block.Txs)
if err != nil {
return nil, err
}

req := &evmtypes.QueryBlockBloomRequest{}

blockBloomResp, err := queryClient.BlockBloom(ContextWithHeight(block.Height), req)
if err != nil {
blockBloomResp = &evmtypes.QueryBlockBloomResponse{Bloom: ethtypes.Bloom{}.Bytes()}
}

bloom := ethtypes.BytesToBloom(blockBloomResp.Bloom)

return FormatBlock(block.Header, block.Size(), gasLimit, gasUsed, transactions, bloom), nil
}

// NewTransaction returns a transaction that will serialize to the RPC
// representation, with the given location metadata set (if available).
func NewTransaction(tx *ethtypes.Transaction, blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction {
Expand Down