Skip to content
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

DRAFT: MPT Support #558

Draft
wants to merge 15 commits into
base: mpt-amounts
Choose a base branch
from
Draft

DRAFT: MPT Support #558

wants to merge 15 commits into from

Conversation

nkramer44
Copy link
Collaborator

No description provided.

/**
* Constant {@link MpTokenIssuanceFlags} for the {@code lsfMPTLocked} account flag.
*/
public static final MpTokenIssuanceFlags LOCKED = new MpTokenIssuanceFlags(0x00000001);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's discuss this one in particular.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"this one" meaning LOCKED or MpTokenIssuanceFlags having an of(long) method?


@Override
public MpTokenIssuanceId deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException {
return MpTokenIssuanceId.of(jsonParser.getText());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this value expected to be in HEX? Just thinking out loud if MpTokenIssuanceId should be represented as a String in Java.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe so? Isn't it the hash of the issuer address concatenated with the sequence?

/**
* Custom Jackson serializer for {@link MpTokenObjectAmount}s.
*/
public class MpTokenObjectAmountSerializer extends StdScalarSerializer<MpTokenObjectAmount> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clarify what this object is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is for MPT amounts that aren't MpTokenAmounts, ie for sfMaximumAmount, sfOutstandingAmount and sfMPTAmount. I have a separate type for all of these because they're UInt64s, but are serialized in JSON as base 10 rather than base 16.

To your comment below about if this could be replaced by MpTokenAmount, I don't see how that's possible, as MpTokenAmount holds the issuance ID as well as the amount. In the places MpTokenObjectAmounts show up, there isn't necessarily an issuance ID present

Optional<AssetScale> assetScale();

@JsonProperty("MaximumAmount")
Optional<MpTokenObjectAmount> maximumAmount();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any world where MpTokenObjectAmount can be replaced by MpTokenAmount (esp if this suggestion is taken)?

($) -> fail()
);

void handleWithNulls() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note: Still need handleMpt, mapMpt, and maxMpt.

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.

2 participants