Skip to content

fix: Add auth-context tests for reflector [b#018] - #943

Closed
Jenks00 wants to merge 1 commit into
CalloraOrg:mainfrom
Jenks00:fix/issue-1108-clean
Closed

fix: Add auth-context tests for reflector [b#018]#943
Jenks00 wants to merge 1 commit into
CalloraOrg:mainfrom
Jenks00:fix/issue-1108-clean

Conversation

@Jenks00

@Jenks00 Jenks00 commented Jul 28, 2026

Copy link
Copy Markdown

Description

This PR addresses issue #1108 for the GrantFox FWC26 campaign. It implements a simplified reflector contract alongside comprehensive tests verifying Soroban's authentication workflows, specifically capturing the signer's identity under multiple auth harnesses.

Changes Included

  • Reflector Contract: Created the callora-reflector package with a single reflect_auth entrypoint.
  • Strict Authorization: require_auth() is enforced on the state-changing entrypoint, capturing the caller's Address in Instance storage (StorageKey::LastSigner). No unwrap() on fallible paths.
  • Auth-Context Test Suites (contracts/reflector/tests/auth.rs):
    • test_mock_all_auths: Verifies state mutations process cleanly using env.mock_all_auths().
    • test_strict_auth_harness: Uses env.mock_auths() with an exact MockAuthInvoke payload to rigorously verify the signer identity is captured correctly.
    • test_missing_auth_panics: Confirms the contract triggers a host-level auth error when no authorization is provided.
  • NatSpec: Clear /// rustdoc inline documentation on all public items.

Verification

  • cargo test -p callora-reflector passes with 3/3 tests passing, no failures.
  • Code style aligned with repository linting configuration.

Closes #1108

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Closing this as invalid — it doesn't link to a DripsWave-assigned issue or the PR author isn't the current assignee.

To contribute: apply on DripsWave, wait for assignment, then open a PR with Closes #<issue-number> in the body. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants