Skip to content
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

Remove extraneous check in can_register_in_v2 #159

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions router/sources/router.move
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ module router::router {
/// If the name is registered and active in v1, then the name can only be registered if we have burned the token (sent it to the router_signer)
/// Else, the name can only be registered if it is available in v2 (we double check availablity for safety)
inline fun can_register_in_v2(domain_name: String, subdomain_name: Option<String>): bool {
if (domains::name_is_registered(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we need name_is_registered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is checked in name_is_expired

subdomain_name,
domain_name
) && !domains::name_is_expired(subdomain_name, domain_name)) {
if (!domains::name_is_expired(subdomain_name, domain_name)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to use name_is_expired_past_grace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I think grace is the one we want to use.

let (is_burned, _token_id) = domains::is_token_owner(
router_signer_addr(),
subdomain_name,
Expand Down