From e8325f9a98c3ef8f1fd26f3f20f68434a93c93ae Mon Sep 17 00:00:00 2001 From: raulk Date: Tue, 14 Mar 2023 12:49:40 +0000 Subject: [PATCH] Revert "Eth API: drop support for 'pending' block parameter." This reverts commit 9412753ba33c4bba7dd5df34a1cd5f9a34464e4f. --- node/impl/full/eth.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index b4a5c75d6..70752cf3a 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -235,13 +235,14 @@ func (a *EthModule) EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthH } func (a *EthModule) parseBlkParam(ctx context.Context, blkParam string, strict bool) (tipset *types.TipSet, err error) { - switch blkParam { - case "earliest", "pending": - return nil, fmt.Errorf("block param %q is not supported", blkParam) + if blkParam == "earliest" { + return nil, fmt.Errorf("block param \"earliest\" is not supported") } head := a.Chain.GetHeaviestTipSet() switch blkParam { + case "pending": + return head, nil case "latest": parent, err := a.Chain.GetTipSetFromKey(ctx, head.Parents()) if err != nil {