From 01a7b6b81b846639503d9ec8b8a215a15185b3cb Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Thu, 5 Sep 2024 12:58:49 -0400 Subject: [PATCH] feat: make roots easily accessible --- .../contracts/registry/CiphernodeRegistryOwnable.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol b/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol index 19a9b693..96c4c54b 100644 --- a/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol +++ b/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol @@ -26,6 +26,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { LeanIMTData public ciphernodes; mapping(uint256 e3Id => IRegistryFilter filter) public requests; + mapping(uint256 e3Id => uint256 root) public roots; mapping(uint256 e3Id => bytes publicKey) public publicKeys; //////////////////////////////////////////////////////////// @@ -84,6 +85,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { CommitteeAlreadyRequested() ); requests[e3Id] = IRegistryFilter(filter); + roots[e3Id] = root(); IRegistryFilter(filter).requestCommittee(e3Id, threshold); emit CommitteeRequested(e3Id, filter, threshold); @@ -162,4 +164,12 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { function isEnabled(address node) public view returns (bool) { return ciphernodes._has(uint256(bytes32(bytes20(node)))); } + + function root() public view returns (uint256) { + return (ciphernodes._root()); + } + + function rootAt(uint256 e3Id) public view returns (uint256) { + return roots[e3Id]; + } }