Skip to content

Nametag mint tx data#4

Merged
martti007 merged 9 commits into
mainfrom
nametag-mint-tx-data
Sep 6, 2025
Merged

Nametag mint tx data#4
martti007 merged 9 commits into
mainfrom
nametag-mint-tx-data

Conversation

@martti007

Copy link
Copy Markdown
Contributor

No description provided.

@martti007
martti007 requested a review from Copilot September 6, 2025 10:15

This comment was marked as outdated.

@martti007
martti007 requested a review from Copilot September 6, 2025 18:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces dedicated classes and utilities for nametag token minting operations, replacing the static factory method approach with a more structured design.

  • Adds NametagMintTransactionData class for nametag-specific mint transaction data
  • Creates TokenUtils utility class with methods for minting both regular and nametag tokens
  • Adds comprehensive test classes for token splitting functionality

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/com/unicity/sdk/transaction/NametagMintTransactionData.java New class extending MintTransactionData specifically for nametag tokens
src/main/java/com/unicity/sdk/transaction/MintTransactionData.java Removes static createForNametag factory method
src/main/java/com/unicity/sdk/token/TokenId.java Adds null check to fromNameTag method
src/main/java/com/unicity/sdk/token/Token.java Adds new constructor overload for nametag tokens
src/test/java/com/unicity/sdk/utils/TokenUtils.java New utility class for token minting operations
src/test/java/com/unicity/sdk/common/split/TokenSplitTest.java New test class for token splitting functionality
src/test/java/com/unicity/sdk/functional/FunctionalTokenSplitTest.java Functional test extending the base split test
Multiple test files Updates to use NametagMintTransactionData instead of factory method

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

}

if (!inclusionProof.getAuthenticator().isPresent()) {
if (inclusionProof.getAuthenticator().isEmpty()) {

Copilot AI Sep 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from !isPresent() to isEmpty() suggests this might be a Collection or similar type. If this is an Optional, use !isPresent() for clarity and consistency with Optional API patterns.

Suggested change
if (inclusionProof.getAuthenticator().isEmpty()) {
if (!inclusionProof.getAuthenticator().isPresent()) {

Copilot uses AI. Check for mistakes.
Comment on lines +172 to +173
throw new Exception(String.format("Failed to submit burn commitment: %s",
response.getStatus()));

Copilot AI Sep 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message incorrectly refers to 'burn commitment' but this is in the context of a nametag transfer operation. The variable response should be nametagTransferResponse.getStatus() to match the actual operation being performed.

Suggested change
throw new Exception(String.format("Failed to submit burn commitment: %s",
response.getStatus()));
throw new Exception(String.format("Failed to submit nametag transfer commitment: %s",
nametagTransferResponse.getStatus()));

Copilot uses AI. Check for mistakes.
@martti007
martti007 merged commit 9c65d53 into main Sep 6, 2025
2 checks passed
@martti007
martti007 deleted the nametag-mint-tx-data branch September 6, 2025 18:51
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.

3 participants