-
Notifications
You must be signed in to change notification settings - Fork 71
Add binary codec support for MPT amounts and STHash192 #556
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8e83137
checkpoint
nkramer44 21783ff
fix definitions and AmountType.fromParser
nkramer44 787cea8
checkstyle
nkramer44 9f96789
refactor
nkramer44 1ec7628
fix tests and checkstyle
nkramer44 8828d84
cleanup
nkramer44 73e282e
negative MPT amounts, other formatting feedback
nkramer44 f10521f
make Hash192 a UInt and rename
nkramer44 25d1e1d
correct definitions.json
nkramer44 b8911c0
Merge branch 'main' into mpt-amounts
nkramer44 ae996c6
pr feedback
nkramer44 4133b2e
Merge branch 'main' of https://github.com/XRPLF/xrpl4j into mpt-amounts
nkramer44 b34cd1e
rename MPTokenHolder to Holder
nkramer44 c2b8e33
Merge branch 'main' into mpt-amounts
nkramer44 9585480
PR feedback
nkramer44 efd4ee0
fix checktyle
nkramer44 77ccea0
update definitions.json
nkramer44 e7e6b69
rename MptAmount to MptCurrencyAmount
nkramer44 ff5faf4
Merge branch 'main' into mpt-amounts
sappenin 5392be5
Add MPT Support (#558)
nkramer44 79a9729
Merge branch 'main' into mpt-amounts
sappenin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/codec/binary/types/UInt192Type.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package org.xrpl.xrpl4j.codec.binary.types; | ||
|
|
||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray; | ||
| import org.xrpl.xrpl4j.codec.binary.serdes.BinaryParser; | ||
|
|
||
| /** | ||
| * Codec for XRPL UInt192 type. | ||
| */ | ||
| public class UInt192Type extends UIntType<UInt192Type> { | ||
|
|
||
| public static final int WIDTH_BYTES = 24; | ||
|
|
||
| public UInt192Type() { | ||
| this(UnsignedByteArray.ofSize(WIDTH_BYTES)); | ||
| } | ||
|
|
||
| public UInt192Type(UnsignedByteArray list) { | ||
| super(list, WIDTH_BYTES * 8); | ||
| } | ||
|
|
||
| @Override | ||
| public UInt192Type fromParser(BinaryParser parser) { | ||
| return new UInt192Type(parser.read(WIDTH_BYTES)); | ||
| } | ||
|
|
||
| @Override | ||
| public UInt192Type fromJson(JsonNode node) { | ||
| return new UInt192Type(UnsignedByteArray.fromHex(node.asText())); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.