Update ABI files.

This commit is contained in:
Spencer Ofwiti
2021-05-13 12:17:59 +03:00
parent 94cf97b858
commit 2699dc5bcc
4 changed files with 41 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
import { environment } from '@src/environments/environment';
import Web3 from 'web3';
const abi: Array<any> = require('@src/assets/js/block-sync/data/AccountRegistry.json');
const abi: Array<any> = require('@src/assets/js/block-sync/data/AccountsIndex.json');
const web3: Web3 = new Web3(environment.web3Provider);
export class AccountIndex {
@@ -20,11 +20,11 @@ export class AccountIndex {
}
public async totalAccounts(): Promise<number> {
return await this.contract.methods.count().call();
return await this.contract.methods.entryCount().call();
}
public async haveAccount(address: string): Promise<boolean> {
return (await this.contract.methods.accountIndex(address).call()) !== 0;
return (await this.contract.methods.have(address).call()) !== 0;
}
public async last(numberOfAccounts: number): Promise<Array<string>> {
@@ -35,7 +35,7 @@ export class AccountIndex {
}
const accounts: Array<string> = [];
for (let i = count - 1; i > lowest; i--) {
const account: string = await this.contract.methods.accounts(i).call();
const account: string = await this.contract.methods.entry(i).call();
accounts.push(account);
}
return accounts;