Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

getBlockInformation() - Throws Error #235

Open
TheGreatAxios opened this issue Dec 31, 2021 · 1 comment
Open

getBlockInformation() - Throws Error #235

TheGreatAxios opened this issue Dec 31, 2021 · 1 comment

Comments

@TheGreatAxios
Copy link

Using this in a for loop starting at 0 and right now it is running from 0 -> 0x28 so about 45-50 times I believe.

Using: getBlockInformation(blockNumber: BlockNum.exact(i).toBlockParam());

When it gets to 0x28 it throws this error;

#0      JsonRPC.call (package:web3dart/json_rpc.dart:62:7)
<asynchronous suspension>
#1      Web3Client._makeRPCCall (package:web3dart/src/core/client.dart:54:20)
<asynchronous suspension>```

Any thoughts would be helpful, pretty sure that I did something similar a few days ago so not sure what may be throwing the error now. 
@simolus3
Copy link
Owner

simolus3 commented Jan 6, 2022

I tried to reproduce this with the following snippet, but it does not report an error for me. Maybe you're hitting rate limits?

import 'package:http/http.dart';
import 'package:web3dart/web3dart.dart';

Future<void> main() async {
  final client = Web3Client(
    'https://mainnet.infura.io/v3/<project>',
    Client(),
  );

  for (var i = 0; i <= 0x28; i++) {
    await client.getBlockInformation(blockNumber: BlockNum.exact(i));
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants