Skip to content

refactor(#85): split lib.rs into types, errors, and contract modules#232

Merged
fejilaup-cloud merged 2 commits intoAtomicIP:mainfrom
cybermax4200:refactor/85-split-lib-rs-into-modules
Apr 4, 2026
Merged

refactor(#85): split lib.rs into types, errors, and contract modules#232
fejilaup-cloud merged 2 commits intoAtomicIP:mainfrom
cybermax4200:refactor/85-split-lib-rs-into-modules

Conversation

@cybermax4200
Copy link
Copy Markdown
Contributor

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

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@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! 🚀

Learn more about application limits

@cybermax4200 cybermax4200 force-pushed the refactor/85-split-lib-rs-into-modules branch from 4becd69 to 748ee47 Compare April 1, 2026 05:14
…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)
@cybermax4200 cybermax4200 force-pushed the refactor/85-split-lib-rs-into-modules branch from 748ee47 to 896a33c Compare April 1, 2026 05:20
@cybermax4200
Copy link
Copy Markdown
Contributor Author

cybermax4200 commented Apr 1, 2026

Merge conflict is resolved please you can now merge

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.

Refactor: split lib.rs into types, errors, and contract modules

2 participants