Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
amsanghi committed Dec 23, 2024
1 parent 2d721c3 commit ccedd73
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions execution/gethexec/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,34 +344,31 @@ func (api *ArbTraceForwarderAPI) blockSupportedByClassicNode(blockNumOrHash json
if !isNum {
return nil
}
blockNum, _ = api.blockchain.ClipToPostNitroGenesis(blockNum)
// #nosec G115
if blockNum < 0 || blockNum > rpc.BlockNumber(api.blockchain.Config().ArbitrumChainParams.GenesisBlockNum) {
return fmt.Errorf("block number %v is not supported by classic node", blockNum)
}
return nil
}

func (api *ArbTraceForwarderAPI) Call(ctx context.Context, callArgs json.RawMessage, traceTypes json.RawMessage, blockNumOrHash json.RawMessage) (*json.RawMessage, error) {
var err error
err = api.blockSupportedByClassicNode(blockNumOrHash)
err := api.blockSupportedByClassicNode(blockNumOrHash)
if err != nil {
return nil, err
}
return api.forward(ctx, "arbtrace_call", callArgs, traceTypes, blockNumOrHash)
}

func (api *ArbTraceForwarderAPI) CallMany(ctx context.Context, calls json.RawMessage, blockNumOrHash json.RawMessage) (*json.RawMessage, error) {
var err error
err = api.blockSupportedByClassicNode(blockNumOrHash)
err := api.blockSupportedByClassicNode(blockNumOrHash)
if err != nil {
return nil, err
}
return api.forward(ctx, "arbtrace_callMany", calls, blockNumOrHash)
}

func (api *ArbTraceForwarderAPI) ReplayBlockTransactions(ctx context.Context, blockNumOrHash json.RawMessage, traceTypes json.RawMessage) (*json.RawMessage, error) {
var err error
err = api.blockSupportedByClassicNode(blockNumOrHash)
err := api.blockSupportedByClassicNode(blockNumOrHash)
if err != nil {
return nil, err
}
Expand All @@ -391,8 +388,7 @@ func (api *ArbTraceForwarderAPI) Get(ctx context.Context, txHash json.RawMessage
}

func (api *ArbTraceForwarderAPI) Block(ctx context.Context, blockNumOrHash json.RawMessage) (*json.RawMessage, error) {
var err error
err = api.blockSupportedByClassicNode(blockNumOrHash)
err := api.blockSupportedByClassicNode(blockNumOrHash)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ccedd73

Please sign in to comment.