Skip to content

[SN]: Move function notarization:is_destroy_allowed() uses timelock::is_timelocked_unlock #301

Description

@chrisgitiota

Feature description

In the current Single Notarization Move package the function notarization::is_destroy_allowed() - being used by notarization::destroy() - only uses the function timelock::is_timelocked_unlock_at() for Dynamic Notarizations to check if the notarization object is locked.

As the current version of Single Notarization uses an outdated timelock enum with a minimal set of enum variants this is OK for the current implementation.

When the timelock enum is extended during future development - i.e. using the tf_components::timelock enum - this is NOK.

Before extended timelock enums like tf_components::timelock (i.e. providing the TimeLock::Infinite variant) can be used, the currently used function timelock::is_timelocked_unlock_at() in notarization::is_destroy_allowed() needs to be replaced by a function or functionality that checks for the existing timelock:

  • if it is TimeLock::UntilDestroyed --> destroy is allowed
  • if timelock::is_timelocked() returns false --> destroy is allowed

The intend of the function notarization::is_destroy_allowed() is primarily to check if a timelock is locked and that it's not locked by the UntilDestroyed variant.

Motivation

Prepare function notarization::is_destroy_allowed() for future development and usage of the tf_components::timelock enum which i.e. provides the TimeLock::Infinite variant.

Requirements


Open questions

No response

Are you planning to do it yourself in a pull request?

No

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions