Skip to content

Commit

Permalink
fix: configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
ameeshaagrawal committed Nov 30, 2022
1 parent a7ccbd5 commit fd6fe76
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ async function configNotary(notaryAddr: string, socketSigner: SignerWithAddress)
try {
const localChainId = await getChainId();
const notary: Contract = await getInstance("AdminNotary", notaryAddr);
await notary.connect(socketSigner).grantAttesterRole(remoteChainId, attesterAddress[localChainId]);
const tx = await notary.connect(socketSigner).grantAttesterRole(remoteChainId, attesterAddress[localChainId]);
await tx.wait();
console.log(`Added ${attesterAddress[localChainId]} as an attester for ${remoteChainId} chain id!`)
} catch (error) {
console.log("Error while configuring Notary", error);
Expand All @@ -63,22 +64,26 @@ async function getSigners() {

async function configSocket(socket: Contract, socketSigner: SignerWithAddress, remoteChainId: number, localConfig: JSON) {
try {
await socket.connect(socketSigner).addConfig(
let tx = await socket.connect(socketSigner).addConfig(
remoteChainId,
localConfig[`fastAccum-${remoteChainId}`],
localConfig[`deaccum-${remoteChainId}`],
localConfig[`deaccum`],
localConfig["verifier"],
fastIntegration
);

await socket.connect(socketSigner).addConfig(
await tx.wait();

tx = await socket.connect(socketSigner).addConfig(
remoteChainId,
localConfig[`slowAccum-${remoteChainId}`],
localConfig[`deaccum-${remoteChainId}`],
localConfig[`deaccum`],
localConfig["verifier"],
slowIntegration
);

await tx.wait();

console.log(`Added slow and fast config for ${remoteChainId} chain id!`)

} catch (error) {
Expand Down

0 comments on commit fd6fe76

Please sign in to comment.