Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adapt to subscan paging limit #2037

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kilted-andres
Copy link
Contributor

There is a new restriction from the new Subscan-API that I could not find anywhere in their documentation.
There is a page limit of 100. Trying to query "page": 101 will result in an error message.

To stay within the limit and don't miss any events, we reduce the block range of the queries when necessary.

// SubScan returns some AttesterOf values as hex without the "0x" prefix
// so we first parsed to a Uint8Array via `hexToU8a`, which can handle HexStrings with or without the prefix.
const didU8a = hexToU8a(didAccount);

const didUri = Did.fromChain(didU8a as AccountId32);
logger.debug('Corresponding DID-URI: ' + didUri);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it then become as simple as return Did.fromChain(didU8a as AccountId32);?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

Successfully merging this pull request may close these issues.

2 participants