0xMiden / 0xMiden/protocol

Consider refactoring Pausable API

Open
#3,104 1 comment 0 reactions 0 assignees View on GitHub
standards
Dominant language
Rust
Stars
132
Forks
167
Avg merge
1d 23h
Merged PRs (30d)
110

Description

Currently, every fungible faucet account installs the `is_paused` storage slot via `Pausable` and the `pause / unpause` admin procedures `PausableManager` as two separate `.with_component()` calls, which creates an issue forgetting the manager: The slot exists but pause is unreachable, or the procedures exist but the slot is missing and they panic at runtime.

The two components are practically inseparable. We can follow the same convention already used by `AccessControl::Ownable2Step` and `AccessControl::Rbac`, which expand into multiple components with a single `.with_components()` call, by having:

`Pausable` implements `IntoIterator`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.