Nametag mint tx data#4
Conversation
There was a problem hiding this comment.
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
NametagMintTransactionDataclass for nametag-specific mint transaction data - Creates
TokenUtilsutility 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()) { |
There was a problem hiding this comment.
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.
| if (inclusionProof.getAuthenticator().isEmpty()) { | |
| if (!inclusionProof.getAuthenticator().isPresent()) { |
| throw new Exception(String.format("Failed to submit burn commitment: %s", | ||
| response.getStatus())); |
There was a problem hiding this comment.
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.
| 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())); |
No description provided.