Skip to content

Commit

Permalink
feat: make roots easily accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
auryn-macmillan committed Sep 5, 2024
1 parent 6305380 commit 01a7b6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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];
}
}

0 comments on commit 01a7b6b

Please sign in to comment.