Skip to content

Commit

Permalink
Update Javadoc and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sappenin committed Jun 10, 2024
1 parent c123274 commit e5a77dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
import java.io.IOException;

/**
* Custom Jackson deserializer for {@link XrpCurrencyAmount}s.
* Custom Jackson deserializer for {@link XrpCurrencyAmount} instances found in {@link SetFee}.
* <p>
* Before the <a href="https://xrpl.org/resources/known-amendments/#xrpfees">XRPFees amendment</a>, a {@link SetFee}
* transaction serializes its `BaseFee` to a hex string. After the
* <a href="https://xrpl.org/resources/known-amendments/#xrpfees">XRPFees amendment</a>, a {@link SetFee} transaction
* serializes its `BaseFee` to a decimal string.
*
* @see "https://xrpl.org/resources/known-amendments/#xrpfees"
*/
public class BaseFeeDropsDeserializer extends StdDeserializer<XrpCurrencyAmount> {

Expand All @@ -42,7 +49,7 @@ public BaseFeeDropsDeserializer() {

@Override
public XrpCurrencyAmount deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException {
// Pre-XRPFees SetFee transactions serialize `BaseFee` to a hex string. Post XRPFees SetFee transactions
// Pre-XRPFees, SetFee transactions serialize `BaseFee` to a hex string. Post XRPFees SetFee transactions
// have a `BaseFeeDrops` field which is a decimal string.
if (jsonParser.currentName().equals("BaseFee")) {
return XrpCurrencyAmount.of(UnsignedLong.valueOf(jsonParser.getText(), 16));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ static ImmutableSetFee.Builder builder() {
*
* @return A hex {@link String} baseFee value.
*
* @deprecated Prefer {@link #baseFeeDrops()} over this field.
* @deprecated Prefer {@link #baseFeeDrops()} over this field because the XRPFees ammendment now serializes this
* object's base fee into XRP drops.
*/
@Value.Default
@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

import java.util.Optional;

/**
* Unit tests for {@link SetFee}.
*/
public class SetFeeTest extends AbstractJsonTest {

@Test
Expand Down

0 comments on commit e5a77dd

Please sign in to comment.