feat: authorization validation, storage migration, TTL strategy, and shared test utils#360
Open
zainabbaba31-source wants to merge 1 commit into
Conversation
…shared test utils - bridgelet-org#147: Enhance SweepController authorization validation with explicit format checks for Ed25519 signature (64 bytes) and public key (32 bytes). Added validate_signer_key() and validate_signature_length() helpers. Documented the 5-step authorization validation flow with clear error codes for each failure mode. - bridgelet-org#146: Establish storage migration pattern. Created contracts/sweep_controller/src/migration.rs with StorageVersion type, migrate() function that reads stored version and runs pending migrations, and get_storage_version()/set_storage_version() helpers. Added migrate() and get_version() entry points to SweepController. Added StorageVersion key to DataKey enum. - bridgelet-org#145: Define storage TTL strategy. Created docs/storage-ttl-strategy.md classifying all storage entries as instance/persistent/temporary with rationale. All bridgelet-core entries use instance storage (no manual TTL management needed). Documented future TTL extension pattern for persistent storage if added later. - bridgelet-org#140: Create shared test utilities. Created contracts/shared/src/test_utils.rs with setup_env(), create_test_accounts(), random_address(), address_pair(), address_triple(), fixed_bytes_32(), zero_signature_64(), and seeded_bytes_32() helpers. Includes unit tests. Import via bridgelet_shared::test_utils::* in both contracts' test modules. Closes bridgelet-org#147 Closes bridgelet-org#146 Closes bridgelet-org#145 Closes bridgelet-org#140
|
@zainabbaba31-source 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
Implements four improvements for authorization, storage management, and testing:
#147 - SweepController authorization validation
validate_signer_key()andvalidate_signature_length()helpers.#146 - Storage migration pattern
contracts/sweep_controller/src/migration.rswithStorageVersiontype andmigrate()function that reads stored version and runs pending migrations in order.migrate()andget_version()entry points to SweepController.StorageVersionkey to DataKey enum. Migrations are idempotent and safe to call repeatedly.#145 - Storage TTL strategy
docs/storage-ttl-strategy.mdclassifying all storage entries as instance/persistent/temporary with rationale.#140 - Shared test utilities
contracts/shared/src/test_utils.rswithsetup_env(),create_test_accounts(),random_address(),address_pair(),address_triple(),fixed_bytes_32(),zero_signature_64(), andseeded_bytes_32()helpers.bridgelet_shared::test_utils::*in both contracts test modules.Closes #147
Closes #146
Closes #145
Closes #140