-
Notifications
You must be signed in to change notification settings - Fork 0
Inline serialization #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements inline serialization support for the Unicity SDK, replacing the previous separate JSON serializer classes with inline annotations on domain objects. The changes enable JSON and CBOR serialization directly through the objects themselves.
- Inline serialization implementation using Jackson annotations
- Removal of separate JSON serializer/deserializer classes
- Direct
toJson()
/fromJson()
andtoCbor()
/fromCbor()
methods added to domain objects - Cleanup of removed files and utility classes
Reviewed Changes
Copilot reviewed 251 out of 251 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
Various test files | Refactored test code to use new inline serialization methods and updated imports |
Domain model classes | Added inline JSON/CBOR serialization annotations and methods |
Serializer classes (removed) | Removed separate serializer/deserializer classes in favor of inline approach |
Transaction classes | Restructured transaction hierarchy with inline serialization support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
/** | ||
* Token representation. | ||
* | ||
* @param <R> mint transaction reason for current token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class-level documentation should explain the generic parameter R and its purpose in the token representation.
* @param <R> mint transaction reason for current token. | |
* <p>This class represents a token whose behavior and metadata are parameterized by the type {@code R}, | |
* which extends {@link MintTransactionReason}. The generic parameter {@code R} specifies the reason | |
* for the mint transaction associated with this token, allowing different token types to encode | |
* domain-specific information about their creation and purpose. This enables the token to be flexible | |
* and extensible for various use cases, such as fungible, non-fungible, or custom tokens, each with | |
* their own minting logic and reason codes.</p> | |
* | |
* @param <R> the type of mint transaction reason associated with this token, used to parameterize | |
* the genesis mint transaction and provide type safety for token creation and management. |
Copilot uses AI. Check for mistakes.
/** | ||
* Mint transaction. | ||
* | ||
* @param <R> mint reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic parameter R should be documented at the class level to explain its role in mint transactions.
* @param <R> mint reason | |
* @param <R> the type of mint reason, which must extend {@link MintTransactionReason}. | |
* This parameter specifies the reason for the mint transaction, allowing | |
* different types of minting operations to be represented and processed. | |
* The reason is used to provide context and details about why the mint | |
* transaction is being performed, and is stored in the transaction data. |
Copilot uses AI. Check for mistakes.
* | ||
* @param <ContextT> the type of context used for verification | ||
*/ | ||
public abstract class CompositeVerificationRule<ContextT> extends VerificationRule<ContextT> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class already has comprehensive documentation, but the generic parameter ContextT should be documented in the @param tag format at the class level.
Copilot uses AI. Check for mistakes.
* | ||
* @param <ContextT> verification context | ||
*/ | ||
public abstract class VerificationRule<ContextT> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic parameter ContextT should be documented using proper JavaDoc @param tag at the class level instead of just in the class comment.
Copilot uses AI. Check for mistakes.
/** | ||
* Create split mint commitments after burn transaction is received. | ||
* | ||
* @param trustBase trust base for burn transaction verification | ||
* @param burnTransaction burn transaction | ||
* @return list of mint commitments for sending to unicity service | ||
* @throws VerificationException if token verification fails | ||
*/ | ||
public List<MintCommitment<SplitMintReason>> createSplitMintCommitments( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method documentation should specify that the burn transaction must be a successful transaction that has been included in the blockchain before calling this method.
Copilot uses AI. Check for mistakes.
No description provided.