added comment and indents

This commit is contained in:
Blair Vanderlugt 2021-06-12 12:37:54 -07:00
parent ad71df5c52
commit 36c6d4b16d
2 changed files with 9 additions and 3 deletions

View File

@ -12,10 +12,13 @@ export class AccountIndex {
constructor(contractAddress: string, signerAddress?: string) {
this.contractAddress = contractAddress;
this.contract = new web3.eth.Contract(abi, this.contractAddress);
// TODO this signer logic should be part of the web3service
// if signer address is not passed (for example in user service) then
// this fallsback to a web3 wallet that is not even connected???
if (signerAddress) {
this.signerAddress = signerAddress;
this.signerAddress = signerAddress;
} else {
this.signerAddress = web3.eth.accounts[0];
this.signerAddress = web3.eth.accounts[0];
}
}

View File

@ -51,7 +51,10 @@ export class RegistryService {
return new Promise(async (resolve, reject) => {
if (!RegistryService.accountRegistry) {
const registry = await RegistryService.getRegistry()
const accountRegistryAddress = await RegistryService.registry.getContractAddressByName('AccountRegistry')
const accountRegistryAddress = await RegistryService
.registry
.getContractAddressByName('AccountRegistry')
if (!accountRegistryAddress) {
return reject("Unable to initialize Account Registry")
}