Description
accept_admin() updates DataKey::Admin and DataKey::SecondaryAdmin to the new pair but never touches DataKey::AdminExpiresAt. A newly-appointed admin pair therefore silently inherits whatever expiry ledger sequence (if any) was set for the previous admin pair -- which could already be in the past (making the new admin pair immediately non-functional for single-admin operations, once the related require_multi_admin() gap is fixed) or simply an arbitrary value that has nothing to do with the new admin's intended term.
Affected modules: contracts/hamplard/src/lib.rs
A freshly appointed admin pair can inherit a stale, unrelated expiry ledger sequence from the previous admin pair with no warning.
Expected Behavior
accept_admin() should clear (or require the new admins to explicitly re-set) AdminExpiresAt as part of the handover, so a new admin term starts without an inherited, unrelated expiry.
Tasks
Clear DataKey::AdminExpiresAt in accept_admin() (or require it to be re-set via set_admin_expiry() as a follow-up).
Add a test asserting a new admin pair is not immediately expired after accept_admin() due to a stale expiry from the previous admin.
Description
accept_admin() updates DataKey::Admin and DataKey::SecondaryAdmin to the new pair but never touches DataKey::AdminExpiresAt. A newly-appointed admin pair therefore silently inherits whatever expiry ledger sequence (if any) was set for the previous admin pair -- which could already be in the past (making the new admin pair immediately non-functional for single-admin operations, once the related require_multi_admin() gap is fixed) or simply an arbitrary value that has nothing to do with the new admin's intended term.
Affected modules: contracts/hamplard/src/lib.rs
A freshly appointed admin pair can inherit a stale, unrelated expiry ledger sequence from the previous admin pair with no warning.
Expected Behavior
accept_admin() should clear (or require the new admins to explicitly re-set) AdminExpiresAt as part of the handover, so a new admin term starts without an inherited, unrelated expiry.
Tasks
Clear DataKey::AdminExpiresAt in accept_admin() (or require it to be re-set via set_admin_expiry() as a follow-up).
Add a test asserting a new admin pair is not immediately expired after accept_admin() due to a stale expiry from the previous admin.