refactor(#85): split lib.rs into types, errors, and contract modules#232
Merged
fejilaup-cloud merged 2 commits intoAtomicIP:mainfrom Apr 4, 2026
Merged
Conversation
|
@cybermax4200 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! 🚀 |
4becd69 to
748ee47
Compare
…modules - Extract ContractError into errors.rs for both contracts - Extract contracttype structs/enums and LEDGER_BUMP into types.rs for both contracts - Clean up lib.rs to contain only module declarations, re-exports, and contractimpl - Declare all test files as cfg(test) modules in lib.rs - All 47 tests pass (23 atomic_swap + 24 ip_registry)
748ee47 to
896a33c
Compare
Contributor
Author
|
Merge conflict is resolved please you can now merge |
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.
refactor(#85): split lib.rs into types, errors, and contract modules
Both
lib.rs
and
lib.rs
were mixing type definitions, storage keys, error enums, contract logic, and tests in a single file. This PR splits each into focused modules for maintainability.
Changes
For both contracts:
errors.rs — ContractError #[repr(u32)] enum
types.rs — all #[contracttype] structs/enums and LEDGER_BUMP constant
lib.rs — now contains only module declarations, pub use re-exports, and the #[contractimpl] block
All test files declared as #[cfg(test)] mod ... in lib.rs
Notes
Pure structural refactor — no logic, ABI, or on-chain storage changes
Public API is unchanged; all types remain accessible from the crate root via re-exports
47 tests pass (23 atomic_swap + 24 ip_registry)
Closes #85