981 add unauthorized caller tests - #1311
Merged
Merged
Conversation
… tests - Add set_paused(paused: bool) admin-protected function - Requires caller to be the admin - Returns NotAuthorized error for unauthorized callers - Can only be called after initialize - Add is_paused() function to retrieve paused status - Add Paused data key to DataKey enum - Initialize paused status to false during initialization - Add comprehensive unauthorized caller revert tests: - test_set_paused_admin_authorization: verifies admin can set paused - test_set_paused_unauthorized_caller_revert: verifies unauthorized caller gets NotAuthorized - test_set_paused_multiple_unauthorized_callers: verifies consistent rejection - test_set_paused_admin_can_toggle: verifies admin can toggle state multiple times Fixes MyFanss#981
## Description Improve documentation for the `myfans-lib` Soroban contract by documenting all public functions and modules in the contract README. ## Changes - **Document SubscriptionStatus enum**: All variants with their properties and use cases - **Document ContentType enum**: Classification of content access types - **Document MyfansError enum**: All error variants with descriptions - **Document error_codes module**: All sub-modules and comprehensive usage examples - **Document test_fixtures module**: Details on the testutils feature - **Add Getting Started guide**: Installation and basic usage examples - **Add error handling example**: Shows how to work with error codes - **Update features list**: Comprehensive list of all capabilities ## How to test The documentation is comprehensive and includes code examples that can be copy-pasted and compiled. ## Acceptance Criteria - ✅ All public types documented - ✅ All public modules documented - ✅ Usage examples provided - ✅ Error handling patterns explained - ✅ Code examples are accurate and compile ## Fixes Closes MyFanss#973
|
@ndii-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
Changes
Test Plan
Automated tests added or updated
backend/src/**/*.spec.ts) — service/guard/decorator logic in isolationbackend/test/**/*.e2e-spec.ts) — HTTP round-trips with mocked infrastructurefrontend/src/**/*.test.{ts,tsx}) — React component behaviourfrontend/e2e/**/*.spec.ts) — Playwright browser flowscontract/) — Soroban/Rust unit tests viacargo testHow to run the tests locally
Manual verification checklist
cd backend && npm run lint/cd frontend && npm run lintRelated issues
Notes for reviewers