Use limit to query account index.

This commit is contained in:
Spencer Ofwiti 2021-05-18 15:37:30 +03:00
parent ac231dc03e
commit 9235c969fa

View File

@ -183,10 +183,7 @@ export class UserService {
'AccountRegistry'
);
const accountIndexQuery = new AccountIndex(accountIndexAddress);
const accountAddresses: Array<string> = await accountIndexQuery.last(
await accountIndexQuery.totalAccounts()
);
console.log(accountAddresses);
const accountAddresses: Array<string> = await accountIndexQuery.last(limit);
this.loggingService.sendInfoLevelMessage(accountAddresses);
for (const accountAddress of accountAddresses.slice(offset, offset + limit)) {
await this.getAccountByAddress(accountAddress, limit);