π Description
operator() returns Result<Address, Error>, erroring when no operator is currently appointed, per the README. A caller (e.g. the frontend, or an admin dashboard) that only wants to conditionally render "operator appointed / not appointed" UI has to catch/handle the error case just to answer a yes/no question, when a plain boolean read would be cheaper and simpler to consume.
π§© Requirements and context
- Add
has_operator(env) -> bool, returning whether an operator is currently appointed, without requiring the caller to handle operator()'s error path.
- No change to
operator()'s existing behavior or error contract.
- Update the README's Admin & lifecycle table.
π οΈ Suggested execution
- Add the new
pub fn to src/lib.rs, backed by the same underlying storage check operator() uses.
- Add tests in
src/test.rs for both the appointed and unappointed states.
- Update the README.
β
Acceptance criteria
π Security notes
Read-only addition; no new attack surface.
π Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
π Description
operator()returnsResult<Address, Error>, erroring when no operator is currently appointed, per the README. A caller (e.g. the frontend, or an admin dashboard) that only wants to conditionally render "operator appointed / not appointed" UI has to catch/handle the error case just to answer a yes/no question, when a plain boolean read would be cheaper and simpler to consume.π§© Requirements and context
has_operator(env) -> bool, returning whether an operator is currently appointed, without requiring the caller to handleoperator()'s error path.operator()'s existing behavior or error contract.π οΈ Suggested execution
pub fntosrc/lib.rs, backed by the same underlying storage checkoperator()uses.src/test.rsfor both the appointed and unappointed states.β Acceptance criteria
has_operator()correctly reflects whether an operator is currently appointed.operator()'s existing behavior is unchanged.π Security notes
Read-only addition; no new attack surface.
π Guidelines