From e65a5988e1a54422c60309a324b6661eee11aa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Sun, 12 Mar 2023 15:53:56 +0000 Subject: [PATCH] Eth API: make eth_getTransactionByBlock* ops return ErrUnsupported. --- node/impl/full/eth.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/node/impl/full/eth.go b/node/impl/full/eth.go index fb4cfe6cb..721439502 100644 --- a/node/impl/full/eth.go +++ b/node/impl/full/eth.go @@ -42,6 +42,8 @@ import ( "github.com/filecoin-project/lotus/node/modules/dtypes" ) +var ErrUnsupported = errors.New("unsupported method") + type EthModuleAPI interface { EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) @@ -439,12 +441,12 @@ func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtype return &receipt, nil } -func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { - return ethtypes.EthTx{}, nil +func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(context.Context, ethtypes.EthHash, ethtypes.EthUint64) (ethtypes.EthTx, error) { + return ethtypes.EthTx{}, ErrUnsupported } -func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { - return ethtypes.EthTx{}, nil +func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(context.Context, ethtypes.EthUint64, ethtypes.EthUint64) (ethtypes.EthTx, error) { + return ethtypes.EthTx{}, ErrUnsupported } // EthGetCode returns string value of the compiled bytecode