Fix: [CONTRACT] Implement Common Types Module#337
Merged
truthixify merged 1 commit intoDistinctCodes:mainfrom Oct 3, 2025
Merged
Conversation
|
@Georgechisom is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
The fix implements a comprehensive shared types system for the AssetsUp contracts, providing consistent and reusable enums across all contract modules with proper Soroban serialization support.
Features Added
New Shared Enums
AssetType- Distinguishes between Physical and Digital assetsAssetStatus- Tracks asset lifecycle (Active, InMaintenance, Disposed)ActionType- Audit trail actions (Procured, Transferred, Maintained, Disposed, CheckedIn, CheckedOut)PlanType- Subscription tiers (Basic, Pro, Enterprise)SubscriptionStatus- Subscription states (Active, Expired, Cancelled)Technical Implementation
#[contracttype]for Soroban serialization#[derive(Clone, Debug, Eq, PartialEq)]traits///commentspub use types::*in lib.rsBreaking Changes
AssetTypefrom specific variants (IT, Furniture) to generic (Physical, Digital)Testing
Files Modified
src/types.rs- Enhanced with all required enums and documentationsrc/lib.rs- Added public re-export of typessrc/tests/types.rs- Comprehensive test coveragesrc/tests/mod.rs- Added types test modulesrc/tests/asset.rs- Updated for new AssetType variantsVerification
cargo build- Clean compilationcargo test- All tests passing (10/10)cargo clippy- No linting issuesBenefits
Closes #244