Skip to content

Fix admin-transfer test coverage and remove ineffective auth assertions - #281

Draft
chizzy192 with Copilot wants to merge 1 commit into
devfrom
copilot/fix-code-comments-review
Draft

Fix admin-transfer test coverage and remove ineffective auth assertions#281
chizzy192 with Copilot wants to merge 1 commit into
devfrom
copilot/fix-code-comments-review

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the review feedback on the new transfer_admin tests in payment-distributor. The previous unauthorized-path test did not validate authorization behavior and included unused variables; the chain test comment/flow also did not reflect what was actually being asserted.

  • transfer_admin unauthorized-path test corrected

    • Reworked test_transfer_admin_fails_if_unauthorized to assert the contract’s authorization guard directly instead of relying on mock_all_auths() behavior.
    • Removed unused locals introduced in the original version (unauthorized_caller, intermediate result usage that was not asserted).
  • Admin-chain test assertion flow fixed

    • Updated test_transfer_admin_chain to execute the second transfer step and assert state transition to new_admin_2.
    • Reworded the misleading inline comment so the test intent matches actual behavior.
let result = distributor.try_transfer_admin(&new_admin);
assert_eq!(result, Err(Ok(Error::Unauthorized)));
assert_eq!(distributor.get_admin().unwrap(), original_admin);

Copilot AI changed the title [WIP] Fix code based on review comments Fix admin-transfer test coverage and remove ineffective auth assertions Jul 28, 2026
Copilot AI requested a review from chizzy192 July 28, 2026 14:05
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