Skip to content

Conversation

martti007
Copy link
Contributor

No description provided.

@martti007 martti007 requested a review from Copilot September 29, 2025 18:42
Copy link
Contributor

@Copilot Copilot AI left a 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() and toCbor()/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.
Copy link
Preview

Copilot AI Sep 29, 2025

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.

Suggested change
* @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
Copy link
Preview

Copilot AI Sep 29, 2025

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.

Suggested change
* @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> {
Copy link
Preview

Copilot AI Sep 29, 2025

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> {
Copy link
Preview

Copilot AI Sep 29, 2025

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.

Comment on lines +171 to +179
/**
* 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(
Copy link
Preview

Copilot AI Sep 29, 2025

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.

@martti007 martti007 changed the title DRAFT Inline serialization Inline serialization Oct 7, 2025
@martti007 martti007 requested a review from MastaP October 7, 2025 15:52
@martti007 martti007 merged commit 69678eb into main Oct 7, 2025
2 checks passed
@martti007 martti007 deleted the inline-serialization branch October 7, 2025 19:59
@MastaP MastaP added this to Unicity Oct 8, 2025
@MastaP MastaP moved this to In Dev in Unicity Oct 8, 2025
@MastaP MastaP moved this from In Dev to Test in Unicity Oct 8, 2025
@martti007 martti007 linked an issue Oct 8, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Test
Development

Successfully merging this pull request may close these issues.

Use jackson only internally for serializing
2 participants