chore: fix pr 596 - #645
Merged
Merged
Conversation
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.
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-adminandbc-forge-tokencontracts now compile cleanly, and all 137 tests (105 admin + 32 token) pass successfully.Detailed Changes
1. Admin Contract (
contracts/admin/src/lib.rs)use super::*;insidemod tests, which was previously removed, causing resolution errors forRoleandAdminError.test_non_privileged_caller_cannot_grant_pauserfunction body which had been left empty and nested into the adjacent test.mod proptest;declaration at the crate root (the correct declaration exists insidemod tests).contracts/admin/src/proptest.rs, which had incorrect imports and outdated function signatures. Comprehensive fuzz tests are already maintained incontracts/admin/src/tests/proptest.rs.2. Token Contract (
contracts/token/src/lib.rs)pauseandunpausefunctions. The older parameter-less versions were removed in favor of the new, properly closed RBAC-aware versionspause(env, caller)andunpause(env, caller)with correct error handling and event emission.3. Token Tests (
contracts/token/src/test.rs)}and#[test]attribute to properly closetest_revoked_pauser_cannot_unpause.revoke_rolecall that was missing its requiredcallerparameter (&admin).test_batch_transfer_while_paused_returns_errorthat used the deprecated no-parameterpause()API.test_non_pauser_cannot_pausetotest_non_pauser_cannot_pause_asto prevent conflicting with the new test introduced in PR test: add tests for issues #461, #464, #472, #476 #596.bc_forge_lifecycle::is_paused(&env)calls inenv.as_contract(&client.address, || ...)to resolve "function is not accessible outside of a contract" panics that occur when testing Soroban instance storage.Validation
cargo checkpasses for all contractscargo test-> 105 passed)cargo test-> 32 passed)