-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: correct the use of inputIndex in tests #85
Conversation
// IIWE stands for InputIndexWithinEpoch | ||
error IIWEOutOfBounds(uint256 length, uint256 inputIndexWithinEpoch); |
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 a developer (not too familiar with the code) runs forge test
and gets this error, they will have no idea what IIWE
means. I would, therefore, not abbreviate this error name.
// IIWE stands for InputIndexWithinEpoch | |
error IIWEOutOfBounds(uint256 length, uint256 inputIndexWithinEpoch); | |
error InputIndexWithinEpochOutOfBounds(uint256 length, uint256 inputIndexWithinEpoch); |
// IIWE stands for InputIndexWithinEpoch | ||
function checkIIWE(uint256 inputIndexWithinEpoch) internal view { |
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.
This might save some characters, but we lose clarity by abbreviating InputIndexWithinEpoch
to IIWE
.
I would, therefore, avoid abbreviating it.
This applies to IIWEStr
as well.
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.
Yeah. It's always a tradeoff between being clear and concise. Since they don't appear often, we could use the lengthy form
@@ -33,7 +33,7 @@ library LibServerManager { | |||
|
|||
struct RawProof { | |||
bytes32 context; | |||
string inputIndex; | |||
string inputIndexWithinEpoch; |
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 you take a peek in finish_epoch_response.json
, you'll see this is indeed inputIndex
.
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.
Then we should modify the proves
function in the LibServerManager.sol
. Instead of checking Proof.inputIndex
, we will be checking Proof.validity.inputIndexWithinEpoch
.
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.
Yes, this makes sense.
BTW, is there a difference between |
|
I don't get this part. What change do you mean :) Apart from being in different levels, is there a difference between |
8e70ec5
to
8d7cf23
Compare
8d7cf23
to
276ee8c
Compare
I believe they contain the same data. |
They contain the same data. |
inputIndex
toinputIndexWithinEpoch
if it's used incorrectlyabbreviateinputIndexWithinEpoch
asIIWE
if it's compounded with other words