Skip to content

Pocket pay contract 27 - #521

Merged
El-swaggerito merged 7 commits into
Axionvera:mainfrom
abbarrh01:pocket-pay-contract-27
Jul 28, 2026
Merged

Pocket pay contract 27#521
El-swaggerito merged 7 commits into
Axionvera:mainfrom
abbarrh01:pocket-pay-contract-27

Conversation

@abbarrh01

Copy link
Copy Markdown
Contributor

Closes #489 # Pull Request

Issue Reference

Closes #


Summary

Contract Functions Changed

Function Change type (added / modified / removed) Notes

Tests Added or Updated

  • Happy-path tests added/updated
  • Failure and boundary-condition tests added/updated
  • Test naming follows the convention in docs/testing.md
  • docs/test-coverage.md updated to reflect new or changed tests

Security Considerations

Security checklist (contract changes only)

  • Balance & accounting invariants preserved — see docs/accounting-invariants.md
  • Lock state and timed-operation rules unchanged (or documented if changed)
  • Token transfer atomicity maintained — see docs/atomicity.md
  • require_auth() called on the correct address in every state-changing function
  • Storage layout change checklist followed (if applicable) — see docs/storage-change-checklist.md
  • Event backward-compatibility policy followed (if applicable) — see docs/event-compatibility-policy.md
  • New error codes use ContractError variants with panic_with_error!, not bare panic!
  • No secrets, private keys, or credentials committed or logged

Commands Run

cargo fmt --check
cargo clippy --tests -- -D warnings
cargo test --workspace
  • cargo fmt --check — passed
  • cargo clippy --tests -- -D warnings — passed
  • cargo test --workspace — passed

CI Status

  • All CI checks pass on this branch

Acceptance Criteria Coverage

Criterion Met? Notes

add a new test case mirroring the existing lock withdrawal test, verifying all vault state remains unchanged when a regular withdraw fails due to SAC token transfer failure
… docs

Add a new `contract_error_codes` test module in the savings vault test suite that validates every ContractError variant panics with its assigned u32 numeric discriminant code. Overhaul the `sdk-error-mapping-guide.md` and `error-codes.md` documentation files to formalize the public error code interface, including categorized error ranges, client-side handling best practices, and reference implementation examples for SDKs and mobile apps.
Create new codebase analysis documents covering repository structure, workflows, and quality/debt assessment. Restructure comprehensive-analysis.md as the main entry point for the analysis package. Update the audit evidence index with the new storage audit map entry, remove the duplicate old vault storage audit map document, and update the last updated date for the audit documentation.
Add and update project documentation:
- Add CI failure debugging link to CONTRIBUTING.md
- Add new guide reference and TOC entry to README.md
- Create new docs/reproducing-test-failures.md with steps to reproduce and debug test failures, including proptest seeds and snapshot mismatches
Create the full `docs/contribution-quality-gate.md` document with comprehensive PR quality checklists covering implementation, testing, documentation, and CI/CD requirements. Add a GitHub pull request template that requires contributors to confirm compliance with the quality gate. Update CONTRIBUTING.md to state that PRs must pass the gate before approval, and add references to the quality gate in README.md.
Add new `negative_paths` test module covering unauthorized access, invalid inputs, early withdrawals, uninitialized contract calls, and state consistency after failed operations.

Add dedicated `test_withdraw_lock_emits_event` test to validate withdraw_lock event emission, closing the previously documented test coverage gap for this event.

Update `docs/test-coverage.md` to fully document all covered test cases and organize the negative path test categories.
@El-swaggerito
El-swaggerito merged commit ecb268f into Axionvera:main Jul 28, 2026
1 check passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Jul 28, 2026
6 tasks
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 Savings Vault negative-path tests

2 participants