Skip to content

chore: fix pr 596 - #645

Merged
p3ris0n merged 3 commits into
mainfrom
fix/ayomide-pr
Aug 4, 2026
Merged

chore: fix pr 596#645
p3ris0n merged 3 commits into
mainfrom
fix/ayomide-pr

Conversation

@p3ris0n

@p3ris0n p3ris0n commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

fix: resolve CI failures and bad merge conflicts from PR #596

Overview

This PR resolves multiple compilation errors and test panics introduced by bad merge conflict resolution in PR #596 (fix/test-461-464-472-476). The previous PR resulted in overlapping function definitions, missing imports, unclosed delimiters, and duplicate code.

Both bc-forge-admin and bc-forge-token contracts now compile cleanly, and all 137 tests (105 admin + 32 token) pass successfully.


Detailed Changes

1. Admin Contract (contracts/admin/src/lib.rs)

  • Restored missing import: Added back use super::*; inside mod tests, which was previously removed, causing resolution errors for Role and AdminError.
  • Fixed unclosed delimiter: Completed the test_non_privileged_caller_cannot_grant_pauser function body which had been left empty and nested into the adjacent test.
  • Removed duplicate module: Removed an erroneous mod proptest; declaration at the crate root (the correct declaration exists inside mod tests).
  • Cleaned up root-level proptest: Deleted the mistakenly added contracts/admin/src/proptest.rs, which had incorrect imports and outdated function signatures. Comprehensive fuzz tests are already maintained in contracts/admin/src/tests/proptest.rs.

2. Token Contract (contracts/token/src/lib.rs)

  • Merged duplicate functions: Replaced duplicate sets of pause and unpause functions. The older parameter-less versions were removed in favor of the new, properly closed RBAC-aware versions pause(env, caller) and unpause(env, caller) with correct error handling and event emission.

3. Token Tests (contracts/token/src/test.rs)

  • Fixed test boundaries: Added a missing closing brace } and #[test] attribute to properly close test_revoked_pauser_cannot_unpause.
  • Fixed function signatures: Corrected a revoke_role call that was missing its required caller parameter (&admin).
  • Removed stale tests: Deleted an outdated version of test_batch_transfer_while_paused_returns_error that used the deprecated no-parameter pause() API.
  • Resolved name collisions: Renamed a pre-existing test_non_pauser_cannot_pause to test_non_pauser_cannot_pause_as to prevent conflicting with the new test introduced in PR test: add tests for issues #461, #464, #472, #476 #596.
  • Fixed storage access panics: Wrapped 5 bare bc_forge_lifecycle::is_paused(&env) calls in env.as_contract(&client.address, || ...) to resolve "function is not accessible outside of a contract" panics that occur when testing Soroban instance storage.

Validation

  • cargo check passes for all contracts
  • Admin contract tests pass (cargo test -> 105 passed)
  • Token contract tests pass (cargo test -> 32 passed)
  • Fuzz tests (proptest) execute successfully

@p3ris0n
p3ris0n merged commit fd058fe into main Aug 4, 2026
3 checks passed
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.

1 participant