Eth API: make eth_getTransactionByBlock* ops return ErrUnsupported.

This commit is contained in:
Raúl Kripalani 2023-03-12 15:53:56 +00:00
parent 8b5bc45fcf
commit e65a5988e1

View File

@ -42,6 +42,8 @@ import (
"github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/dtypes"
) )
var ErrUnsupported = errors.New("unsupported method")
type EthModuleAPI interface { type EthModuleAPI interface {
EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error) EthBlockNumber(ctx context.Context) (ethtypes.EthUint64, error)
EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error) EthAccounts(ctx context.Context) ([]ethtypes.EthAddress, error)
@ -439,12 +441,12 @@ func (a *EthModule) EthGetTransactionReceipt(ctx context.Context, txHash ethtype
return &receipt, nil return &receipt, nil
} }
func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(ctx context.Context, blkHash ethtypes.EthHash, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { func (a *EthAPI) EthGetTransactionByBlockHashAndIndex(context.Context, ethtypes.EthHash, ethtypes.EthUint64) (ethtypes.EthTx, error) {
return ethtypes.EthTx{}, nil return ethtypes.EthTx{}, ErrUnsupported
} }
func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(ctx context.Context, blkNum ethtypes.EthUint64, txIndex ethtypes.EthUint64) (ethtypes.EthTx, error) { func (a *EthAPI) EthGetTransactionByBlockNumberAndIndex(context.Context, ethtypes.EthUint64, ethtypes.EthUint64) (ethtypes.EthTx, error) {
return ethtypes.EthTx{}, nil return ethtypes.EthTx{}, ErrUnsupported
} }
// EthGetCode returns string value of the compiled bytecode // EthGetCode returns string value of the compiled bytecode