Skip to content

Conversation

Radiokot
Copy link
Member

Purpose

Make TokenOperations deserializable from CBOR.

Changes

  • Update the version to 11.1.0-SNAPSHOT
  • Update Jackson to 2.20.0
  • Make all the inners of TransferTokenOperation deserializable from CBOR
  • Get rid of custom serialization of token operations, configure it with Jackson annotations instead
  • Add more serialization tests, in particular for lists

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

@Radiokot Radiokot requested review from Copilot and squirer October 17, 2025 13:25
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 enables CBOR deserialization for TokenOperations by refactoring the serialization approach from custom code to Jackson annotations and adding comprehensive deserialization support.

Key Changes:

  • Upgraded Jackson dependency from 2.19.1 to 2.20.0
  • Replaced custom serialization code with Jackson annotation-based configuration for token operations
  • Added deserialization support for TokenOperation, CborMemo, TaggedTokenHolderAccount, and TokenOperationAmount

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pom.xml Updated project version to 11.1.0-SNAPSHOT and Jackson to 2.20.0
TokenOperation.java Replaced custom serializer with @JsonTypeInfo and @JsonSubTypes annotations
TransferTokenOperation.java Added @Jacksonized, @EqualsAndHashCode, and removed custom getBody() method
TokenOperationAmount.java Added @JsonCreator constructor and replaced custom serializer with StdSerializer
CborMemo.java Added CborDeserializer class and equals/hashCode methods
TaggedTokenHolderAccount.java Added CborDeserializer class and equals/hashCode methods
UInt64.java Simplified CBOR serialization using writeNumberUnsigned()
UInt32.java Added @JsonCreator constructor and simplified CBOR serialization
TokenUpdate.java Added getOperationsSerialized() method and operationsSerialized() builder method
CborMapper.java Removed custom writeBytesAsValue() method and updated configuration
Test files Added deserialization tests and updated expected values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant