Skip to content

Commit

Permalink
fixing linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Sep 4, 2024
1 parent 8314c8b commit 3cacf9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,15 @@ func main() {
return
}
fmt.Print("Enter Start Block: ")
fmt.Scanln(&startBlock)
if _, err := fmt.Scanln(&startBlock); err != nil {
color.Red("Invalid start block: %v", err)
return
}
fmt.Print("Enter Tags (comma-separated): ")
fmt.Scanln(&tags)
if _, err := fmt.Scanln(&tags); err != nil {
color.Red("Invalid tags: %v", err)
return
}

chainIDUint, err := strconv.ParseUint(chainID, 10, 64)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions scanner/providers/web3/erc1155_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,17 @@ func (p *ERC1155HolderProvider) HoldersBalances(ctx context.Context, _ []byte, f
// is reached
startTime := time.Now()
// get single transfer logs
singleLogs, lastBlock, synced, err := RangeOfLogs(ctx, p.client, p.address, fromBlock, toBlock, LOG_TOPIC_ERC1155_TRANSFER_SINGLE)
singleLogs, lastBlock, synced, err := RangeOfLogs(ctx, p.client, p.address,
fromBlock, toBlock, LOG_TOPIC_ERC1155_TRANSFER_SINGLE)
if err != nil && !errors.Is(err, ErrTooManyRequests) {
return nil, 0, fromBlock, false, big.NewInt(0), err
}
if errors.Is(err, ErrTooManyRequests) {
log.Warnf("too many requests, the provider will continue in the next iteration from block %d", lastBlock)
}
// get batch transfer logs
batchLogs, _, _, err := RangeOfLogs(ctx, p.client, p.address, fromBlock, lastBlock, LOG_TOPIC_ERC1155_TRANSFER_BATCH)
batchLogs, _, _, err := RangeOfLogs(ctx, p.client, p.address, fromBlock,
lastBlock, LOG_TOPIC_ERC1155_TRANSFER_BATCH)
if err != nil && !errors.Is(err, ErrTooManyRequests) {
return nil, 0, fromBlock, false, big.NewInt(0), err
}
Expand Down

0 comments on commit 3cacf9b

Please sign in to comment.