π Description
Write dedicated unit tests for contract_core/auth.rs β the shared auth middleware used by every write function in the contract.
β
Requirements
In gateway-contract/contracts/core_contract/src/test.rs:
test_require_owner_succeeds_for_owner β owner calls a write function, no panic
test_require_owner_panics_for_non_owner β non-owner caller panics with auth error
test_require_owner_panics_if_uninitialized β calling before init panics with "Contract not initialized"
π― Acceptance Criteria
π Expected files to change/structure
gateway-contract/contracts/core_contract/src/test.rs β new file
πΏ Branch: test/contract-auth | Priority: MED | Difficulty: β easy
π Description
Write dedicated unit tests for
contract_core/auth.rsβ the shared auth middleware used by every write function in the contract.β Requirements
In
gateway-contract/contracts/core_contract/src/test.rs:test_require_owner_succeeds_for_ownerβ owner calls a write function, no panictest_require_owner_panics_for_non_ownerβ non-owner caller panics with auth errortest_require_owner_panics_if_uninitializedβ calling beforeinitpanics with "Contract not initialized"π― Acceptance Criteria
cargo testgreenenv.mock_all_auths()where appropriateπ Expected files to change/structure
gateway-contract/contracts/core_contract/src/test.rsβ new file