Skip to content

Add has_operator() boolean read as a cheaper alternative to fetching the full operator addressΒ #99

Description

@Jagadeeshftw

πŸ“Œ 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

  • has_operator() correctly reflects whether an operator is currently appointed.
  • operator()'s existing behavior is unchanged.
  • Documented in the README.

πŸ”’ Security notes

Read-only addition; no new attack surface.

πŸ“‹ Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueenhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions