Skip to content

Fixes to expiration time handling#32

Open
zie1ony wants to merge 1 commit into
feature/support-microsecsfrom
feature/support-microsecs-fixes
Open

Fixes to expiration time handling#32
zie1ony wants to merge 1 commit into
feature/support-microsecsfrom
feature/support-microsecs-fixes

Conversation

@zie1ony

@zie1ony zie1ony commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This pull request updates how expiration timestamps are handled and stored for name tokens, ensuring that the original precision provided by off-chain components (potentially in microseconds) is preserved in metadata, while all on-chain logic and comparisons consistently operate in milliseconds. The changes improve clarity, maintain data fidelity, and update tests to reflect the new behavior.

Expiration timestamp handling and storage:

  • The NameTokenMetadata struct now stores the expiration timestamp verbatim as provided (which may be in microseconds), and only normalizes to milliseconds when the value is read for on-chain logic or comparison. This change applies to both registration and renewal flows, ensuring metadata always preserves the original precision. [1] [2] [3] [4] [5]

  • The normalization of expiration timestamps is now performed only in the expiration() getter method, and not during construction, mutation, or deserialization of NameTokenMetadata. This ensures that serialization and storage always reflect the raw value provided by off-chain components. [1] [2]

Test updates and improvements:

  • Tests for registration and renewal have been updated to verify that the raw microsecond timestamp is preserved in metadata, and that normalization occurs only on read for on-chain checks. Additional assertions ensure that serialization round-trips the original value. [1] [2] [3] [4]

  • Test names and comments have been updated for clarity, reflecting the new behavior regarding metadata preservation and normalization on read. [1] [2] [3] [4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant