web3dart
web3dart copied to clipboard
getBlockInformation() - Throws Error
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.
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));
}
}