Skip to content

Add contract authorisation failure tests - #570

Merged
El-swaggerito merged 1 commit into
Axionvera:mainfrom
mrmoney10010-design:feat/savings-vault-auth-test-hardening
Jul 30, 2026
Merged

Add contract authorisation failure tests #570
El-swaggerito merged 1 commit into
Axionvera:mainfrom
mrmoney10010-design:feat/savings-vault-auth-test-hardening

Conversation

@mrmoney10010-design

Copy link
Copy Markdown
Contributor

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

… 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.
@El-swaggerito
El-swaggerito merged commit 5265b0a into Axionvera:main Jul 30, 2026
1 check 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.

Add contract authorisation failure tests

2 participants