Skip to content

Commit

Permalink
Fix router in post cutoff period (#184)
Browse files Browse the repository at this point in the history
* Fix router in post cutoff period

* Use version 3.3.0
  • Loading branch information
BriungRi authored May 10, 2024
1 parent c2a8360 commit c24fbcd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 12 additions & 2 deletions router/sources/router.move
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,22 @@ module router::router {
};

// Mint token in v2
// Names past the cutoff date will end up with a negative
// registration duration. The following logic ensures that duration
// is >= 1
let registration_duration_secs = if (new_expiration_time_sec > now)
{
new_expiration_time_sec - now
} else {
// Must be non-zero so that the name is not considered expired
1
};
v2_1_domains::register_name_with_router(
router_signer,
user,
domain_name,
subdomain_name,
new_expiration_time_sec - now
registration_duration_secs,
);

// If the name was a primary name, carry it over (`target_addr` gets automatically carried over too)
Expand Down Expand Up @@ -770,7 +780,7 @@ module router::router {
subdomain_name: Option<String>,
): bool {
let (is_owner, _token_id) = domains::is_token_owner(owner_addr, subdomain_name, domain_name);
is_owner && !domains::name_is_expired(subdomain_name, domain_name)
is_owner && !domains::name_is_expired_past_grace(subdomain_name, domain_name)
}

#[view]
Expand Down
4 changes: 1 addition & 3 deletions sh_scripts/dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ if ! command -v aptos &>/dev/null; then
echo "aptos could not be found"
echo "installing it..."
TARGET=Ubuntu-x86_64
VERSION=2.0.2
VERSION=3.3.0
wget https://github.com/aptos-labs/aptos-core/releases/download/aptos-cli-v$VERSION/aptos-cli-$VERSION-$TARGET.zip
sha=$(shasum -a 256 aptos-cli-$VERSION-$TARGET.zip | awk '{ print $1 }')
[ "$sha" != "1f0ed0d0e042ff8b48b428eaaff9f52e6ff2b246a2054740d017f514c753c6cb" ] && echo "shasum mismatch" && exit 1
unzip aptos-cli-$VERSION-$TARGET.zip
chmod +x aptos
else
Expand Down

0 comments on commit c24fbcd

Please sign in to comment.