Skip to content

Commit

Permalink
Ensure default signers get loaded before appending to it (compound-fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jflatow authored Aug 17, 2022
1 parent 1066298 commit 79a368a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/deployment_manager/DeploymentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ export class DeploymentManager {
}

// address given, first try to find the managed signer for it
const signer = this._signers.find(s => s.address.toLowerCase() === address.toLowerCase());
const signers = await this.getSigners(); // ensure loaded
const signer = signers.find(s => s.address.toLowerCase() === address.toLowerCase());
if (signer) {
return signer;
}

// otherwise create a new managed signer for the given address
const newSigner = await getManagedSigner(await this.hre.ethers.getSigner(address));
this._signers.push(newSigner);
signers.push(newSigner);
return newSigner;
}

Expand Down

0 comments on commit 79a368a

Please sign in to comment.