Skip to content

Commit

Permalink
feat: add watcher to execution layer in init script
Browse files Browse the repository at this point in the history
  • Loading branch information
LayneHaber committed Nov 16, 2023
1 parent f2674f0 commit 85cddb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 1 addition & 6 deletions packages/deployments/contracts/src/cli/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ export const getContract = (
name: isConnext ? "Connext" : implementation ?? name,
address: result.address,
abi,
contract: new Contract(
result.address as string,
// Special case if this is the Connext diamond.
isConnext ? ConnextInterface : abi,
connection,
),
contract: new Contract(result.address as string, abi, connection),
};
};

Expand Down
12 changes: 12 additions & 0 deletions packages/deployments/contracts/src/cli/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,18 @@ export const initProtocol = async (protocol: ProtocolStack, apply: boolean, stag
write: { method: "addWatcher", args: [watcher] },
chainData,
});

// Whitelist on execution layer as well
for (const network of protocol.networks) {
await updateIfNeeded({
apply,
deployment: network.deployments.Connext,
desired: 2,
read: { method: "queryRole", args: [watcher] },
write: { method: "assignRoleWatcher", args: [watcher] },
chainData,
});
}
}
}
// TODO: Blacklist/remove watchers.
Expand Down

0 comments on commit 85cddb8

Please sign in to comment.