-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refine domain logic #343
base: francoaguzzi/sc-25546/include-domain-logics-into-ens-utils
Are you sure you want to change the base?
Refine domain logic #343
Conversation
Stop accepting null `domain` param and remove redundant logic.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 54ab2d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
return false; | ||
if (releaseTimestamp && releaseTimestamp.time > atTimestamp.time) { | ||
// if the name is not yet released, we can't register it | ||
// TODO: check for possible off-by-1 errors in the logic above |
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.
@lightwalker-eth can you extend on off-by-1 spec?
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.
We need to see how ENS smart contracts actually work. Ex: Actual expiration time? 1 second earlier? 1 second later?
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.
|
||
// first label must be of sufficient length | ||
return charCount(name.labels[0]) >= MIN_ETH_REGISTRABLE_LABEL_LENGTH; | ||
if (releaseTimestamp && releaseTimestamp.time > atTimestamp.time) { |
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 (releaseTimestamp && releaseTimestamp.time > atTimestamp.time) { | |
if (releaseTimestamp && releaseTimestamp.time >= atTimestamp.time) { |
return charCount(name.labels[0]) >= MIN_ETH_REGISTRABLE_LABEL_LENGTH; | ||
if (releaseTimestamp && releaseTimestamp.time > atTimestamp.time) { | ||
// if the name is released, we can't renew it anymore | ||
// TODO: check for possible off-by-1 errors in the logic above |
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.
atTimestamp.time < existingRegistration.registrationTimestamp.time | ||
) { | ||
// if the renewal is requested before the registration, we can't renew it | ||
// TODO: check for possible off-by-1 errors in the logic above |
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.
OK...
I'd say there is no problem with current logic.
If atTimestamp
is the same than registrationTimestamp
, it is already possible to renew it for longer periods, meaning canRenew
should go on in the function scope, but, if it is smaller, it really is not possible to renew this domain: as per my review this has achieved its goal.
throw new Error(`Invariant violation`); // TODO: refine message... just making the type system happy. | ||
} | ||
|
||
// TODO: review for possible off-by-1 errors |
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.
No description provided.