-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KS-264: Capability registry internal review informational findings #13437
KS-264: Capability registry internal review informational findings #13437
Conversation
…lity-registry-internal-review-informational-findings
…lity-registry-internal-review-informational-findings
@@ -447,13 +463,10 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface { | |||
|
|||
Node storage node = s_nodes[p2pId]; | |||
|
|||
bool nodeExists = bytes32(node.signer) != bytes32(""); | |||
if (!nodeExists) revert InvalidNodeP2PId(p2pId); | |||
if (bytes32(node.signer) == bytes32("")) revert InvalidNodeP2PId(p2pId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (bytes32(node.signer) == bytes32("")) revert InvalidNodeP2PId(p2pId); | |
if (bytes32(node.signer) == bytes32("")) revert ???(p2pId); |
The error message here is misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this check p2pId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it could be either. We are basically just checking to see if the p2pId
on line 464 queried a valid node. Wdyt about changing this error message to be NodeDoesNotExist
to match the other error messages when an entity does not exist?
bool nodeExists = s_nodes[node.p2pId].signer != bytes32(""); | ||
if (!nodeExists) revert InvalidNodeP2PId(node.p2pId); | ||
Node storage storedNode = s_nodes[node.p2pId]; | ||
if (storedNode.signer == bytes32("")) revert InvalidNodeP2PId(node.p2pId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
No description provided.