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,6 +12,9 @@ export class AccountIndex {
constructor(contractAddress: string, signerAddress?: string) { constructor(contractAddress: string, signerAddress?: string) {
this.contractAddress = contractAddress; this.contractAddress = contractAddress;
this.contract = new web3.eth.Contract(abi, this.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) { if (signerAddress) {
this.signerAddress = signerAddress; this.signerAddress = signerAddress;
} else { } else {

View File

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