diff --git a/src/app/_eth/accountIndex.ts b/src/app/_eth/accountIndex.ts index bf7445b..7764800 100644 --- a/src/app/_eth/accountIndex.ts +++ b/src/app/_eth/accountIndex.ts @@ -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]; } } diff --git a/src/app/_services/registry.service.ts b/src/app/_services/registry.service.ts index ac2bbd7..8bf3b00 100644 --- a/src/app/_services/registry.service.ts +++ b/src/app/_services/registry.service.ts @@ -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") }