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' 'AccountRegistry'
); );
const accountIndexQuery = new AccountIndex(accountIndexAddress); const accountIndexQuery = new AccountIndex(accountIndexAddress);
const accountAddresses: Array<string> = await accountIndexQuery.last( const accountAddresses: Array<string> = await accountIndexQuery.last(limit);
await accountIndexQuery.totalAccounts()
);
console.log(accountAddresses);
this.loggingService.sendInfoLevelMessage(accountAddresses); this.loggingService.sendInfoLevelMessage(accountAddresses);
for (const accountAddress of accountAddresses.slice(offset, offset + limit)) { for (const accountAddress of accountAddresses.slice(offset, offset + limit)) {
await this.getAccountByAddress(accountAddress, limit); await this.getAccountByAddress(accountAddress, limit);