Add contract authorisation failure tests - #570
Merged
El-swaggerito merged 1 commit intoJul 30, 2026
Merged
Conversation
… schemas
- Fix transfer_admin event to emit symbol_short!("xferadmin") matching
the documented event schema and client indexer expectations
- Fix test_withdraw_lock_emits_event assertions to use the correct
long-form Symbol("withdraw_lock") topic and (u64, i128) payload schema
- Fix test_different_token_addresses_are_each_stored_correctly by
offsetting deterministic address generation across independent envs
- Remove outdated should_panic(expected=...) strings from re-init tests
that no longer match the ContractError panic message format
- Add env.mock_auths(&[]) in invariant_checklist_examples authorization
tests to correctly simulate missing user signatures
- Expand docs/authorisation-rules.md to document all 12 entry points
including withdraw_lock, extend_lock, pause, unpause, transfer_admin
All 467 tests pass. Formatting verified with cargo fmt.
6 tasks
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.
Difficulty: Expert
Type: Test
Summary
Add tests for authorisation failure cases across Savings Vault operations.
Current Behaviour
Authorisation failures may not be covered consistently for all mutating contract methods.
closes #557