refactor: remove dead code and commented-out tests from escrow and ev…#446
Merged
Xhristin3 merged 4 commits intoApr 27, 2026
Merged
Conversation
|
@Oluwasuyi-Timilehin Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…tification_events and provenance modules
Xhristin3
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#closes #366
PR Title
chore: remove dead code and unused imports for #366PR Description
Summary
This PR fully completes issue
#366by performing a focused codebase cleanup in the TeachLink contract:The scope is cleanup and stability only; no intentional feature changes were introduced.
Context
During validation, multiple integration tests in
test_module_interactions.rsfailed with Soroban auth errors (Error(Auth, ExistingValue)).Root cause was duplicate authorization in role checks (auth required both at caller and inside role-check helper).
This PR includes the minimal fix to preserve behavior while making tests pass reliably.
What Changed
1) Dead Code Removal
contracts/teachlink/src/errors.rs:BridgeResult<T>EscrowResult<T>RewardsResult<T>CommonResult<T>contracts/teachlink/src/provenance.rs:get_creatorget_all_ownersprovenance.2) Unused Imports Cleanup
contracts/teachlink/src/events.rs:PacketStatusSwapStatus3) Commented Code Cleanup
contracts/teachlink/src/events.rs.contracts/teachlink/src/repository/escrow_repository.rs.contracts/teachlink/src/repository/mod.rs.contracts/teachlink/src/notification_events.rs.4) Auth Stability Fix Found During Verification
contracts/teachlink/src/access_control.rs:require_auth()fromcheck_role(...)to avoid duplicate auth in the same frame.caller.require_auth()in:grant_role(...)revoke_role(...)This preserves authorization guarantees while preventing
Auth ExistingValuepanics.Files Changed
contracts/teachlink/src/errors.rscontracts/teachlink/src/events.rscontracts/teachlink/src/repository/escrow_repository.rscontracts/teachlink/src/repository/mod.rscontracts/teachlink/src/provenance.rscontracts/teachlink/src/notification_events.rscontracts/teachlink/src/access_control.rsPR_DESCRIPTION.md(updated for current PR narrative)Why This Matters
Acceptance Criteria Mapping (
#366)Validation / Test Evidence
Targeted failing tests (now passing)
Previously failing tests:
test_chain_specific_pause_isolationtest_emergency_pause_and_resume_state_managementtest_liquidity_pool_affects_bridge_feetest_emergency_state_alongside_packet_operationstest_error_propagation_across_modulestest_multichain_config_and_packet_workflowtest_notification_alongside_bridge_operationstest_proposal_vote_then_bridge_completionAfter auth fix in
access_control, all above were re-run and passed.Suggested verification commands
Risk Assessment
Breaking Changes
None intended.
Notes for Reviewers
access_controlauth semantics (check_role,grant_role,revoke_role) and integration-test behavior around emergency + bridge flows.#closes