diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f69d49fd7dd4..f9c3af0de88e 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -734,10 +734,10 @@ func (s *BlockChainAPI) GetHeaderByHash(ctx context.Context, hash common.Hash) m } // GetBlockByNumber returns the requested canonical block. -// * When blockNr is -1 the chain head is returned. -// * When blockNr is -2 the pending chain head is returned. -// * When fullTx is true all transactions in the block are returned, otherwise -// only the transaction hash is returned. +// - When blockNr is -1 the chain head is returned. +// - When blockNr is -2 the pending chain head is returned. +// - When fullTx is true all transactions in the block are returned, otherwise +// only the transaction hash is returned. func (s *BlockChainAPI) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error) { block, err := s.b.BlockByNumber(ctx, number) if block != nil && err == nil { @@ -2331,6 +2331,15 @@ func (s *BundleAPI) EstimateGasBundle(ctx context.Context, args EstimateGasBundl jsonResult := map[string]interface{}{ "gasUsed": result.UsedGas, } + + if result.Err != nil { + jsonResult["error"] = result.Err.Error() + revert := result.Revert() + if len(revert) > 0 { + jsonResult["revert"] = string(revert) + } + } + results = append(results, jsonResult) }