w3f / staking-rewards-collector

Apache License 2.0
78 stars 32 forks source link

fixed the corner case of having exactly a multiple of 100 staking events #24

Closed jonasW3F closed 3 years ago

jonasW3F commented 3 years ago

It might be that subscan changed their API. Having an address which had exactly a multiple of 100 of staking rewards broke the code recently. Previously, as far as I remember, that should have been fixed with @maciejhirsz PR. But maybe subscan changed something to their API and parsing an address caused this error:

image_2

I fixed the issue by not checking for the length of the list, but rather checking if it is null.