Refactor loop to avoid passing index limit.
This commit is contained in:
parent
08fda5390a
commit
405199cfe3
@ -34,7 +34,7 @@ export class AccountIndex {
|
|||||||
lowest = 0;
|
lowest = 0;
|
||||||
}
|
}
|
||||||
const accounts: Array<string> = [];
|
const accounts: Array<string> = [];
|
||||||
for (let i = count; i > lowest; i--) {
|
for (let i = count - 1; i >= lowest; i--) {
|
||||||
const account: string = await this.contract.methods.entry(i).call();
|
const account: string = await this.contract.methods.entry(i).call();
|
||||||
accounts.push(account);
|
accounts.push(account);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user