Merge branch 'master' into spencer/docs
This commit is contained in:
commit
5e809594c7
@ -94,12 +94,12 @@ export class AccountIndex {
|
|||||||
*/
|
*/
|
||||||
public async last(numberOfAccounts: number): Promise<Array<string>> {
|
public async last(numberOfAccounts: number): Promise<Array<string>> {
|
||||||
const count: number = await this.totalAccounts();
|
const count: number = await this.totalAccounts();
|
||||||
let lowest: number = count - numberOfAccounts - 1;
|
let lowest: number = count - numberOfAccounts;
|
||||||
if (lowest < 0) {
|
if (lowest < 0) {
|
||||||
lowest = 0;
|
lowest = 0;
|
||||||
}
|
}
|
||||||
const accounts: Array<string> = [];
|
const accounts: Array<string> = [];
|
||||||
for (let i = count - 1; i > lowest; i--) {
|
for (let i = count; 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