From b7bb7499149f2299584c35297c08527bda109259 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Thu, 13 Feb 2025 13:35:33 -0700 Subject: [PATCH 01/13] WIP --- .../modules/TransactionDeserializer.java | 41 +- .../modules/TransactionSerializer.java | 77 + .../UnlModifyTransactionSerializer.java | 73 + .../model/jackson/modules/Xrpl4jModule.java | 8 +- .../model/transactions/AccountDelete.java | 5 + .../xrpl4j/model/transactions/AccountSet.java | 6 + .../xrpl4j/model/transactions/AmmBid.java | 5 + .../xrpl4j/model/transactions/AmmCreate.java | 5 + .../xrpl4j/model/transactions/AmmDelete.java | 5 + .../xrpl4j/model/transactions/AmmDeposit.java | 6 + .../xrpl4j/model/transactions/AmmVote.java | 8 + .../model/transactions/AmmWithdraw.java | 5 + .../model/transactions/CheckCancel.java | 6 + .../xrpl4j/model/transactions/CheckCash.java | 37 +- .../model/transactions/CheckCreate.java | 6 + .../xrpl4j/model/transactions/Clawback.java | 7 +- .../model/transactions/DepositPreAuth.java | 7 + .../xrpl4j/model/transactions/DidDelete.java | 7 +- .../xrpl4j/model/transactions/DidSet.java | 7 +- .../model/transactions/EnableAmendment.java | 17 +- .../model/transactions/EscrowCancel.java | 6 + .../model/transactions/EscrowCreate.java | 7 + .../model/transactions/EscrowFinish.java | 6 + .../transactions/NfTokenAcceptOffer.java | 5 + .../model/transactions/NfTokenBurn.java | 7 + .../transactions/NfTokenCancelOffer.java | 7 + .../transactions/NfTokenCreateOffer.java | 7 + .../model/transactions/NfTokenMint.java | 7 + .../model/transactions/OfferCancel.java | 6 + .../model/transactions/OfferCreate.java | 6 + .../model/transactions/OracleDelete.java | 6 + .../xrpl4j/model/transactions/OracleSet.java | 7 + .../xrpl4j/model/transactions/Payment.java | 21 +- .../transactions/PaymentChannelClaim.java | 39 +- .../transactions/PaymentChannelCreate.java | 10 +- .../transactions/PaymentChannelFund.java | 7 + .../xrpl4j/model/transactions/SetFee.java | 6 + .../model/transactions/SetRegularKey.java | 6 + .../model/transactions/SignerListSet.java | 6 + .../model/transactions/TicketCreate.java | 7 + .../model/transactions/Transaction.java | 22 +- .../xrpl4j/model/transactions/TrustSet.java | 6 + .../transactions/UnknownTransaction.java | 4 +- .../xrpl4j/model/transactions/UnlModify.java | 87 +- .../XChainAccountCreateCommit.java | 6 + .../XChainAddAccountCreateAttestation.java | 6 + .../XChainAddClaimAttestation.java | 6 + .../model/transactions/XChainClaim.java | 6 + .../model/transactions/XChainCommit.java | 6 + .../transactions/XChainCreateBridge.java | 6 + .../transactions/XChainCreateClaimId.java | 6 + .../transactions/XChainModifyBridge.java | 9 +- .../NegativeTransactionMetadataTest.java | 69 +- .../transactions/UnknownTransactionTest.java | 7 +- .../transactions/json/UnlModifyJsonTests.java | 169 +- .../ledger-result-94084608.json | 10160 ++++++++++++++++ 56 files changed, 10989 insertions(+), 103 deletions(-) create mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java create mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java create mode 100644 xrpl4j-core/src/test/resources/special-object-ledgers/ledger-result-94084608.json diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index c4cb3a483..b11cdae4d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,12 +27,14 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.xrpl.xrpl4j.model.transactions.Transaction; import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.UnknownTransaction; +import org.xrpl.xrpl4j.model.transactions.UnlModify; import java.io.IOException; /** - * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type - * based on the TransactionType JSON field. + * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the + * TransactionType JSON field. */ public class TransactionDeserializer extends StdDeserializer { @@ -49,6 +51,35 @@ public Transaction deserialize(JsonParser jsonParser, DeserializationContext ctx ObjectNode objectNode = objectMapper.readTree(jsonParser); TransactionType transactionType = TransactionType.forValue(objectNode.get("TransactionType").asText()); - return objectMapper.treeToValue(objectNode, Transaction.typeMap.inverse().get(transactionType)); + Class transactionTypeClass = Transaction.typeMap.inverse().get(transactionType); + + // If the transaction is of type `UnknownTransaction`, the `TransactionType` property must _not_ be removed. Thi + // is so that the derived functions related to `TransactionType` in that class operate properly. However, for all + // _other_ transaction types, the `TransactionType` property _must_ be removed so that it doesn't errantly show up + // in the `unknownTransactionType` map. This approach works because every subclass of `Transaction` has a derived + // Java method that specifies the type (thus allowing us to ignore this fiele in the general case). + if (!UnknownTransaction.class.isAssignableFrom(transactionTypeClass)) { + objectNode.remove("TransactionType"); + } + + // If the transaction is of type `UnlModify`, then remove the `Account` property. This is because the JSON returned + // by the rippled/clio API v1 has a bug where the account value is often an empty string. For this particular + // transaction type (i.e., `UnlModify`) the Java value for the account is always set to ACCOUNT_ZERO via a default + // method, so we remove this value from the JSON before deserialization because (1) it's not needed (the default + // method handles population in Java) and (2) if not removed, this field will end up in the `unknownFields` + // property, which is incorrect. + if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { +// if (objectNode.get("Account").isEmpty()) { + if (objectNode.has("Account")) { + objectNode.remove("Account"); + } + } + + // TODO: Verify, and document if keeping. + if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { + objectNode.remove("Account"); + } + + return objectMapper.treeToValue(objectNode, transactionTypeClass); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java new file mode 100644 index 000000000..9b2366356 --- /dev/null +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java @@ -0,0 +1,77 @@ +package org.xrpl.xrpl4j.model.jackson.modules; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.xrpl.xrpl4j.model.jackson.ObjectMapperFactory; +import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.UnknownTransaction; +import org.xrpl.xrpl4j.model.transactions.UnlModify; + +import java.io.IOException; + +/** + * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the + * TransactionType JSON field. + */ +public class TransactionSerializer { //} extends StdSerializer { +// +// /** +// * No-args constructor. +// */ +// protected TransactionSerializer() { +// super(Transaction.class); +// } +// +// @Override +// public void serialize(Transaction value, JsonGenerator gen, SerializerProvider provider) throws IOException { +// +// if (UnlModify.class.isAssignableFrom(value.getClass())) { +// gen.writeStartObject(); +// +// // 1. Delegate to Jackson for the existing fields: +// provider.defaultSerializeValue(value, gen); // Delegate to Jackson +// +//// ObjectMapperFactory.create().writeValue(gen, value); +// +// // Serialize the existing fields (delegate to Jackson's default if possible) +//// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields +// +// // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show +// // up during serialization. +// gen.writeFieldName("Account"); +// gen.writeString(value.account().value()); +// +// gen.writeEndObject(); +// } else { +// // Rely on Jackson's automatic serialization +// gen.writeObject(value); +// } +// } +} diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java new file mode 100644 index 000000000..ddc1abf8d --- /dev/null +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java @@ -0,0 +1,73 @@ +package org.xrpl.xrpl4j.model.jackson.modules; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.UnlModify; + +import java.io.IOException; + +/** + * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the + * TransactionType JSON field. + */ +public class UnlModifyTransactionSerializer extends StdSerializer { + + /** + * No-args constructor. + */ + protected UnlModifyTransactionSerializer() { + super(UnlModify.class); + } + + @Override + public void serialize(UnlModify value, JsonGenerator gen, SerializerProvider provider) throws IOException { + +// if (UnlModify.class.isAssignableFrom(value.getClass())) { +// gen.writeStartObject(); + +// if (gen.getCurrentValue() == null +// gen.getCurrentValue().toString().length() == 1 +// ) { + // 1. Delegate to Jackson for the existing fields: + provider.defaultSerializeValue(value, gen); // Delegate to Jackson +// } + +// ObjectMapperFactory.create().writeValue(gen, value); + + // Serialize the existing fields (delegate to Jackson's default if possible) +// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields + + // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show + // up during serialization. +// gen.writeFieldName("Account"); +// gen.writeString(value.account().value()); + +// gen.writeEndObject(); +// } else { +// Rely on Jackson's automatic serialization +// gen.writeObject(value); +// } + } +} diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java index 7d25486ed..a35f991d0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import org.xrpl.xrpl4j.model.flags.Flags; import org.xrpl.xrpl4j.model.transactions.CurrencyAmount; import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.metadata.AffectedNode; import org.xrpl.xrpl4j.model.transactions.metadata.MetaLedgerEntryType; @@ -60,10 +61,11 @@ public Xrpl4jModule() { addSerializer(LedgerIndex.class, new LedgerIndexSerializer()); addDeserializer(LedgerIndex.class, new LedgerIndexDeserializer()); + addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); addDeserializer(Transaction.class, new TransactionDeserializer()); addDeserializer(ServerInfo.class, new ServerInfoDeserializer()); - + addSerializer(UnsignedByteArray.class, new UnsignedByteArraySerializer()); addDeserializer(UnsignedByteArray.class, new UnsignedByteArrayDeserializer()); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index f6a144f74..d54a7ae13 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -81,4 +81,9 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.ACCOUNT_DELETE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 8814086c5..3b6e42b3c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -373,6 +373,12 @@ default void checkTickSize() { } + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.ACCOUNT_SET; + } + /** * There are several options which can be either enabled or disabled for an account. Account options are represented * by different types of flags depending on the situation. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index b52da0635..4e742518d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -107,4 +107,9 @@ default TransactionFlags flags() { @JsonProperty("AuthAccounts") List authAccounts(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_BID; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index dab53fa96..3711891db 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -68,4 +68,9 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_CREATE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index 6af820fb3..1133f8f0c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -58,4 +58,9 @@ default TransactionFlags flags() { @JsonProperty("Asset2") Issue asset2(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_DELETE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java index 72bc376c0..a7e0090b1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java @@ -105,4 +105,10 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("TradingFee") Optional tradingFee(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_DEPOSIT; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index 9742cfefb..b06abaf13 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -1,6 +1,7 @@ package org.xrpl.xrpl4j.model.transactions; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty.Access; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; @@ -68,5 +69,12 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + @JsonProperty(value = "TransactionType" + // , access = Access.WRITE_ONLY + ) // <-- Serialize only + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_VOTE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index 93f1bd968..76253950e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -99,4 +99,9 @@ static ImmutableAmmWithdraw.Builder builder() { @JsonProperty("LPTokenIn") Optional lpTokensIn(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.AMM_WITHDRAW; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 0174c1565..1b566a051 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -68,4 +68,10 @@ default TransactionFlags flags() { */ @JsonProperty("CheckID") Hash256 checkId(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.CHECK_CANCEL; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index 8dedc75af..75f5291f8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,13 +31,13 @@ /** * The {@link CheckCash} transaction attempts to redeem a Check object in the ledger to receive up to the amount - * authorized by the corresponding {@link CheckCreate} transaction. Only the Destination address of a Check can cash - * it with a CheckCash transaction. Cashing a check this way is similar to executing a {@link Payment} initiated by - * the destination. + * authorized by the corresponding {@link CheckCreate} transaction. Only the Destination address of a Check can cash it + * with a CheckCash transaction. Cashing a check this way is similar to executing a {@link Payment} initiated by the + * destination. * *

Since the funds for a check are not guaranteed, redeeming a Check can fail because the sender does not have a - * high enough balance or because there is not enough liquidity to deliver the funds. If this happens, the Check - * remains in the ledger and the destination can try to cash it again later, or for a different amount. + * high enough balance or because there is not enough liquidity to deliver the funds. If this happens, the Check remains + * in the ledger and the destination can try to cash it again later, or for a different amount. */ @Value.Immutable @JsonSerialize(as = ImmutableCheckCash.class) @@ -54,8 +54,8 @@ static ImmutableCheckCash.Builder builder() { } /** - * Set of {@link TransactionFlags}s for this {@link CheckCash}, which only allows the - * {@code tfFullyCanonicalSig} flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link CheckCash}, which only allows the {@code tfFullyCanonicalSig} + * flag, which is deprecated. * *

The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -77,9 +77,9 @@ default TransactionFlags flags() { Hash256 checkId(); /** - * Redeem the Check for exactly this amount, if possible. - * The currency must match that of the {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} - * transaction. You must provide either this field or {@link CheckCash#deliverMin()}. + * Redeem the Check for exactly this amount, if possible. The currency must match that of the + * {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} transaction. You must provide either + * this field or {@link CheckCash#deliverMin()}. * * @return An {@link Optional} of type {@link CurrencyAmount} containing the check amount. */ @@ -87,9 +87,9 @@ default TransactionFlags flags() { Optional amount(); /** - * Redeem the Check for at least this amount and for as much as possible. - * The currency must match that of the {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} - * transaction. You must provide either this field or {@link CheckCash#amount()}. + * Redeem the Check for at least this amount and for as much as possible. The currency must match that of the + * {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} transaction. You must provide either + * this field or {@link CheckCash#amount()}. * * @return An {@link Optional} of type {@link CurrencyAmount} containing the minimum delivery amount for this check. */ @@ -105,4 +105,11 @@ default void validateOnlyOneAmountSet() { !(amount().isPresent() && deliverMin().isPresent()), "The CheckCash transaction must include either amount or deliverMin, but not both."); } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.CHECK_CASH; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index 98922bff0..d471ccbcb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -106,4 +106,10 @@ default TransactionFlags flags() { @JsonProperty("InvoiceID") Optional invoiceId(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.CHECK_CREATE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java index 8c5c3bdcf..5ef1a5a35 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java @@ -51,5 +51,10 @@ default TransactionFlags flags() { @JsonProperty("Amount") IssuedCurrencyAmount amount(); - + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.CLAWBACK; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index c163f798a..a2100264e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -93,4 +93,11 @@ default void validateFieldPresence() { !(authorize().isPresent() && unauthorize().isPresent()), "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.DEPOSIT_PRE_AUTH; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index 91b27ff6b..c39620736 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -46,5 +46,10 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.DID_DELETE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java index 95559bfe8..441288fbe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java @@ -71,5 +71,10 @@ default TransactionFlags flags() { @JsonProperty("Data") Optional data(); - + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.DID_SET; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index d5eb98a2a..b20c02e29 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,8 +29,7 @@ import java.util.Optional; /** - * An {@link EnableAmendment} pseudo-transaction marks a change in status of an amendment. - * to the XRP Ledger protocol + * An {@link EnableAmendment} pseudo-transaction marks a change in status of an amendment. to the XRP Ledger protocol * * @see "https://xrpl.org/enableamendment.html" */ @@ -57,11 +56,17 @@ static ImmutableEnableAmendment.Builder builder() { Hash256 amendment(); /** - * The ledger index where this pseudo-transaction appears. This distinguishes the - * pseudo-transaction from other occurrences of the same change. + * The ledger index where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other + * occurrences of the same change. * * @return A {@link LedgerIndex} to indicates where the tx appears. */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.ENABLE_AMENDMENT; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index dedfdc65e..9f02b910d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -76,4 +76,10 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") UnsignedInteger offerSequence(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.ESCROW_CANCEL; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java index 7d2001b8a..3508084f0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java @@ -132,4 +132,11 @@ default void check() { ); } } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.ESCROW_CREATE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index ad0ff7d33..ccb496c6f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -361,4 +361,10 @@ default EscrowFinish normalizeFulfillment() { } } + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.ESCROW_FINISH; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index b35d8f8ad..e0d54e77a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -137,4 +137,9 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.NFTOKEN_ACCEPT_OFFER; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java index 4761de95f..642a1863c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java @@ -95,4 +95,11 @@ static ImmutableNfTokenBurn.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.NFTOKEN_BURN; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java index 6c559df54..5569e71df 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java @@ -90,4 +90,11 @@ default void nonEmptyTokenOffers() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.NFTOKEN_CANCEL_OFFER; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index fc4989319..300db2cf0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -129,4 +129,11 @@ static ImmutableNfTokenCreateOffer.Builder builder() { default NfTokenCreateOfferFlags flags() { return NfTokenCreateOfferFlags.empty(); } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.NFTOKEN_CREATE_OFFER; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java index 26ee8f36b..897f40083 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java @@ -107,4 +107,11 @@ static ImmutableNfTokenMint.Builder builder() { default NfTokenMintFlags flags() { return NfTokenMintFlags.empty(); } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.NFTOKEN_MINT; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index 45f2e0823..cf9f7a9ad 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -72,4 +72,10 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") Optional offerSequence(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.OFFER_CANCEL; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index c7ef5b191..f3e98d1d6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -94,5 +94,11 @@ default OfferCreateFlags flags() { @JsonProperty("Expiration") Optional expiration(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.OFFER_CREATE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java index b8e81ea7c..5f9f7b44f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java @@ -50,4 +50,10 @@ default TransactionFlags flags() { @JsonProperty("OracleDocumentID") OracleDocumentId oracleDocumentId(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.ORACLE_DELETE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java index 7116087e8..f19bddf84 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java @@ -97,4 +97,11 @@ default TransactionFlags flags() { */ @JsonProperty("PriceDataSeries") List priceDataSeries(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.ORACLE_SET; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 87a1dab28..6621be55d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -53,8 +53,8 @@ static ImmutablePayment.Builder builder() { } /** - * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a {@link - * PaymentFlags} object containing the {@link Long} representation of the set bits. + * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a + * {@link PaymentFlags} object containing the {@link Long} representation of the set bits. * *

The value of the flags can either be set manually, or constructed using {@link PaymentFlags.Builder}. * @@ -67,8 +67,8 @@ default PaymentFlags flags() { } /** - * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to - * this amount instead. + * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to this + * amount instead. * * @return A {@link CurrencyAmount} representing the amount of a specified currency to deliver. */ @@ -108,6 +108,7 @@ default PaymentFlags flags() { *

This field is auto-fillable * * @return A {@link List} of {@link List}s of {@link PathStep}s. + * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @JsonProperty("Paths") @@ -120,6 +121,7 @@ default PaymentFlags flags() { *

Must be supplied for cross-currency/cross-issue payments. Must be omitted for XRP-to-XRP payments. * * @return An {@link Optional} of type {@link CurrencyAmount}. + * * @see "https://xrpl.org/transfer-fees.html" * @see "https://en.wikipedia.org/wiki/Slippage_%28finance%29" */ @@ -127,12 +129,19 @@ default PaymentFlags flags() { Optional sendMax(); /** - * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the {@link - * PaymentFlags#tfPartialPayment()}* flag is set. + * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the + * {@link PaymentFlags#tfPartialPayment()}* flag is set. * * @return An {@link Optional} of type {@link CurrencyAmount}. */ @JsonProperty("DeliverMin") Optional deliverMin(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.PAYMENT; + } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index 944a2fefd..440051b2c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,8 +29,8 @@ import java.util.Optional; /** - * Claim XRP from a payment channel, adjust the payment channel's expiration, or both. This transaction can be - * used differently depending on the transaction sender's role in the specified channel: + * Claim XRP from a payment channel, adjust the payment channel's expiration, or both. This transaction can be used + * differently depending on the transaction sender's role in the specified channel: * *

The source address of a channel can: *

    @@ -90,9 +90,9 @@ default PaymentChannelClaimFlags flags() { Hash256 channel(); /** - * Total amount of XRP, in drops, delivered by this channel after processing this claim. Required to deliver XRP. - * Must be more than the total amount delivered by the channel so far, but not greater than the {@link #amount()} - * of the signed claim. Must be provided except when closing the channel. + * Total amount of XRP, in drops, delivered by this channel after processing this claim. Required to deliver XRP. Must + * be more than the total amount delivered by the channel so far, but not greater than the {@link #amount()} of the + * signed claim. Must be provided except when closing the channel. * * @return An {@link Optional} of type {@link XrpCurrencyAmount} representing the payment channel balance. */ @@ -100,9 +100,9 @@ default PaymentChannelClaimFlags flags() { Optional balance(); /** - * The amount of XRP, in drops, authorized by the {@link #signature()}. This must match the amount in - * the signed message. This is the cumulative amount of XRP that can be dispensed by the channel, - * including XRP previously redeemed. + * The amount of XRP, in drops, authorized by the {@link #signature()}. This must match the amount in the signed + * message. This is the cumulative amount of XRP that can be dispensed by the channel, including XRP previously + * redeemed. * * @return An {@link Optional} of type {@link XrpCurrencyAmount} representing the payment channel amount. */ @@ -110,8 +110,8 @@ default PaymentChannelClaimFlags flags() { Optional amount(); /** - * The signature of this claim, in hexadecimal form. The signed message contains the channel ID and the amount - * of the claim. Required unless the sender of the transaction is the source address of the channel. + * The signature of this claim, in hexadecimal form. The signed message contains the channel ID and the amount of the + * claim. Required unless the sender of the transaction is the source address of the channel. * * @return An {@link Optional} of type {@link String} containing the payment channel signature. */ @@ -119,15 +119,20 @@ default PaymentChannelClaimFlags flags() { Optional signature(); /** - * The public key used for the {@link #signature()}, as hexadecimal. This must match the PublicKey stored - * in the ledger for the channel. Required unless the sender of the transaction is the source - * address of the channel and the {@link #signature()} field is omitted. - * (The transaction includes the public key so that rippled can check the validity of the signature - * before trying to apply the transaction to the ledger.) + * The public key used for the {@link #signature()}, as hexadecimal. This must match the PublicKey stored in the + * ledger for the channel. Required unless the sender of the transaction is the source address of the channel and the + * {@link #signature()} field is omitted. (The transaction includes the public key so that rippled can check the + * validity of the signature before trying to apply the transaction to the ledger.) * * @return An {@link Optional} of type {@link String} containing the public key used to sign this payment channel. */ @JsonProperty("PublicKey") Optional publicKey(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.PAYMENT_CHANNEL_CLAIM; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index 2e0397b8c..4fb8692d3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -118,4 +118,10 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.PAYMENT_CHANNEL_CREATE; + } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java index a27ad9737..7a593c2a9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java @@ -93,4 +93,11 @@ default TransactionFlags flags() { */ @JsonProperty("Expiration") Optional expiration(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.PAYMENT_CHANNEL_FUND; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index 8b7ee2412..be9e15bab 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -152,4 +152,10 @@ default UnsignedInteger reserveIncrement() { */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); + + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.SET_FEE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index 6f245654f..b95620ec7 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -73,4 +73,10 @@ default TransactionFlags flags() { @JsonProperty("RegularKey") Optional
    regularKey(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.SET_REGULAR_KEY; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 9128e2f7f..82753acf5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -83,4 +83,10 @@ default TransactionFlags flags() { @JsonProperty("SignerEntries") List signerEntries(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.SIGNER_LIST_SET; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java index a05d081a5..1df1fa215 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java @@ -69,4 +69,11 @@ static ImmutableTicketCreate.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.TICKET_CREATE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java index b8fd678ae..dc8beec21 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java @@ -24,12 +24,16 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty.Access; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableBiMap; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.crypto.signing.Signature; +import org.xrpl.xrpl4j.model.jackson.modules.TransactionSerializer; import java.util.List; import java.util.Map; @@ -109,11 +113,21 @@ public interface Transaction { * * @return A {@link TransactionType}. */ +// // NOTE: This method is marked `@Derived`, which means the Immutable JSON serializer/deserializer won't include +// // this property. However, by marking the `access` as `WRITE_ONLY`, we ensure that this property is always serialized +// // from Java into JSON, but never deserialized from JSON into Java. This has two effects: (1) The `TransactionType` +// // is never entered into the `unknownFields` Map, and (2) The Java default method implementation always ensures that +// // the actual Java `TransactionType` is always populated properly, via the lookup in `typeMap`. +// @JsonProperty(value = "TransactionType" +// , access = Access.WRITE_ONLY +// ) // <-- Serialize only +// @Value.Derived +// default @JsonProperty("TransactionType") - @Value.Default // must be Default rather than Derived, otherwise Jackson treats "TransactionType" as an unknownField - default TransactionType transactionType() { - return typeMap.get(this.getClass()); - } + TransactionType transactionType(); +// { +// return typeMap.get(this.getClass()); +// } /** * The {@link String} representation of an integer amount of XRP, in drops, to be destroyed as a cost for distributing diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index c891a71b3..74d2b510a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -88,4 +88,10 @@ default TrustSetFlags flags() { @JsonProperty("QualityOut") Optional qualityOut(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.TRUST_SET; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java index 7a54f0122..9e49b9051 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java @@ -44,11 +44,10 @@ static ImmutableUnknownTransaction.Builder builder() { * * @return {@link TransactionType#UNKNOWN}. */ - @Override @JsonIgnore @Value.Derived default TransactionType transactionType() { - return Transaction.super.transactionType(); + return TransactionType.UNKNOWN; } /** @@ -61,5 +60,4 @@ default TransactionType transactionType() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index dcd3e42e3..b2a4e93c1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,16 +20,24 @@ * =========================LICENSE_END================================== */ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonProperty.Access; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + /** - * A {@link UnlModify} pseudo-transaction marks a change to the Negative UNL, - * indicating that a trusted validator has gone offline or come back online. + * A {@link UnlModify} pseudo-transaction marks a change to the Negative UNL, indicating that a trusted validator has + * gone offline or come back online. * * @see "https://xrpl.org/unlmodify.html" */ @@ -49,27 +57,51 @@ static ImmutableUnlModify.Builder builder() { return ImmutableUnlModify.builder(); } + @JsonProperty(value = "TransactionType") + @Value.Derived + default TransactionType transactionType() { + return TransactionType.UNL_MODIFY; + } + +// // TODO: FIXME +// @JsonCreator +// static UnlModify create( +// @JsonProperty("Account") String account, // Only the "name" is in the JSON +// @JsonProperty("SigningPubKey") PublicKey signingPublicKey, +// @JsonProperty("LedgerSequence") LedgerIndex ledgerSequence, +// @JsonProperty("UNLModifyDisabling") UnsignedInteger unlModifyDisabling, +// @JsonProperty("UNLModifyValidator") String unlModifyValidator +// ) { +// return ImmutableUnlModify.builder() +// .fee(XrpCurrencyAmount.ofDrops(0)) +// .signingPublicKey(signingPublicKey) +// .unlModifyDisabling(unlModifyDisabling) +// .unlModifyValidator(unlModifyValidator) +// .ledgerSequence(ledgerSequence) +// .build(); // The derived account() will be calculated automatically +// } /** - * This field is overridden in this class because of a bug in rippled that causes this field to be missing - * in API responses. In other pseudo-transactions such as {@link SetFee} and {@link EnableAmendment}, the rippled - * API sets the {@code account} field to a special XRPL address called ACCOUNT_ZERO, which is the base58 - * encoding of the number zero. Because rippled does not set the {@code account} field of the {@link UnlModify} - * pseudo-transaction, this override will always set the field to ACCOUNT_ZERO to avoid deserialization issues - * and to be consistent with other pseudo-transactions. + * This field is overridden in this class because of a bug in rippled that causes this field to be missing in API + * responses. In other pseudo-transactions such as {@link SetFee} and {@link EnableAmendment}, the rippled API sets + * the {@code account} field to a special XRPL address called ACCOUNT_ZERO, which is the base58 encoding of the number + * zero. Because rippled does not set the {@code account} field of the {@link UnlModify} pseudo-transaction, this + * override will always set the field to ACCOUNT_ZERO to avoid deserialization issues and to be consistent with other + * pseudo-transactions. * * @return Always returns ACCOUNT_ZERO, which is the base58 encoding of the number zero. */ @Override - @JsonProperty("Account") - @Value.Default + @JsonProperty(value = "Account", access = Access.WRITE_ONLY) + @Value.Derived + @JsonIgnore(false) default Address account() { return ACCOUNT_ZERO; } /** - * The {@link LedgerIndex} where this pseudo-transaction appears. - * This distinguishes the pseudo-transaction from other occurrences of the same change. + * The {@link LedgerIndex} where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other + * occurrences of the same change. * * @return A {@link LedgerIndex} to indicates where the tx appears. */ @@ -77,8 +109,8 @@ default Address account() { LedgerIndex ledgerSequence(); /** - * If 1, this change represents adding a validator to the Negative UNL. If 0, this change represents - * removing a validator from the Negative UNL. + * If 1, this change represents adding a validator to the Negative UNL. If 0, this change represents removing a + * validator from the Negative UNL. * * @return An {@link UnsignedInteger} denoting either 0 or 1. */ @@ -92,4 +124,27 @@ default Address account() { */ @JsonProperty("UNLModifyValidator") String unlModifyValidator(); + + @Value.Check + default UnlModify normalize() { + if (unknownFields().containsKey("Account")) { + Map newUnknownFields = new HashMap<>(unknownFields()); // Copy the original + + newUnknownFields.remove("Account"); + newUnknownFields.remove("TransactionType"); + + return ImmutableUnlModify.builder().from(this) + .unknownFields(Collections.unmodifiableMap(newUnknownFields)) + .build(); + } else { + +// if (value() == Integer.MIN_VALUE) { +// return ImmutableNormalized.builder() +// .value(0) +// .build(); +// } + + return this; + } + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java index 9272ea579..8e05360f7 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java @@ -78,4 +78,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_ACCOUNT_CREATE_COMMIT; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java index cf7be3c94..807a52b09 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java @@ -142,4 +142,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java index 68c46c7b4..8134553b4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java @@ -135,4 +135,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_ADD_CLAIM_ATTESTATION; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java index 8aa1d2519..07fceea2d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java @@ -90,4 +90,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_CLAIM; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java index 41633ef41..07618b1d8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java @@ -83,4 +83,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_COMMIT; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java index 744331b14..83e271bf0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java @@ -69,4 +69,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_CREATE_BRIDGE; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java index 1e4525b36..6a6fe957a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java @@ -67,4 +67,10 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_CREATE_CLAIM_ID; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java index 8df520a1f..4ac5fe652 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java @@ -37,7 +37,8 @@ static ImmutableXChainModifyBridge.Builder builder() { * Set of {@link XChainModifyBridgeFlags}s for this {@link XChainModifyBridge}, which have been properly combined to * yield a {@link XChainModifyBridgeFlags} object containing the {@link Long} representation of the set bits. * - *

    The value of the flags can either be set manually, or constructed using {@link XChainModifyBridgeFlags.Builder}. + *

    The value of the flags can either be set manually, or constructed using + * {@link XChainModifyBridgeFlags.Builder}. * * @return The {@link XChainModifyBridgeFlags} for this transaction. */ @@ -73,4 +74,10 @@ default XChainModifyBridgeFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + @JsonProperty(value = "TransactionType") + @Value.Derived + @Override + default TransactionType transactionType() { + return TransactionType.XCHAIN_MODIFY_BRIDGE; + } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java index e5a09a6c7..663a11d36 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java @@ -112,6 +112,29 @@ void deserializeLedgerResultWithNegativeAmounts(String ledgerResultFileName) thr }); } + /** + * This test validates that the ledger 87704323 and all of its transactions and metadata are handled correctly, even + * in the presence of negative XRP or IOU amounts. + */ + @ParameterizedTest + @ValueSource(strings = { + "ledger-result-94084608.json" // <-- See https://github.com/XRPLF/xrpl4j/issues/590 + }) + void deserializeLedgerResultWithSpecialObjects(String ledgerResultFileName) throws IOException { + Objects.requireNonNull(ledgerResultFileName); + + File jsonFile = new File( + "src/test/resources/special-object-ledgers/" + ledgerResultFileName + ); + + LedgerResult ledgerResult = objectMapper.readValue(jsonFile, LedgerResult.class); + + ledgerResult.ledger().transactions().forEach(transactionResult -> { + assertThat(transactionResult.metadata().isPresent()).isTrue(); + transactionResult.metadata().ifPresent(this::handleTransactionMetadata); + }); + } + /** * This test validates that the ledger 87704323 and all of its transactions and metadata are handled correctly, even * in the presence of negative XRP or IOU amounts. @@ -144,9 +167,13 @@ private void handleTransactionMetadata(final TransactionMetadata transactionMeta } else if (ledgerEntryType.equals(MetaLedgerEntryType.RIPPLE_STATE)) { handleMetaLedgerObject((MetaRippleStateObject) createdNode.newFields()); } else if (ledgerEntryType.equals(MetaLedgerEntryType.DIRECTORY_NODE)) { - logger.warn("Ignoring ledger entry type {}", ledgerEntryType); + logger.warn("Ignoring CreatedNode ledger entry type {}", ledgerEntryType); + } else if (ledgerEntryType.equals(MetaLedgerEntryType.NEGATIVE_UNL)) { + logger.warn( + "Ignoring DeletedNode ledger entry type {}. See https://github.com/XRPLF/xrpl4j/issues/16", + ledgerEntryType); } else { - throw new RuntimeException("Unhandled ledger entry type: " + ledgerEntryType); + throw new RuntimeException("Unhandled CreatedNode ledger entry type: " + ledgerEntryType); } }, (modifiedNode) -> { @@ -159,8 +186,19 @@ private void handleTransactionMetadata(final TransactionMetadata transactionMeta handleMetaLedgerObject((MetaAccountRootObject) metaLedgerObject); } else if (ledgerEntryType.equals(MetaLedgerEntryType.RIPPLE_STATE)) { handleMetaLedgerObject((MetaRippleStateObject) metaLedgerObject); + } else if (ledgerEntryType.equals(MetaLedgerEntryType.DIRECTORY_NODE)) { + logger.warn("Ignoring ModifiedNode ledger entry type {}", ledgerEntryType); + } else if (ledgerEntryType.equals(MetaLedgerEntryType.NEGATIVE_UNL)) { + logger.warn( + "Ignoring DeletedNode ledger entry type {}. See https://github.com/XRPLF/xrpl4j/issues/16", + ledgerEntryType); + } else if (ledgerEntryType.equals(MetaLedgerEntryType.AMM)) { + logger.warn( + "Ignoring DeletedNode ledger entry type {}. See https://github.com/XRPLF/xrpl4j/issues/591", + ledgerEntryType); } else { - throw new RuntimeException("Unhandled ledger entry type: " + ledgerEntryType); + throw new RuntimeException( + "Unhandled ModifiedNode PreviousFields ledger entry type: " + ledgerEntryType); } }); @@ -173,10 +211,15 @@ private void handleTransactionMetadata(final TransactionMetadata transactionMeta handleMetaLedgerObject((MetaAccountRootObject) metaLedgerObject); } else if (ledgerEntryType.equals(MetaLedgerEntryType.RIPPLE_STATE)) { handleMetaLedgerObject((MetaRippleStateObject) metaLedgerObject); - } else if (ledgerEntryType.equals(MetaLedgerEntryType.DIRECTORY_NODE)) { - logger.warn("Ignoring ledger entry type {}", ledgerEntryType); + } else if ( + ledgerEntryType.equals(MetaLedgerEntryType.DIRECTORY_NODE)) { + logger.warn("Ignoring ModifiedNode ledger entry type {}", ledgerEntryType); + } else if (ledgerEntryType.equals(MetaLedgerEntryType.AMM)) { + logger.warn( + "Ignoring ModifiedNode ledger entry type {}. See See https://github.com/XRPLF/xrpl4j/issues/591", + ledgerEntryType); } else { - throw new RuntimeException("Unhandled ledger entry type: " + ledgerEntryType); + throw new RuntimeException("Unhandled ModifiedNode FinalFields ledger entry type: " + ledgerEntryType); } }); }, @@ -191,7 +234,8 @@ private void handleTransactionMetadata(final TransactionMetadata transactionMeta } else if (ledgerEntryType.equals(MetaLedgerEntryType.RIPPLE_STATE)) { handleMetaLedgerObject((MetaRippleStateObject) metaLedgerObject); } else { - throw new RuntimeException("Unhandled ledger entry type: " + ledgerEntryType); + throw new RuntimeException( + "Unhandled DeletedNode PreviousFields ledger entry type: " + ledgerEntryType); } }); @@ -204,14 +248,15 @@ private void handleTransactionMetadata(final TransactionMetadata transactionMeta } else if (ledgerEntryType.equals(MetaLedgerEntryType.RIPPLE_STATE)) { handleMetaLedgerObject((MetaRippleStateObject) finalFields); } else if (ledgerEntryType.equals(MetaLedgerEntryType.TICKET)) { - logger.info("Ignoring ledger entry type {} because it has no currency values for negative checking", - ledgerEntryType); + logger.info( + "Ignoring ledger entry type {} because it has no currency values for negative checking", ledgerEntryType + ); } else if (ledgerEntryType.equals(MetaLedgerEntryType.DIRECTORY_NODE)) { - logger.warn("Ignoring ledger entry type {}", ledgerEntryType); + logger.warn("Ignoring DeletedNode ledger entry type {}", ledgerEntryType); } else if (ledgerEntryType.equals(MetaLedgerEntryType.NFTOKEN_OFFER)) { handleMetaLedgerObject((MetaNfTokenOfferObject) finalFields); } else { - throw new RuntimeException("Unhandled ledger entry type: " + ledgerEntryType); + throw new RuntimeException("Unhandled DeletedNode FinalFields ledger entry type: " + ledgerEntryType); } } ); @@ -292,4 +337,4 @@ private void handleMetaLedgerObject(MetaNfTokenOfferObject metaNfTokenOfferObjec issuedCurrencyAmount.value().startsWith("-")) )); } -} \ No newline at end of file +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java index b1707896c..ad6731216 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java @@ -36,10 +36,9 @@ void testJson() throws JSONException, JsonProcessingException { .sequence(UnsignedInteger.valueOf(5)) .flags(flags) .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")) - .unknownFields( - unknownFields + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .unknownFields(unknownFields) .networkId(NetworkId.of(UnsignedInteger.valueOf(1024))) .build(); @@ -68,4 +67,4 @@ void testJson() throws JSONException, JsonProcessingException { assertCanSerializeAndDeserialize(transaction, json); } -} \ No newline at end of file +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java index 7c295ade6..3f61e8590 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,19 +20,26 @@ * =========================LICENSE_END================================== */ +import static org.assertj.core.api.FactoryBasedNavigableListAssert.assertThat; + import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.primitives.UnsignedInteger; +import org.assertj.core.api.Assertions; import org.json.JSONException; import org.junit.jupiter.api.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; +import org.xrpl.xrpl4j.model.transactions.ImmutableUnlModify; +import org.xrpl.xrpl4j.model.transactions.Transaction; import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class UnlModifyJsonTests extends AbstractJsonTest { +public class UnlModifyJsonTests extends AbstractJsonTest { @Test - public void testJson() throws JsonProcessingException, JSONException { + public void testJsonWithAccountZero() throws JsonProcessingException, JSONException { UnlModify unlModify = UnlModify.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) @@ -55,7 +62,7 @@ public void testJson() throws JsonProcessingException, JSONException { } @Test - public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { + public void testJsonWithAccountZeroAndUnknownFields() throws JsonProcessingException, JSONException { UnlModify unlModify = UnlModify.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) @@ -66,7 +73,7 @@ public void testJsonWithUnknownFields() throws JsonProcessingException, JSONExce .build(); String json = "{" + - " \"Foo\" : \"Bar\",\n" + + "\"Foo\" : \"Bar\",\n" + "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + "\"Fee\":\"12\"," + "\"LedgerSequence\":67850752," + @@ -78,4 +85,154 @@ public void testJsonWithUnknownFields() throws JsonProcessingException, JSONExce assertCanSerializeAndDeserialize(unlModify, json); } + + @Test + public void testJsonWithEmptyAccount() throws JsonProcessingException, JSONException { + UnlModify unlModify = UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .build(); + + String json = "{" + + "\"Account\":\"\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + + assertCanSerializeAndDeserialize(unlModify, json); + } + + @Test + public void testJsonWithEmptyAccountAndUnknownFields() throws JsonProcessingException, JSONException { + UnlModify unlModify = UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = "{" + + "\"Foo\" : \"Bar\",\n" + + "\"Account\":\"\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + + assertCanSerializeAndDeserialize(unlModify, json); + } + + @Test + public void testJsonWithMissingAccount() throws JsonProcessingException, JSONException { + UnlModify unlModify = UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .build(); + + String json = "{" + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + + assertCanSerializeAndDeserialize(unlModify, json); + } + + @Test + public void testJsonWithMissingAccountAndUnknownFields() throws JsonProcessingException, JSONException { + UnlModify unlModify = UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = "{" + + "\"Foo\" : \"Bar\",\n" + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + + assertCanSerializeAndDeserialize(unlModify, json); + } + + // Using Transcation + // Using Immutable + // Using UnlModify + + + +// @Test +// public void testDeserializeJson() throws JsonProcessingException { +// String json = "{" + +// "\"Account\":\"\"," + +// "\"Fee\":\"0\"," + +// "\"LedgerSequence\":94084608," + +// "\"Sequence\":0," + +// "\"SigningPubKey\":\"\"," + +// "\"TransactionType\":\"UNLModify\"," + +// "\"UNLModifyDisabling\":1," + +// "\"UNLModifyValidator\":\"ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818\"}"; +// UnlModify deserialized = objectMapper.readValue(json, UnlModify.class); +// +// UnlModify expectedUnlModify = UnlModify.builder() +// .fee(XrpCurrencyAmount.ofDrops(0)) +// .sequence(UnsignedInteger.ZERO) +// .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(94084608))) +// .unlModifyDisabling(UnsignedInteger.ONE) +// .unlModifyValidator("ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818") +// .build(); +// +// Assertions.assertThat(deserialized).isEqualTo(expectedUnlModify); +// } +// +// @Test +// public void testDeserializeJsonUsingImmutable() throws JsonProcessingException { +// String json = "{" + +// "\"Account\":\"\"," + +// "\"Fee\":\"0\"," + +// "\"LedgerSequence\":94084608," + +// "\"Sequence\":0," + +// "\"SigningPubKey\":\"\"," + +// "\"TransactionType\":\"UNLModify\"," + +// "\"UNLModifyDisabling\":1," + +// "\"UNLModifyValidator\":\"ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818\"}"; +// Transaction deserialized = objectMapper.readValue(json, Transaction.class); +// +// UnlModify expectedUnlModify = UnlModify.builder() +// .fee(XrpCurrencyAmount.ofDrops(0)) +// .sequence(UnsignedInteger.ZERO) +// .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(94084608))) +// .unlModifyDisabling(UnsignedInteger.ONE) +// .unlModifyValidator("ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818") +// .build(); +// +// Assertions.assertThat(deserialized).isEqualTo(expectedUnlModify); +// } + + } diff --git a/xrpl4j-core/src/test/resources/special-object-ledgers/ledger-result-94084608.json b/xrpl4j-core/src/test/resources/special-object-ledgers/ledger-result-94084608.json new file mode 100644 index 000000000..245983b34 --- /dev/null +++ b/xrpl4j-core/src/test/resources/special-object-ledgers/ledger-result-94084608.json @@ -0,0 +1,10160 @@ +{ + "ledger": { + "account_hash": "182FEA6AF29CC929EE899B51613193285F938B67E6059033139CCCBE78C2811A", + "close_flags": 0, + "close_time": 792634570, + "close_time_human": "2025-Feb-12 00:16:10.000000000 UTC", + "close_time_iso": "2025-02-12T00:16:10Z", + "close_time_resolution": 10, + "closed": true, + "ledger_hash": "576A59C1EA928637915556DBF2BF9F6CC7ADAC942EAA6706BA91BB35751140A5", + "ledger_index": "94084608", + "parent_close_time": 792634561, + "parent_hash": "A2B1008137A86238A72942B7C7C711EED4F29D8812044806EF72CCA65B5DB65E", + "total_coins": "99986441776131104", + "transaction_hash": "03F812C03CA173CC5B1546E468D9E927783F517ACF6650FF56B9DDB8AC439602", + "transactions": [ + { + "Account": "rNVouA3wbxt4JBSSDP851azsfJhC5cVuqT", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "4954444D53000000000000000000000000000000", + "issuer": "r37SFJAmTrxxGT8XQAaA8eUj5Rq7RrakoW", + "value": "0" + }, + "Sequence": 92771114, + "SigningPubKey": "EDADB1A807C32C6AA8D412BBFC71AC421617AE467D7F9732FF133E8EDC9362E352", + "TransactionType": "TrustSet", + "TxnSignature": "325FA50E06440C643D18710099360FC5F28DCF63FBCF46CAC0C8A535B90A17C0DFB75300FDC7441522D59B3BC20FA1F9837259A44B7F65BE9D76452F954CCA0F", + "hash": "00D9B6D401EC13BDBAD2EE5D14CF8968293C73EC95324E67D987605648A1CB14", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNVouA3wbxt4JBSSDP851azsfJhC5cVuqT", + "Balance": "29989868", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92771115, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5BBB016C1A2D909E4085468D97F8EC05E650B691F2F51F09A6B3EE25C8372892", + "PreviousFields": { + "Balance": "29989880", + "Sequence": 92771114 + }, + "PreviousTxnID": "72F3F833E76FEFAE8B9F8A7A05C2D64F9B626EB29E25C4EB419EF451FAF20B6C", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 66, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084611, + "OfferSequence": 167782389, + "Sequence": 167782400, + "SigningPubKey": "0253C1DFDCF898FE85F16B71CCE80A5739F7223D54CC9EBA4749616593470298C5", + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "36853.0799893" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3044022033FF75BE82533D83C59ECBA5AF1109BC3E7FA5DE3292F4B162C66B08BA92F524022062CE07E8782408D2B2AB0AFEC107F9A9D739E019FD1ED3556CA5704D04CECC25", + "hash": "024D5B79089F6A4D39A89AB84A99D65A1F09B56BBFC39FBC6D28C9D859C7F999", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "RootIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3", + "PreviousTxnID": "43293CB7CA7BD8540D3783FF0060B4E812CFBD15E6ADC069EA19077CD4B7E507", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Balance": "15035590590", + "Flags": 0, + "OwnerCount": 17, + "Sequence": 167782401 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1ED8DDFD80F275CB1CE7F18BB9D906655DE8029805D8B95FB9020B30425821EB", + "PreviousFields": { + "Balance": "15035590610", + "Sequence": 167782400 + }, + "PreviousTxnID": "43293CB7CA7BD8540D3783FF0060B4E812CFBD15E6ADC069EA19077CD4B7E507", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CB22C1300", + "NewFields": { + "ExchangeRate": "4f08c43cb22c1300", + "RootIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CB22C1300", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f08c43cd5ef5900", + "Flags": 0, + "PreviousTxnID": "DC2A71F9BF5481883265496C97E59BC78A53533E45B47CACDF852930B797FB6F", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CD5EF5900", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CD5EF5900" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "BA054A5279E7ED5C7123414B745ABA1866974C3E302E355E3C4555A073F8DB83", + "NewFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CB22C1300", + "Sequence": 167782400, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "36853.0799893" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784F08C43CD5EF5900", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "DC2A71F9BF5481883265496C97E59BC78A53533E45B47CACDF852930B797FB6F", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 167782389, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "36853.0889503" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "F057EE7E93ABE57B9B9AF86E96F315AABD7474CBF9892D891CC7A0D759929566" + } + } + ], + "TransactionIndex": 38, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961371, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1905.27178" + }, + "TakerPays": "789076180", + "TicketSequence": 90961386, + "TransactionType": "OfferCreate", + "TxnSignature": "66A9FB24FF7A5A710FB4F33BCFF1E4953E510C6585BED9705872784FCF167B36FA8AD6E56D59B7DBF6CED6AE205306E71846137479109E972C69A517E1E94E0F", + "hash": "0BAF66DD43047CDB74FDE23A20A2A185F1D7BE1E1BA429A11509208365F565D7", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "aea", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961386 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "00B73B6B22FD56B6A52E765989BB9E222CAAB5AA413035FB13D159F38F1C20B7" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "9AF16F22553695556DC8E4A57F0CD49ECB2A5DDA274791454BDB273192586A4B", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC4F5E14E8400", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "A70CA86B91814034282707115A138861867EE6D06EC3EDCDDF59B572E9274292", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961371, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9488.198695759897" + }, + "TakerPays": "3944443450" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "8DC82CBEA1948BD424CBA18A574CF4AE15A5B064568451A0E5ABF3B09A470ADE" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421409", + "Flags": 0, + "OwnerCount": 31, + "Sequence": 90961404, + "TicketCount": 17 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421419", + "OwnerCount": 32, + "TicketCount": 18 + }, + "PreviousTxnID": "9AF16F22553695556DC8E4A57F0CD49ECB2A5DDA274791454BDB273192586A4B", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB6B5E3BB7C00", + "NewFields": { + "ExchangeRate": "5a0eb6b5e3bb7c00", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB6B5E3BB7C00", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0ec4f5e14e8400", + "Flags": 0, + "PreviousTxnID": "A70CA86B91814034282707115A138861867EE6D06EC3EDCDDF59B572E9274292", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC4F5E14E8400", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC4F5E14E8400" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "E29BAB08BB4A2F5DE8B839DD52EF6F708A0B235AE41DBE6F416BC3B71C10E7BD", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB6B5E3BB7C00", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961386, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1905.271466521407" + }, + "TakerPays": "789076180" + } + } + } + ], + "TransactionIndex": 25, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 143700483, + "Sequence": 143700487, + "SigningPubKey": "039451ECAC6D4EB75E3C926E7DC7BA7721719A1521502F99EC7EB2FE87CEE9E824", + "TakerGets": "17091820630", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "499379.7565155069" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402205BF45D735921BA7E9DB08D79B560FD66875DABC0CA07BFEE89FE4AC17616183A02205204E257D2FFD731028604AA3EED5D8EC11D4A2E961E6B505EBB94EFEBADC7EE", + "hash": "0BFAA9309E7118D22B3385A33AA1C3BAB5758DBAB4F0122AE8F671108A80E579", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "04FCA3878A3792B1F57FCE034BCBD8533B35EEE1CB30FDD3B76C7614FD7B281F", + "NewFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A61503C10296A", + "Sequence": 143700487, + "TakerGets": "17091820630", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "499379.7565155069" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "RootIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96", + "PreviousTxnID": "CD5F359A7BB3BA488F8742EC99D8918A60C2E1976954BBC6889F96F8B4CE8CBC", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Balance": "1000571139", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 143700488 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47FE64F9223D604034486F4DA7A175D5DA7F8A096952261CF8F3D77B74DC4AFA", + "PreviousFields": { + "Balance": "1000571154", + "Sequence": 143700487 + }, + "PreviousTxnID": "CD5F359A7BB3BA488F8742EC99D8918A60C2E1976954BBC6889F96F8B4CE8CBC", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A62BD8BE19380", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "29C80692C5948BDB2B0BB15BC622F7F55E7B1D3C8BB9706514E4B0C93D94F80A", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 143700483, + "TakerGets": "955071694", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "27919.76366379525" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "58D45B1380C74A82C925A6B90385724B6819CD60D840974E2041CE20ECD99650" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A61503C10296A", + "NewFields": { + "ExchangeRate": "500a61503c10296a", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A61503C10296A", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "500a62bd8be19380", + "Flags": 0, + "PreviousTxnID": "29C80692C5948BDB2B0BB15BC622F7F55E7B1D3C8BB9706514E4B0C93D94F80A", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A62BD8BE19380", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500A62BD8BE19380" + } + } + ], + "TransactionIndex": 78, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961382, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9488.16762" + }, + "TakerPays": "3945380900", + "TicketSequence": 90961400, + "TransactionType": "OfferCreate", + "TxnSignature": "64F1B3494B50CBC137FF21EEB1A028D68000CD39B2C35B9B386C02A863DB75064E49EB2870E8CC6A7C1982737C9F87A98AF75D4A540E79997C18DBFE56D43E0A", + "hash": "10936C69003027A4EFB32CE83FDC3BF9ED06239A2397AEE14168A371EA42A38C", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089B269F89EA53", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "D19E12FE05E46721200731AE1139CD387856A40BA672C9E4A1B72816AC492CBC", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961382, + "TakerGets": "788888688", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1910.99607" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "0A57E957C44B71715C2762678A3EDA9043A68E11B7F80FCB1D13D6FCB4948001" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "aea", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961400 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "1194D2455A13F3DBA789BB91543BC4B447FD08107FC268B8ACD137B2B17A74A6" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "24D7F6BEFFA561831D754DA6559EAE3509EA107EB6678E96BC4EB4D944A7FE03", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f089b269f89ea53", + "Flags": 0, + "PreviousTxnID": "D19E12FE05E46721200731AE1139CD387856A40BA672C9E4A1B72816AC492CBC", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089B269F89EA53", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089B269F89EA53" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421389", + "Flags": 0, + "OwnerCount": 29, + "Sequence": 90961404, + "TicketCount": 15 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421399", + "OwnerCount": 30, + "TicketCount": 16 + }, + "PreviousTxnID": "24D7F6BEFFA561831D754DA6559EAE3509EA107EB6678E96BC4EB4D944A7FE03", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC5DF2D292800", + "NewFields": { + "ExchangeRate": "5a0ec5df2d292800", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC5DF2D292800", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "FE205BF6461BC8D17E9893C8B9CD19DC6AF2A8148C2E2D41D21838C1846AE758", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EC5DF2D292800", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961400, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9488.166788994886" + }, + "TakerPays": "3945380900" + } + } + } + ], + "TransactionIndex": 27, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rPKouuMgXmr7K2oa1z5D8A6Pw1ZAvVCiYB", + "Amount": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "30.74789292401313" + }, + "DeliverMax": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "30.74789292401313" + }, + "DeliverMin": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "30.13293506553287" + }, + "Destination": "rPKouuMgXmr7K2oa1z5D8A6Pw1ZAvVCiYB", + "Fee": "12", + "Flags": 131072, + "LastLedgerSequence": 94084626, + "SendMax": "9338591", + "Sequence": 93970645, + "SigningPubKey": "ED9C49C3B26279D737BE972FBB292A131031DE2A04952E31D4F34EF53EF02609FA", + "TransactionType": "Payment", + "TxnSignature": "59A3735B32C56628B2965AC54D53BD157313E87FF6F48F72B5360F9EFFA8854626394C475D54F97274EB454B2548768924FE9F01DCA38FECBB3D4698100E6902", + "hash": "12147C84E730F0292B8758CD6571B3C860CAAE2B713E3C247028A6A52BA746C6", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-30.84269644028536" + }, + "Flags": 131072, + "HighLimit": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rPKouuMgXmr7K2oa1z5D8A6Pw1ZAvVCiYB", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "0" + }, + "LowNode": "8e" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "1E27E8F9D076A1EF4FBD07F50303F498A4B7E7EFC41F6A77C7CE3C67D03D276A", + "PreviousFields": { + "Balance": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.09480351627223" + } + }, + "PreviousTxnID": "0D50E6FC4150D478965C2CA3BD56B7A0CAE5E0ED7A9737CFD97B7F70B343B0AD", + "PreviousTxnLgrSeq": 94084569 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-56327.18189794181" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "r93wkPVVrRJbtSbkkeYtEi9W4AERCi2J7a", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "2B4836DBE4D4C55F3D8E2F9BAEE0BF0B90BCB0442CB6ECD0EB9108953A96D1EB", + "PreviousFields": { + "Balance": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-56357.92979086582" + } + }, + "PreviousTxnID": "A8EDB2501C8412287B42674101592CDCF0C53EEF87FF585C8F28479B8B352B28", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rPKouuMgXmr7K2oa1z5D8A6Pw1ZAvVCiYB", + "Balance": "3828361", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 93970646 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C6858E27A1F54E258F2A321E2F671E99CC1962EF2B1EF4E1179A909B189FD8C1", + "PreviousFields": { + "Balance": "13136548", + "Sequence": 93970645 + }, + "PreviousTxnID": "BCBA038521FBECACBF8FE225DD64B4ABFE0552FFA5DB4AA08CB10E7288EA0B48", + "PreviousTxnLgrSeq": 94084573 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "486C5217703D4B42CD4675C82E0C88E686D14C19FB8A31BBFB68FBD9EFFE836B", + "Account": "r93wkPVVrRJbtSbkkeYtEi9W4AERCi2J7a", + "Balance": "17060817918", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 91626141 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "FE8F56C76FD08DC0BF1637ABFB1A772627145E3C3B5C071861F319352A001054", + "PreviousFields": { + "Balance": "17051509743" + }, + "PreviousTxnID": "A8EDB2501C8412287B42674101592CDCF0C53EEF87FF585C8F28479B8B352B28", + "PreviousTxnLgrSeq": 94084605 + } + } + ], + "TransactionIndex": 74, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "24464C4950505900000000000000000000000000", + "issuer": "rsENFmELvj92orrCKTkDTug53MzwsB7zBd", + "value": "30.74789292401313" + } + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961367, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": "789076180", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1911.00047" + }, + "TicketSequence": 90961366, + "TransactionType": "OfferCreate", + "TxnSignature": "2879E5DFBB3E9C3E86464CDACC1EA4811E545A684351C2F41B78A3C74F0F9DB43B51A2A2FD9BF2275B011B2A8B60E0755F065F8CCDB3A8309B81249A7D573701", + "hash": "1782C1B4315FA0CBD0005C53A718A1B8ED005AEA008067A3269B048EC625CBDD", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "ae9", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "B6D1CDD6F4E841DCF81A641B66C3FAABE9A29831D5313461AE5BFD628757394E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D", + "PreviousTxnID": "B6D1CDD6F4E841DCF81A641B66C3FAABE9A29831D5313461AE5BFD628757394E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089AA1E8DADEA5", + "NewFields": { + "ExchangeRate": "4f089aa1e8dadea5", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089AA1E8DADEA5", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f089d5a12bb5bc8", + "Flags": 0, + "PreviousTxnID": "1F6B701E674C582E59B4A52A216787673D3A0BF92D54F966699C4C890195734D", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089D5A12BB5BC8", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089D5A12BB5BC8" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "987E38307DD17EDA2F070CB4EA503D27449E4475FFF32785B6131C6CEA7BFB13", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089AA1E8DADEA5", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961366, + "TakerGets": "789076178", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1911.00047" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421449", + "Flags": 0, + "OwnerCount": 35, + "Sequence": 90961404, + "TicketCount": 21 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421459", + "OwnerCount": 36, + "TicketCount": 22 + }, + "PreviousTxnID": "B6D1CDD6F4E841DCF81A641B66C3FAABE9A29831D5313461AE5BFD628757394E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089D5A12BB5BC8", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "1F6B701E674C582E59B4A52A216787673D3A0BF92D54F966699C4C890195734D", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961367, + "TakerGets": "788888688", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1912.90518" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "B51F8148E63E312D78011045314959CBCDF57C1A636F64B5A5102D3E05C5415A" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961366 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "E8F00C75226EBAACA9AFA31A906D676E40567E2363748DA596BC9338F78FA350" + } + } + ], + "TransactionIndex": 21, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0.000002844979069698192" + }, + "DeliverMax": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0.000002844979069698192" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0.01021491577115065" + }, + "Sequence": 29665816, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "63FFBF9724505E201E558E4C6E09BEC22607CE3CC0D84BCDDB8F2964F47E818BF0619FCB7B4AD4164B237E78E8C104926BDA1DBCEF9217428B94018FAD2F3008", + "hash": "1A08D366FC1A816E504CD9F819D35801A1F49429C031A917624B24E780D4631D", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.0000028454807281036" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "MAG", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "HighNode": "8", + "LowLimit": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0" + }, + "LowNode": "214" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "6AEDB0D2B26C22AC4401CBDCEB4181C26081FE867AC3A8C233488A6D66724DE8", + "PreviousFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.000000000501658405408" + } + }, + "PreviousTxnID": "842C902D24727B066525EC681B562AFEFF28B6645C479A41A7748FC865A40B8A", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.000000674244795718" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0" + }, + "HighNode": "3a7", + "LowLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "2a" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "A92E75B22F28DBE5B8DA92B6365E02506C19727082EAF5E32E321F569131D24B", + "PreviousFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009704832179073668" + } + }, + "PreviousTxnID": "A602880FA0F31697D7454A2FFAC5981F5451027C83DDDEC2D5879D9F8B56E98E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "410.2418033950393" + }, + "Flags": 16842752, + "HighLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0" + }, + "HighNode": "654", + "LowLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rpXQhNrxFbgMzoRDQPw8zuY463jvy2U6EL", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "D55D762C4F276169D1C151C2F7EF23D920AEDFEBBD1F4E9E2B86B51D423EB2D2", + "PreviousFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "410.232099237105" + } + }, + "PreviousTxnID": "869F22C54F957F9ED04C595DEEAA062B23A86D72F72C8B5C35341FB1C5529F9C", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "1A08D366FC1A816E504CD9F819D35801A1F49429C031A917624B24E780D4631D", + "Balance": "97189464", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665817 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "A602880FA0F31697D7454A2FFAC5981F5451027C83DDDEC2D5879D9F8B56E98E", + "Balance": "97189474", + "Sequence": 29665816 + }, + "PreviousTxnID": "A602880FA0F31697D7454A2FFAC5981F5451027C83DDDEC2D5879D9F8B56E98E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.1206022815906186" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "MAG", + "issuer": "rpXQhNrxFbgMzoRDQPw8zuY463jvy2U6EL", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0" + }, + "LowNode": "315" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "FC59F27111C6D1B4EAB680043B15B920AE33585E03A8CFE823809043A81AF863", + "PreviousFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.1206051265696883" + } + }, + "PreviousTxnID": "869F22C54F957F9ED04C595DEEAA062B23A86D72F72C8B5C35341FB1C5529F9C", + "PreviousTxnLgrSeq": 94084597 + } + } + ], + "TransactionIndex": 14, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0.000002844979069698192" + } + } + }, + { + "Account": "rQGeZdBAupy34KduV56qtkmjoaaEEgikwW", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92793090, + "SigningPubKey": "EDE6D7DB9A50F12112FD251E9B810E4338D55E0C639483156DE833CD6C1ECDCE53", + "TransactionType": "TrustSet", + "TxnSignature": "DF0C7078B140369E717F4AB9B088D703D1AC4CBEF0468572EC4C165EF89634D8E38DB35D498B3A19A176F9DD493F15DB3409C3006353C01835BA5562BC37F304", + "hash": "1D37AEF885D15B6F344AA910A1819A3A9A12DC6A85352FB145E1D88F40E5FDB0", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQGeZdBAupy34KduV56qtkmjoaaEEgikwW", + "Balance": "29692704", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92793091, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "711E2A31A561EA857987AE1128C0F573297D271EF9E8EA925B83DE0D613A99C7", + "PreviousFields": { + "Balance": "29692716", + "Sequence": 92793090 + }, + "PreviousTxnID": "B20612F71BC78D7A92167FE8A191122AB0BF5EE9F1DD481A7EC5B0F7D3B1123A", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 80, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "6A72734E5341574D4237503430774F5A4F44456774", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 93305413, + "Sequence": 93305418, + "SigningPubKey": "025EBE8E351CAC5C641624238CD36A360631728177A5314566CC6BA0BAD4EF65FC", + "TakerGets": "43244903", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "574.751832" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100FF7CAF0814CC6C293C201D5A615D508A467E14B53FE2DC17158947FBB4244FAB022029C40C5A2F53C93B41EF95258C5F81106C5AC28F6761F8EA6CCFEFAA9299484D", + "hash": "21532642DFDA93CDA88147D6AFA4C3DF647CF351D64180104CBF23DF68FC8857", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA205BECCB2D", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "B9ECFED87B40DA435699AB129F2282789225EF78B5902F523CCEB52B4F3E89C8", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 93305413, + "TakerGets": "43354776", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "576.856127" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "3C03FF4E94BABF4C4C66A33AF549DF39CBF8580AE007783884C58E83110DA038" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "RootIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542", + "PreviousTxnID": "73B0BE40BE76D877702D8D3A362B697D16933C4D7C452F967ECB0298DD55D850", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Balance": "68142050862", + "Flags": 0, + "OwnerCount": 11, + "Sequence": 93305419 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9C1D8ABFBDC2F6A287CF320407BF8957B3CA5FE87C52C1EAD494E867A32ED9DB", + "PreviousFields": { + "Balance": "68142050877", + "Sequence": 93305418 + }, + "PreviousTxnID": "248DC12F1576791446DCBFD77F83C716AEEC14C9F20162FE7C895D4298AE8149", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "AC181DDE6545D1999D75DCDF437F687F979592B93C0214C58B927C8727730B6C", + "NewFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B8C68021EE9C", + "Sequence": 93305418, + "TakerGets": "43244903", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "574.751832" + } + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B8C68021EE9C", + "NewFields": { + "ExchangeRate": "5004b8c68021ee9c", + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B8C68021EE9C", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5004ba205beccb2d", + "Flags": 0, + "PreviousTxnID": "B9ECFED87B40DA435699AB129F2282789225EF78B5902F523CCEB52B4F3E89C8", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA205BECCB2D", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA205BECCB2D" + } + } + ], + "TransactionIndex": 55, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rNv2NxNzZpyWcHSxNe6MPkLFgjEymmC9JR", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "464D4C4652000000000000000000000000000000", + "issuer": "rUe41xMLKy1NVdLQD6cdZftKMhEwDaRJkf", + "value": "0" + }, + "Sequence": 92790657, + "SigningPubKey": "ED2A6BDD5CBF23117DE66FCF2F1ECDD8B6BE75E67249F5142CC7D6EE1018390949", + "TransactionType": "TrustSet", + "TxnSignature": "E3B4DBAC301EC97E089AB1DC5817C7D1EDD008440683E43524549F69A9CA1B8BE1F93A7366BA2BCB8AE3EB6D45004D61F4CAD8E8920C378D6FA0684DF9929705", + "hash": "21F999F9CBEEDF9367D99D17EE1C0FEC3A756692E7167D211EAADD82E78D9F09", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNv2NxNzZpyWcHSxNe6MPkLFgjEymmC9JR", + "Balance": "29989867", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92790658, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "38C2C6FC2CB6523ABE4501044F6636B836D25A9D5F5F392C4E4CB1B3FC092813", + "PreviousFields": { + "Balance": "29989879", + "Sequence": 92790657 + }, + "PreviousTxnID": "95F1D4DBF97B5D278B5F7533308F344BEACA74F46C6E99EE1DB168D6F6C68BFB", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 68, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30301444, + "Sequence": 30301448, + "SigningPubKey": "021C987881039AD42AEC336FB8460F1B1F4DDF0839CAF3EAB1AF69DDF8012C30A3", + "TakerGets": "3943786926", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "122209.438269155" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100EC40BBE30AB258B1133E47140E2C2372E966F5445CE60C608458554AD16C85A1022026E1EB71BB8DC0E926D9D96F42A0BE7A34947FA9FC72D2A2413FF91E71E6C9AA", + "hash": "234E97E407508667F7480659B5AC360D8E0F3FCA83CD7532BC4BA54D898F4C4E", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B0253DF92F5EE", + "NewFields": { + "ExchangeRate": "500b0253df92f5ee", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B0253DF92F5EE", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "500b051f21156f85", + "Flags": 0, + "PreviousTxnID": "BD0872BB78B9F9A7A37B0510F53044F9137E9428E8CC90FAD4461AA644A642E4", + "PreviousTxnLgrSeq": 94084599, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B051F21156F85", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B051F21156F85" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "69323A63314DF36BF91CD23696F7BA4CE50F8BB56F821C4EB518848FCF4B3FD0", + "NewFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B0253DF92F5EE", + "Sequence": 30301448, + "TakerGets": "3943786926", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "122209.438269155" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Balance": "1000922607", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30301449 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7645DE0D353FF9ECB95EE6D8A5C51A666BBBA29860C30B45C529957871E586C1", + "PreviousFields": { + "Balance": "1000922622", + "Sequence": 30301448 + }, + "PreviousTxnID": "3ECAFC64F36606DF8A7B2830E980FB239BD1EEE51692FDA8D4771ABF4971B407", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "RootIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC", + "PreviousTxnID": "3ECAFC64F36606DF8A7B2830E980FB239BD1EEE51692FDA8D4771ABF4971B407", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500B051F21156F85", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "BD0872BB78B9F9A7A37B0510F53044F9137E9428E8CC90FAD4461AA644A642E4", + "PreviousTxnLgrSeq": 94084599, + "Sequence": 30301444, + "TakerGets": "735897767", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "22826.48904687921" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "E8FD5D2031EE0D2813D7A15712A3D663D539B04A8024675B9615E3ABB3C2C350" + } + } + ], + "TransactionIndex": 43, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961381, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4753.63163" + }, + "TakerPays": "1972690450", + "TicketSequence": 90961393, + "TransactionType": "OfferCreate", + "TxnSignature": "417974CD020CB9F6179324638F2EC2FF07017B620D91D00EDB251C4F13D2ECBE8779246FD199B41B287AD078B46D442C744ADCD2C4D8468EB3D043150AA7C20D", + "hash": "24D7F6BEFFA561831D754DA6559EAE3509EA107EB6678E96BC4EB4D944A7FE03", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "aea", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961393 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "108F3E8582935D60D0E494248909B50CD155C4C777CCEA5C8F86500A7EFEA24A" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "0BAF66DD43047CDB74FDE23A20A2A185F1D7BE1E1BA429A11509208365F565D7", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB9952B3357FF", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "7EDC7EAD054BD8D90037EDD51606DFC4C46F50655E26448C503D783A3BD25289", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961381, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2855.051125533815" + }, + "TakerPays": "1183333040" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "936BABF3339FB7F8733CBEAD107D9FE581DE39B2ADE6C7BE17F3A4B0C7C24BF1" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421399", + "Flags": 0, + "OwnerCount": 30, + "Sequence": 90961404, + "TicketCount": 16 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421409", + "OwnerCount": 31, + "TicketCount": 17 + }, + "PreviousTxnID": "0BAF66DD43047CDB74FDE23A20A2A185F1D7BE1E1BA429A11509208365F565D7", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0eb9952b3357ff", + "Flags": 0, + "PreviousTxnID": "7EDC7EAD054BD8D90037EDD51606DFC4C46F50655E26448C503D783A3BD25289", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB9952B3357FF", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB9952B3357FF" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBE46932AE800", + "NewFields": { + "ExchangeRate": "5a0ebe46932ae800", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBE46932AE800", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "F63BF50DC3D305DC44DD29D97E4D06FB4129B728A8F32791ECF45456345927BE", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBE46932AE800", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961393, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4753.631327321886" + }, + "TakerPays": "1972690450" + } + } + } + ], + "TransactionIndex": 26, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r4ViXHhkdy5Dt9VoKucGbDWuXAb9ERUbx2", + "Amount": "8485699", + "DeliverMax": "8485699", + "DeliverMin": "8315985", + "Destination": "r4ViXHhkdy5Dt9VoKucGbDWuXAb9ERUbx2", + "Fee": "12", + "Flags": 131072, + "LastLedgerSequence": 94084626, + "SendMax": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "3987805.034890162" + }, + "Sequence": 93496570, + "SigningPubKey": "ED8236C4228E4855EC6D1B0476A954DF9B1A1FBBC3FBB87D76204102A6C3468415", + "TransactionType": "Payment", + "TxnSignature": "99876B8567A06BB8DDDF2A33C946443EE15A5328BBD25AD58FD75E012550351FEDCE85AE3607A4B9BE79787344D30F799F8E36B090C1C38E2D78964C90AB9C04", + "hash": "29B38C33CCF2D500600D746F109A7A985203A45EA78F5A6D677A916884BE9249", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-1954422704.301244" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rDwJrWbmBd2eGMmpGhA1NJLXYXhUHhv8sh", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "0" + }, + "LowNode": "1" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "7C3D48ED20980D68B8C3FDA328F5AE2A87F5137BD29EB402C8BF94A07A9399C2", + "PreviousFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-1950434899.266354" + } + }, + "PreviousTxnID": "7C78C64689154600D39326B9ABAB56D59CD90717AA2A2D5477725C7F285C567D", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "ED4CBF1A89198D096EAB02EEE41B5E1D2B895D9CEE0F27E9EFE509EA3C23A1C7", + "Account": "rDwJrWbmBd2eGMmpGhA1NJLXYXhUHhv8sh", + "Balance": "4135718801", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 92443065 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7D917B911BF3B3F3E052B85D540C4B26B33E4C9247FA7F03CEEF59F82877D30A", + "PreviousFields": { + "Balance": "4144173900" + }, + "PreviousTxnID": "7C78C64689154600D39326B9ABAB56D59CD90717AA2A2D5477725C7F285C567D", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "r4ViXHhkdy5Dt9VoKucGbDWuXAb9ERUbx2", + "value": "1000000000000000e-2" + }, + "HighNode": "0", + "LowLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "0" + }, + "LowNode": "23" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "D438ABD63455F25A8E94FF0223BE9B8B34A7EAF674847284217AE488DEA1B2FE", + "PreviousFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-3987805.034890162" + } + }, + "PreviousTxnID": "006A2BE747B4792AF3D7DDC9A793C7D3B5C6F4FBEA64B6140B718A0A22F5AAA6", + "PreviousTxnLgrSeq": 94084585 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r4ViXHhkdy5Dt9VoKucGbDWuXAb9ERUbx2", + "Balance": "13176546", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 93496571 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "DBD2ED410D5C0C5C0038ACA8FE55F17D9BB1E5E6EFDA2CA035AB4CC704984C28", + "PreviousFields": { + "Balance": "4721459", + "Sequence": 93496570 + }, + "PreviousTxnID": "A080A32F557270A8206E812D224F34631528560C639D63064D0B60095B45F25A", + "PreviousTxnLgrSeq": 94084587 + } + } + ], + "DeliveredAmount": "8455099", + "TransactionIndex": 72, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "8455099" + } + }, + { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "454D54416E507668754F7667644242426D6F666363", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 93305414, + "Sequence": 93305420, + "SigningPubKey": "025EBE8E351CAC5C641624238CD36A360631728177A5314566CC6BA0BAD4EF65FC", + "TakerGets": "17345432", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "230.64814" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100BC1D6798BB6531A2D9FFAA046ADCDD34E1F41CCD9CF88DBA8612B82A9A0C3DFC022018B776D7C6C591412EB4D50D0D82C6FAC1BCE7A6D99C9796334FA732A8034AB5", + "hash": "36593A69EF519C76D03348334F3CC780009EE99D67B1BDE48CF3DF1B429FF4E5", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "RootIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542", + "PreviousTxnID": "8DE11442A8DB0B97E7F6B4718E062B7C232FE7734A32E606D883577421EAC61C", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8A1F8426E9916F7E8054B4EC1B5466218AEA034F7A07B4F9C424F44912114F2A", + "NewFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B962DE242970", + "Sequence": 93305420, + "TakerGets": "17345432", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "230.64814" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Balance": "68142050832", + "Flags": 0, + "OwnerCount": 11, + "Sequence": 93305421 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9C1D8ABFBDC2F6A287CF320407BF8957B3CA5FE87C52C1EAD494E867A32ED9DB", + "PreviousFields": { + "Balance": "68142050847", + "Sequence": 93305420 + }, + "PreviousTxnID": "8DE11442A8DB0B97E7F6B4718E062B7C232FE7734A32E606D883577421EAC61C", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B962DE242970", + "NewFields": { + "ExchangeRate": "5004b962de242970", + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004B962DE242970", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5004ba9c10a55fe8", + "Flags": 0, + "PreviousTxnID": "5A501CD20F4C521CAA350AD6AAE3349C567E3159194FBF10B27824D15DB2709B", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA9C10A55FE8", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA9C10A55FE8" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BA9C10A55FE8", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "5A501CD20F4C521CAA350AD6AAE3349C567E3159194FBF10B27824D15DB2709B", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 93305414, + "TakerGets": "17305602", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "230.351297" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "EE7452762016DAE917EC11AF07281B2DF1B0F943DC90F84634DCD956A7670DDE" + } + } + ], + "TransactionIndex": 57, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rHoKM6uJUoHGRwPoc4Xs1DebNrF8e7x1SW", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "RXO", + "issuer": "rUSm6rb8gPZ9ZZRaWu6KaMYDSyqRPNAe9r", + "value": "1000000" + }, + "Sequence": 94083084, + "SigningPubKey": "EDCAC152341CE55B82E6CBD97A5819713FF3AB2B1D1DC0A787E55A93A8921A59A8", + "TransactionType": "TrustSet", + "TxnSignature": "EF384ACB5A2B9BE185213B0695FF1A12E16C7D611211B1627F2870920DAEA10BD8C89408DEC0031E3710742E1A88E3A19B3A6279056D86DD9BD0F2400A1C2809", + "hash": "383C86A32E4875666A1380D9CD95D4814F568D69E3A82FE50B910B213E097457", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "2", + "Owner": "rHoKM6uJUoHGRwPoc4Xs1DebNrF8e7x1SW", + "RootIndex": "A5F7ABB0ACDE76AA1854F31B85E6E53BCE974EB8EBE2BFDE8E8633101B874CF6" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "16A38EC273B8BCD3047FA36781A1A7FA5181A3555961138F0BCB8FD1BE8A10FE", + "PreviousTxnID": "9C7976B46950C88C51159E22C19E5055B1AECD08DBC4F5F9A0FA8B38CB5F8E79", + "PreviousTxnLgrSeq": 94084600 + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "967031B112B62AFEF0035353CA636FEBE606A3D572E88C10C82BDDABDABE8A98", + "PreviousTxnID": "7C83AE5ACEA1FF81934BB266939304EB7ACCEC794CB56B315607BED2A1072294", + "PreviousTxnLgrSeq": 94084604 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rHoKM6uJUoHGRwPoc4Xs1DebNrF8e7x1SW", + "Balance": "119991332", + "Flags": 0, + "OwnerCount": 110, + "Sequence": 94083085 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "A8C2B3FA143FA5F13064C3AE6E5FCFB9082CADB52604A1AB312D279B7C8D097F", + "PreviousFields": { + "Balance": "119991342", + "OwnerCount": 109, + "Sequence": 94083084 + }, + "PreviousTxnID": "9C7976B46950C88C51159E22C19E5055B1AECD08DBC4F5F9A0FA8B38CB5F8E79", + "PreviousTxnLgrSeq": 94084600 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "RippleState", + "LedgerIndex": "B06246E2FB08B390ADDE36393BB7DEA50F6A591CAAE2608CB76CC47D34B26098", + "NewFields": { + "Balance": { + "currency": "RXO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 131072, + "HighLimit": { + "currency": "RXO", + "issuer": "rHoKM6uJUoHGRwPoc4Xs1DebNrF8e7x1SW", + "value": "1000000" + }, + "HighNode": "3", + "LowLimit": { + "currency": "RXO", + "issuer": "rUSm6rb8gPZ9ZZRaWu6KaMYDSyqRPNAe9r", + "value": "0" + }, + "LowNode": "4e" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "4d", + "Owner": "rUSm6rb8gPZ9ZZRaWu6KaMYDSyqRPNAe9r", + "RootIndex": "B08C5994613FB529FD83BA5747535418047908DA6EAF3BEF588061EE49C75373" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DEFBCD4A4CF56952BE0C750F40D78C80C2A9051BE38B32C25E1FB9D9AD116AC1", + "PreviousTxnID": "9C7976B46950C88C51159E22C19E5055B1AECD08DBC4F5F9A0FA8B38CB5F8E79", + "PreviousTxnLgrSeq": 94084600 + } + } + ], + "TransactionIndex": 62, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Fee": "15", + "Flags": 524288, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "346D6532573234424473374878376474646C434E44", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 97505272, + "Sequence": 97505282, + "SigningPubKey": "034D6788B751D18BBE92CAF1255431512D6D187446D47FAEE20FDB0BFA8144DB1E", + "TakerGets": "16960807100", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "41039.047291444" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100B9C20BDE557895706EB5581A0F89F462AF8953F54F965DD6D935FCBC136BFD620220759D2C23608C6EE783B62C84655C867936D211E050F77960BF5DD95F1353649C", + "hash": "3AA4DD7E65BFBF8FFA606E7370438D2F9CC5035EB3A8781FD0D957D7F2F41052", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0899F7F16B5400", + "BookNode": "0", + "Flags": 131072, + "OwnerNode": "1", + "PreviousTxnID": "7FD0F08B2A4CC2C179926E9339B834EF34C191C97E16ED794B83DF72D9CE01C1", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 97505272, + "TakerGets": "16950645300", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "41039.037829377" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "4725E604942BBBDC99990F8D08078BA12C239BB200B885384B0A270BF9482812" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "4C81E24CD900A4AC6FAED0B6BCC0F24ED9B6DF0D95FF612A94D3DE0C458E55AE", + "NewFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0898A656AF3000", + "Flags": 131072, + "OwnerNode": "1", + "Sequence": 97505282, + "TakerGets": "16960807100", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "41039.047291444" + } + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0898A656AF3000", + "NewFields": { + "ExchangeRate": "4f0898a656af3000", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0898A656AF3000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f0899f7f16b5400", + "Flags": 0, + "PreviousTxnID": "7FD0F08B2A4CC2C179926E9339B834EF34C191C97E16ED794B83DF72D9CE01C1", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0899F7F16B5400", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0899F7F16B5400" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Balance": "60817108098", + "Flags": 0, + "OwnerCount": 34, + "Sequence": 97505283 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "6BC9286C5146B76D0D140873B509D72581AABEB79037BF1D9849830FBF5A9FE6", + "PreviousFields": { + "Balance": "60817108113", + "Sequence": 97505282 + }, + "PreviousTxnID": "BBEFC10A4F627378921E0AB5D8F2205D1C74FDE4B8714EDABCF175B5C99DC127", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "RootIndex": "49B537464A9659478275132402EB6D5E8723F42ED20DB3CF4A4527A9A3F1589A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E06052755A83D52A63C3392B87634326BE0E4E68ECB59B7DF3A2B1851229208D", + "PreviousTxnID": "BBEFC10A4F627378921E0AB5D8F2205D1C74FDE4B8714EDABCF175B5C99DC127", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 46, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rMdpzP6SSRcNDSgHQGGx4hV3qeRiuRoqQM", + "Fee": "15", + "Flags": 524288, + "LastLedgerSequence": 94084609, + "Memos": [ + { + "Memo": { + "MemoData": "72615F69463647446649705645756D6D346F306A69", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 93427580, + "Sequence": 93427586, + "SigningPubKey": "02F9157DFDE7BE71E317AE313431F615F689CA3D35B6526576DCCB06A300BB0B00", + "TakerGets": { + "currency": "534F4C4F00000000000000000000000000000000", + "issuer": "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz", + "value": "1242.164958" + }, + "TakerPays": "207798049", + "TransactionType": "OfferCreate", + "TxnSignature": "30440220730C11FABBFB3A2FCE986739BD266A72703EEA9FBE5AE1E340FEF5BC3F6C9ACB022053084B2D03E75865251CAA7E6844FA0534B177554C37DF3DA1CCB5610C59CAD9", + "hash": "3B611A7DC282C699F892C3AA7A8E341F7C19F4808A3C81022100F4845807C927", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rMdpzP6SSRcNDSgHQGGx4hV3qeRiuRoqQM", + "RootIndex": "1261DEF9887726607C6C931B6CB1FC7718B674821432D3E138A29F442DF00E45" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1261DEF9887726607C6C931B6CB1FC7718B674821432D3E138A29F442DF00E45", + "PreviousTxnID": "E73146697FC3AF801D269926CBAB42C213C247C9F75C3ED3ED877A5F2AFAB48D", + "PreviousTxnLgrSeq": 94084599 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rMdpzP6SSRcNDSgHQGGx4hV3qeRiuRoqQM", + "BookDirectory": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05EFF03E6DD571", + "BookNode": "0", + "Flags": 131072, + "OwnerNode": "0", + "PreviousTxnID": "21E15803D485279D93FA9E81FADA45AFC85FEEC77CEDA7BE16FCDBE872D8F342", + "PreviousTxnLgrSeq": 94084552, + "Sequence": 93427580, + "TakerGets": { + "currency": "534F4C4F00000000000000000000000000000000", + "issuer": "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz", + "value": "1240.808554" + }, + "TakerPays": "207362685" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "1D4CFB829C206E5EBBE8623D00AF36E343FE7E5984440BF32988390C1570C7D2" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rMdpzP6SSRcNDSgHQGGx4hV3qeRiuRoqQM", + "Balance": "52900295135", + "Flags": 0, + "OwnerCount": 8, + "Sequence": 93427587 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "2400FD7BAEE16FC502375E649183943F0987A083A221E3F964C1F29420326ACC", + "PreviousFields": { + "Balance": "52900295150", + "Sequence": 93427586 + }, + "PreviousTxnID": "E73146697FC3AF801D269926CBAB42C213C247C9F75C3ED3ED877A5F2AFAB48D", + "PreviousTxnLgrSeq": 94084599 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a05eff03e6dd571", + "Flags": 0, + "PreviousTxnID": "21E15803D485279D93FA9E81FADA45AFC85FEEC77CEDA7BE16FCDBE872D8F342", + "PreviousTxnLgrSeq": 94084552, + "RootIndex": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05EFF03E6DD571", + "TakerGetsCurrency": "534F4C4F00000000000000000000000000000000", + "TakerGetsIssuer": "1EB3EAA3AD86242E1D51DC502DD6566BD39E06A6", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05EFF03E6DD571" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05F17765F29399", + "NewFields": { + "ExchangeRate": "5a05f17765f29399", + "RootIndex": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05F17765F29399", + "TakerGetsCurrency": "534F4C4F00000000000000000000000000000000", + "TakerGetsIssuer": "1EB3EAA3AD86242E1D51DC502DD6566BD39E06A6" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "FC710194EE4E9513B6457ACA6519B5D78A65F368CC52C2D38937DA55B3FD3D84", + "NewFields": { + "Account": "rMdpzP6SSRcNDSgHQGGx4hV3qeRiuRoqQM", + "BookDirectory": "5C8970D155D65DB8FF49B291D7EFFA4A09F9E8A68D9974B25A05F17765F29399", + "Flags": 131072, + "Sequence": 93427586, + "TakerGets": { + "currency": "534F4C4F00000000000000000000000000000000", + "issuer": "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz", + "value": "1242.164958" + }, + "TakerPays": "207798049" + } + } + } + ], + "TransactionIndex": 71, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30424032, + "Sequence": 30424037, + "SigningPubKey": "037E9B02A63FFC298C82B66D250932A5DCF89361122925CB42339E3C769245084C", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "176755.7717946494" + }, + "TakerPays": "17515433570", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100A62F3632095B9B4C3618C8FE0F5FAC5C43F631ED48C8C3BC774BED7463BC35C102203BCA35EF482BDA4598BDF2F698F0E6FE435AED38251AD656C03D284C30913998", + "hash": "3B779F0C2BC5600A1D518E6C3579BCE0B06A96FD8D387A5EF61FDC9F80BB3872", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "03C6830B0A461DB11BD19348C50120B4DF23967669A79E53D3CDD49DE5BC62A6", + "NewFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923348B99CFE1AE", + "Sequence": 30424037, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "176755.7717946494" + }, + "TakerPays": "17515433570" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "591e54adce4d0d8a", + "Flags": 0, + "PreviousTxnID": "FF224E6F03687C941491CB28CDEB8755D7153418AB6A710509C2E07370B20A69", + "PreviousTxnLgrSeq": 94084600, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E54ADCE4D0D8A", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E54ADCE4D0D8A" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923348B99CFE1AE", + "NewFields": { + "ExchangeRate": "5923348b99cfe1ae", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923348B99CFE1AE", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Balance": "100882719", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30424038 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C84DB7EC299936754ADF7B0342A2E3B441F5076DAD476769D5021BA104BF9A7E", + "PreviousFields": { + "Balance": "100882734", + "Sequence": 30424037 + }, + "PreviousTxnID": "45BD6733BEAFCBC7801318C3A50E1703C2677E3556E36A188C804EA4D8104A02", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "RootIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E", + "PreviousTxnID": "45BD6733BEAFCBC7801318C3A50E1703C2677E3556E36A188C804EA4D8104A02", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E54ADCE4D0D8A", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "FF224E6F03687C941491CB28CDEB8755D7153418AB6A710509C2E07370B20A69", + "PreviousTxnLgrSeq": 94084600, + "Sequence": 30424032, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "94039.96246676243" + }, + "TakerPays": "8028525220" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "EEFF56B06376FD6630CF9B1096A636AA17BD3011975B60B37EFF0C82AD3F1D31" + } + } + ], + "TransactionIndex": 32, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30301443, + "Sequence": 30301447, + "SigningPubKey": "021C987881039AD42AEC336FB8460F1B1F4DDF0839CAF3EAB1AF69DDF8012C30A3", + "TakerGets": "13271946625", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "354764.1766493199" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100FC0BD74A683547E8D7A49480E7C527A8E0D5E77FB189066F4F1CA82EB5A02BF802204B933300AC700CF28FFA96CE3C9251974715C961C3DFC55CF2EA9DF27AA07304", + "hash": "3ECAFC64F36606DF8A7B2830E980FB239BD1EEE51692FDA8D4771ABF4971B407", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750097F1D2878BB51", + "NewFields": { + "ExchangeRate": "50097f1d2878bb51", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750097F1D2878BB51", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5009818628c803f2", + "Flags": 0, + "PreviousTxnID": "EED656A002B5FC4764F057E58438C5D82A4208102CE865EC3296C99C78B4F77B", + "PreviousTxnLgrSeq": 94084599, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475009818628C803F2", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475009818628C803F2" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Balance": "1000922622", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30301448 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7645DE0D353FF9ECB95EE6D8A5C51A666BBBA29860C30B45C529957871E586C1", + "PreviousFields": { + "Balance": "1000922637", + "Sequence": 30301447 + }, + "PreviousTxnID": "406CED51BD822DF4090D8C52EBF8A61A4969A77EA2F25C847BA4AC8662A8C16F", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475009818628C803F2", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "EED656A002B5FC4764F057E58438C5D82A4208102CE865EC3296C99C78B4F77B", + "PreviousTxnLgrSeq": 94084599, + "Sequence": 30301443, + "TakerGets": "5795580526", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "155071.6526757346" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "BF1399F9A44410F1FBAD7C9ACFC147C8539619C1A24B19FF6168E1AFFDF0D541" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "RootIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC", + "PreviousTxnID": "406CED51BD822DF4090D8C52EBF8A61A4969A77EA2F25C847BA4AC8662A8C16F", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "FA347E6AF4D36783F12CB763310A75269937AE488330F1A3CAB8056C942F91A1", + "NewFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750097F1D2878BB51", + "Sequence": 30301447, + "TakerGets": "13271946625", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "354764.1766493199" + } + } + } + } + ], + "TransactionIndex": 42, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30301442, + "Sequence": 30301446, + "SigningPubKey": "021C987881039AD42AEC336FB8460F1B1F4DDF0839CAF3EAB1AF69DDF8012C30A3", + "TakerGets": "5547233687", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "127907.3377608915" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100CCA49D2EB536366FBBAD35BE3346B5CE25C6FA3A444E7A35A29371F066347E7D02207846E87AD22C2D3130E21179059EF862915836146297E9A7D99AC3F20D1657A8", + "hash": "406CED51BD822DF4090D8C52EBF8A61A4969A77EA2F25C847BA4AC8662A8C16F", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008332DE3AEAE02", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "273FD50192D2B950C614CCF2715582AACD56CA88CAC6CE46E9B5BB67A64DAF71", + "PreviousTxnLgrSeq": 94084599, + "Sequence": 30301442, + "TakerGets": "18603240972", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "429376.1959869767" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "5E38ED107D608C8AE28DCB274D3EEE03BAEC0729BA55E0B419254BCEDFFE3316" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750083119A37A6D29", + "NewFields": { + "ExchangeRate": "50083119a37a6d29", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750083119A37A6D29", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5008332de3aeae02", + "Flags": 0, + "PreviousTxnID": "273FD50192D2B950C614CCF2715582AACD56CA88CAC6CE46E9B5BB67A64DAF71", + "PreviousTxnLgrSeq": 94084599, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008332DE3AEAE02", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008332DE3AEAE02" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Balance": "1000922637", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30301447 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7645DE0D353FF9ECB95EE6D8A5C51A666BBBA29860C30B45C529957871E586C1", + "PreviousFields": { + "Balance": "1000922652", + "Sequence": 30301446 + }, + "PreviousTxnID": "A2D199D8DE44D77342BE5940FC36B5A2E50A706F0F9709F4324A119DE4FB6A85", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "RootIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC", + "PreviousTxnID": "A2D199D8DE44D77342BE5940FC36B5A2E50A706F0F9709F4324A119DE4FB6A85", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "F5A5E6E33DCE1B3A5DD9DE1A252D4BADBE360F532B4801D3809C4662B57C8588", + "NewFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE1007994750083119A37A6D29", + "Sequence": 30301446, + "TakerGets": "5547233687", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "127907.3377608915" + } + } + } + } + ], + "TransactionIndex": 41, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961359, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": "1183614270", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2872.2294" + }, + "TicketSequence": 90961364, + "TransactionType": "OfferCreate", + "TxnSignature": "EBAA52D950A25B3F9374EBA3335BB1D031FD19F698610F54A65F9979C9E4804037090DD5C528F17C34DFE7EA9A85C45263CDE498E2D513374282D8B4AC3A350E", + "hash": "41C32E3263D805CA78BD473900F08B59EA64CE8DA5FE2F86D98C29C37643D6F2", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "ae9", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "44650ABA7C531D015C494FD4035E6CA76886D0147997E3EBFEAA72C74EFB4FD6", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "420596F8BB737A8A028A70AA4ACE69CEC3462B404CF01F9929DB945583E1A9DA", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F08CF4FC202", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961364, + "TakerGets": "1183614268", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2872.2294" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D", + "PreviousTxnID": "44650ABA7C531D015C494FD4035E6CA76886D0147997E3EBFEAA72C74EFB4FD6", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F08CF4FC202", + "NewFields": { + "ExchangeRate": "4f089f08cf4fc202", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F08CF4FC202", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB5CE391C5E01", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "750921282CF97DC237E0FEFB17DCC69A4433AFF3913DFB022E92BC7DD932C746", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961359, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1905.276500906764" + }, + "TakerPays": "788888690" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "674F45398F17B9CFBA015E6B2A5D5E95B2270A318EDD119990621160151F41BD" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421469", + "Flags": 0, + "OwnerCount": 37, + "Sequence": 90961404, + "TicketCount": 23 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421479", + "OwnerCount": 38, + "TicketCount": 24 + }, + "PreviousTxnID": "44650ABA7C531D015C494FD4035E6CA76886D0147997E3EBFEAA72C74EFB4FD6", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0eb5ce391c5e01", + "Flags": 0, + "PreviousTxnID": "750921282CF97DC237E0FEFB17DCC69A4433AFF3913DFB022E92BC7DD932C746", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB5CE391C5E01", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB5CE391C5E01" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961364 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "DDF2C063FEADD8B29743C8231B36DA091BDD497244FC8C470CB2988CF4801623" + } + } + ], + "TransactionIndex": 19, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 167782388, + "Sequence": 167782399, + "SigningPubKey": "0253C1DFDCF898FE85F16B71CCE80A5739F7223D54CC9EBA4749616593470298C5", + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "456048" + }, + "TakerPays": "200000000000", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100EFE21EE9A631DC4FA3E153749AF6EE9E7E3C59F6E98AE8FE85CE21599B2808EE02206471253CD1E21930613FB436E0BBD9471B6C726D477648FA4AFD7ED4F9BFA918", + "hash": "43293CB7CA7BD8540D3783FF0060B4E812CFBD15E6ADC069EA19077CD4B7E507", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "RootIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3", + "PreviousTxnID": "7DE34555988BFD9537C2C558DC51EA64F6BFFFCF33EA70DCDEEF94D1E5408001", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "0DFBABA66100106406A86619538778D95A13AB39387032D722B4E72E693E02F7", + "NewFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F94978D2FDC66", + "Sequence": 167782399, + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "456048" + }, + "TakerPays": "200000000000" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Balance": "15035590610", + "Flags": 0, + "OwnerCount": 17, + "Sequence": 167782400 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1ED8DDFD80F275CB1CE7F18BB9D906655DE8029805D8B95FB9020B30425821EB", + "PreviousFields": { + "Balance": "15035590630", + "Sequence": 167782399 + }, + "PreviousTxnID": "7DE34555988BFD9537C2C558DC51EA64F6BFFFCF33EA70DCDEEF94D1E5408001", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0f92297ef8238b", + "Flags": 0, + "PreviousTxnID": "079783E5B7EB1D31C238E604032086591D90985C67B58F4DCE95A59B62132DFD", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F92297EF8238B", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F92297EF8238B" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F94978D2FDC66", + "NewFields": { + "ExchangeRate": "5a0f94978d2fdc66", + "RootIndex": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F94978D2FDC66", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "F0B9A528CE25FE77C51C38040A7FEC016C2C841E74C1418D5A0F92297EF8238B", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "079783E5B7EB1D31C238E604032086591D90985C67B58F4DCE95A59B62132DFD", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 167782388, + "TakerGets": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "456325.9999999999" + }, + "TakerPays": "200000000000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "F41E142B35C6748A43DE04CF5805CE5E33AECA7D1BFE86F8001279B41CDBBEFB" + } + } + ], + "TransactionIndex": 37, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961363, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": "789076180", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1912.91004" + }, + "TicketSequence": 90961353, + "TransactionType": "OfferCreate", + "TxnSignature": "CAE3493AD6DBBFFD9AA1077FD3DBAC71F06AE10AFCF20865F29041A783B066CB5C84CBC7652E319ABB98A6A6C6B05B975DDB400240C56F30986A9F4237D1DB0E", + "hash": "44650ABA7C531D015C494FD4035E6CA76886D0147997E3EBFEAA72C74EFB4FD6", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "1348D7498E768827D182D4F78560A4F418F6585B423D017840E2B6FA9DA4725F", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089CD597AB82DC", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961353, + "TakerGets": "789075855", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1912.91004" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "ae9", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "D19E12FE05E46721200731AE1139CD387856A40BA672C9E4A1B72816AC492CBC", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D", + "PreviousTxnID": "D19E12FE05E46721200731AE1139CD387856A40BA672C9E4A1B72816AC492CBC", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089CD597AB82DC", + "NewFields": { + "ExchangeRate": "4f089cd597ab82dc", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089CD597AB82DC", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB20923DBB400", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "46F2ACC03098D522C51262D955D6624F96775C266DE6180E1B719A80EBF09315", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961363, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1907.185737749861" + }, + "TakerPays": "788888690" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "979CE9E7D42B501D532A7C60AF90457EE9DDE2EA396D132C8DE03191F1CD7F4D" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421479", + "Flags": 0, + "OwnerCount": 38, + "Sequence": 90961404, + "TicketCount": 24 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421489", + "OwnerCount": 39, + "TicketCount": 25 + }, + "PreviousTxnID": "D19E12FE05E46721200731AE1139CD387856A40BA672C9E4A1B72816AC492CBC", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0eb20923dbb400", + "Flags": 0, + "PreviousTxnID": "46F2ACC03098D522C51262D955D6624F96775C266DE6180E1B719A80EBF09315", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB20923DBB400", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB20923DBB400" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961353 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "E533C261FD372F8735024CFAA5FA484DE27E52EB52FF46D0FD4C460033A961A4" + } + } + ], + "TransactionIndex": 18, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "", + "Fee": "0", + "LedgerSequence": 94084608, + "Sequence": 0, + "SigningPubKey": "", + "TransactionType": "UNLModify", + "UNLModifyDisabling": 1, + "UNLModifyValidator": "ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818", + "hash": "4489EC9209A02221FBFADE49CFD09C93D46C2AF3B0878FC2A8767B2F21DFA9BB", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "NegativeUNL", + "LedgerIndex": "2E8A59AA9D3B5B186B0B9E0F62E6C02587CA74A4D778938E957B6357D364B244", + "NewFields": { + "ValidatorToDisable": "ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818" + } + } + } + ], + "TransactionIndex": 8, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30424033, + "Sequence": 30424036, + "SigningPubKey": "037E9B02A63FFC298C82B66D250932A5DCF89361122925CB42339E3C769245084C", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "52665.90334952954" + }, + "TakerPays": "4501851770", + "TransactionType": "OfferCreate", + "TxnSignature": "304402200B1B629D23C9758A598775822D29163FF5E5CDD99D6A94C7389FAC33B5896065022079B8B01C4B9DBDFAEAE2F9C0EEFBFD5666F9F11C94D23727BA4460B4441AB42C", + "hash": "45BD6733BEAFCBC7801318C3A50E1703C2677E3556E36A188C804EA4D8104A02", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E5E4F3C1757FC", + "NewFields": { + "ExchangeRate": "591e5e4f3c1757fc", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E5E4F3C1757FC", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5923296540698951", + "Flags": 0, + "PreviousTxnID": "63528D19791CB93D762CEEDB1C5AEBF08538C8C75F2F51A340E52E6981272F32", + "PreviousTxnLgrSeq": 94084600, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923296540698951", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923296540698951" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "857A7A3B7BB47945C860F9B0B606F1E52DF85FD932F15B7763C3FA7A317F51B2", + "NewFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591E5E4F3C1757FC", + "Sequence": 30424036, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "52665.90334952954" + }, + "TakerPays": "4501851770" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975923296540698951", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "63528D19791CB93D762CEEDB1C5AEBF08538C8C75F2F51A340E52E6981272F32", + "PreviousTxnLgrSeq": 94084600, + "Sequence": 30424033, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "185726.1128283087" + }, + "TakerPays": "18381571609" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "88F098A28BD29A7FA30657C7BF5D894FCEC69BD36462CE066067DC26006A53E2" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Balance": "100882734", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30424037 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C84DB7EC299936754ADF7B0342A2E3B441F5076DAD476769D5021BA104BF9A7E", + "PreviousFields": { + "Balance": "100882749", + "Sequence": 30424036 + }, + "PreviousTxnID": "DFE5582189D6192497C1199E17AA699F8D7F6226FCB8AA96F7BE4511BD2F3059", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "RootIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E", + "PreviousTxnID": "DFE5582189D6192497C1199E17AA699F8D7F6226FCB8AA96F7BE4511BD2F3059", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 31, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rGDreBvnHrX1get7na3J4oowN19ny4GzFn", + "Amount": "68761969", + "DeliverMax": "68761969", + "Destination": "rpWJmMcPM4ynNfvhaZFYmPhBq5FYfDJBZu", + "DestinationTag": 1122005580, + "Fee": "20", + "Flags": 2147483648, + "LastLedgerSequence": 94085606, + "Sequence": 1132117, + "SigningPubKey": "02024F808D657322E73CEA9A0109CDBD9A3A56552CA87F847DD8558B47CD0F2E20", + "TransactionType": "Payment", + "TxnSignature": "3044022069269A524D6D731D35F537EBA7083380C34677A6DC7457AB9203940C01A2551B0220542B8F4F16FBFA9220C3FD90EFD65F4B26CA47117915B77BA4CBEBF0E9ECB2D2", + "hash": "4818FF59B8076B61E426F7533F602996D9216BF6C1496114692F2F99C92B7468", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGDreBvnHrX1get7na3J4oowN19ny4GzFn", + "Balance": "38870777688956", + "Flags": 131072, + "OwnerCount": 1, + "Sequence": 1132118 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8719BD164C9F79A760E19FB64691885E63CC595032E559971F89C1E22EAEC220", + "PreviousFields": { + "Balance": "38870846450945", + "Sequence": 1132117 + }, + "PreviousTxnID": "99CF320E484C82618E461F1EBA881482EB9CE52D74A222DFE06FEE8AE300AE5E", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpWJmMcPM4ynNfvhaZFYmPhBq5FYfDJBZu", + "Balance": "102773830", + "Flags": 1179648, + "OwnerCount": 3, + "RegularKey": "rMCsK7mwSfayZvTuXgJN2u3DgSb33B72KM", + "Sequence": 78729447 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B3230D19A69EBE012B952C35D2542497A641BF9A669E8F10A5D9DE3A29D27512", + "PreviousFields": { + "Balance": "34011861" + }, + "PreviousTxnID": "67416F7C98E4B15E68EA0334750E079334687D745EB97A856FE3375933DF1371", + "PreviousTxnLgrSeq": 94084592 + } + } + ], + "TransactionIndex": 59, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "68761969" + } + }, + { + "Account": "rMTRWSAJ95hAEvCbymzixnshmBxRAR24u8", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "464D4C4652000000000000000000000000000000", + "issuer": "rUe41xMLKy1NVdLQD6cdZftKMhEwDaRJkf", + "value": "0" + }, + "Sequence": 92792887, + "SigningPubKey": "EDB288AD30C12F5BB6E624AD5AA1928E0E776F2550829FDEB0B446F9F498941F23", + "TransactionType": "TrustSet", + "TxnSignature": "13F1CDC8D31313D94B540F3DB79389CE2B58FB6E8A56AB86A1015BCF44FD12D8E29E50D49965B24D28D8C305DE0BC6B4FB3B72EE08BAB7522B1D254406B9AF0A", + "hash": "54B9C95ECB158ADB05123489313B0945BD7055F473A04EAEC78D20E6985B365F", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rMTRWSAJ95hAEvCbymzixnshmBxRAR24u8", + "Balance": "29310034", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92792888, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5D6D4FD68FD53B048F6BA3B80C0A281B1024CB2153AF02D8CAAABF237F102F61", + "PreviousFields": { + "Balance": "29310046", + "Sequence": 92792887 + }, + "PreviousTxnID": "3946A1C56B20BE215D1522C783121FB7BCE37B8B0449BE485C05CA4BCD6534C3", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 70, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "994.7055173312917" + }, + "DeliverMax": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "994.7055173312917" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0.000002994714810208623" + }, + "Sequence": 29665817, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "0E2D4C618E5D10662C9BCBEF68F6CE2C902BA0C299A095FD24CCBD07F5DC6B02121C564953A815BF349981F39825B47B27280D481EA320D7B84122507A1BB401", + "hash": "57020451A032CE52054116D073D9015DC7515F4645CA24514B35FEC079971FFE", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.01115925304089892" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "MAG", + "issuer": "rfQYvidA2byigrb54AVH5kYWQteejseZma", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0" + }, + "LowNode": "27c" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "35F3441C51A649AA9B13DCF25C7707319036A4EE2F557E66733A480EB81C3ECA", + "PreviousFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.01115640810029708" + } + }, + "PreviousTxnID": "842C902D24727B066525EC681B562AFEFF28B6645C479A41A7748FC865A40B8A", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "3900728.431313441" + }, + "Flags": 16842752, + "HighLimit": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "0" + }, + "HighNode": "344", + "LowLimit": { + "currency": "OVO", + "issuer": "rfQYvidA2byigrb54AVH5kYWQteejseZma", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "4C3034DECE93CDBBB64431F07ECDD538D82F2AAA7A27A462B0B6FC02D0CF767E", + "PreviousFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "3901723.136830772" + } + }, + "PreviousTxnID": "842C902D24727B066525EC681B562AFEFF28B6645C479A41A7748FC865A40B8A", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.0000000005401262636" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "MAG", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "HighNode": "8", + "LowLimit": { + "currency": "MAG", + "issuer": "rXmagwMmnFtVet3uL26Q2iwk287SRvVMJ", + "value": "0" + }, + "LowNode": "214" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "6AEDB0D2B26C22AC4401CBDCEB4181C26081FE867AC3A8C233488A6D66724DE8", + "PreviousFields": { + "Balance": { + "currency": "MAG", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-0.0000028454807281036" + } + }, + "PreviousTxnID": "1A08D366FC1A816E504CD9F819D35801A1F49429C031A917624B24E780D4631D", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "273266.3400572504" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "0" + }, + "HighNode": "33e", + "LowLimit": { + "currency": "OVO", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CF7D03A277BB38033EE1039387650B3720EB33056781C1BE75B19A4FC6B999AD", + "PreviousFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "272271.6345399191" + } + }, + "PreviousTxnID": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "57020451A032CE52054116D073D9015DC7515F4645CA24514B35FEC079971FFE", + "Balance": "97189454", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665818 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "1A08D366FC1A816E504CD9F819D35801A1F49429C031A917624B24E780D4631D", + "Balance": "97189464", + "Sequence": 29665817 + }, + "PreviousTxnID": "1A08D366FC1A816E504CD9F819D35801A1F49429C031A917624B24E780D4631D", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 15, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "994.7055173312917" + } + } + }, + { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 144101818, + "Sequence": 144101822, + "SigningPubKey": "022D40673B44C82DEE1DDB8B9BB53DCCE4F97B27404DB850F068DD91D685E337EA", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "82658.86895481257" + }, + "TakerPays": "5743342117", + "TransactionType": "OfferCreate", + "TxnSignature": "30450221008846E77A0EF45277E8321F35CD57B7EAB4C7A928CBF7A8571101BB028043BB080220033F6F5794604F30CB14B2EF74E33DCFD15BB4BD1EC1EAE334B7E7FACFCED7C7", + "hash": "600406517AEF040B3234E374B6FD1559E7B9B96CC1947C5248E7C0124C9DD7A6", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5918abff3089068d", + "Flags": 0, + "PreviousTxnID": "F83E8FE81619B5AE8F5543EA659A11ECF514A9090D7CD50CCB1B182B8A20FF5F", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918ABFF3089068D", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918ABFF3089068D" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918AF64BF1C1F4E", + "NewFields": { + "ExchangeRate": "5918af64bf1c1f4e", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918AF64BF1C1F4E", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918ABFF3089068D", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "F83E8FE81619B5AE8F5543EA659A11ECF514A9090D7CD50CCB1B182B8A20FF5F", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 144101818, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "337530.384047471" + }, + "TakerPays": "23439837890" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "48A3BBF2BF765C255E39089F869075205D2B4EA198F36ABEE037CC0CE5B25748" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "518CC34CFC1A2F5F640B1578205837CFD34705D5E81BE65285F6B82B0905D167", + "NewFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975918AF64BF1C1F4E", + "Sequence": 144101822, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "82658.86895481257" + }, + "TakerPays": "5743342117" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "RootIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A", + "PreviousTxnID": "FE286600AC66A0438D0E01B5BA59E1EEAA0106A979248330E52D15C23F2416A2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Balance": "100345337", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 144101823 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E0311EB450B6177F969B94DBDDA83E99B7A0576ACD9079573876F16C0C004F06", + "PreviousFields": { + "Balance": "100345352", + "Sequence": 144101822 + }, + "PreviousTxnID": "FE286600AC66A0438D0E01B5BA59E1EEAA0106A979248330E52D15C23F2416A2", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 1, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "366B536959564B4F33575A63375048345557343464", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "Sequence": 97505280, + "SigningPubKey": "034D6788B751D18BBE92CAF1255431512D6D187446D47FAEE20FDB0BFA8144DB1E", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "37959.345843" + }, + "TakerPays": { + "currency": "ETH", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "14.559" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "30450221008899738092758F4061E79C1F9744EEB63B080D561C38792974BB72CCF9A456A602203F9505117885B7FFD64E36C74E0AD717FC739F2A0C63B1E8E0C37664790AA024", + "hash": "60E05E95317698F61A0737910912AED820EB0E49DF590A7FC878ABCE02547263", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "4327BA72D34E3964EE58A909DB6EB2ACB4F16B440CC3A8DE510DA04B4EAA1800", + "NewFields": { + "ExchangeRate": "510da04b4eaa1800", + "RootIndex": "4327BA72D34E3964EE58A909DB6EB2ACB4F16B440CC3A8DE510DA04B4EAA1800", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000004554480000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "6B9142712FC5AA9F80E02FDF5CD6E6A6D1ECD03F44B6B17CB897A946BCCD7952", + "NewFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "BookDirectory": "4327BA72D34E3964EE58A909DB6EB2ACB4F16B440CC3A8DE510DA04B4EAA1800", + "OwnerNode": "1", + "Sequence": 97505280, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "37959.33691746928" + }, + "TakerPays": { + "currency": "ETH", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "14.559" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Balance": "60817108128", + "Flags": 0, + "OwnerCount": 34, + "Sequence": 97505281 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "6BC9286C5146B76D0D140873B509D72581AABEB79037BF1D9849830FBF5A9FE6", + "PreviousFields": { + "Balance": "60817108143", + "OwnerCount": 33, + "Sequence": 97505280 + }, + "PreviousTxnID": "44848B0C47923D08667AEE57B80676EB6659E41BE180A5A00C30CBF78EFA4F65", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "RootIndex": "49B537464A9659478275132402EB6D5E8723F42ED20DB3CF4A4527A9A3F1589A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E06052755A83D52A63C3392B87634326BE0E4E68ECB59B7DF3A2B1851229208D", + "PreviousTxnID": "44848B0C47923D08667AEE57B80676EB6659E41BE180A5A00C30CBF78EFA4F65", + "PreviousTxnLgrSeq": 94084607 + } + } + ], + "TransactionIndex": 44, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpWtr31qKz6rDzGZfhMUF1NroWiXZDziya", + "Amount": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "999999999" + }, + "DeliverMax": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "999999999" + }, + "DeliverMin": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "1.5" + }, + "Destination": "rpWtr31qKz6rDzGZfhMUF1NroWiXZDziya", + "Fee": "12", + "Flags": 131072, + "LastLedgerSequence": 94084626, + "SendMax": "1500000", + "Sequence": 93772863, + "SigningPubKey": "ED79AA87E74CA9A61EDA6A83CB714652A9154AF5104642E7462C89C4A536AA2939", + "TransactionType": "Payment", + "TxnSignature": "490E0594D699558D93B216A77851CB58148280E2D485E60004C2B7248EB98331ED1E0D025327B0475DE3EC467C96C3628295F4E02839761643CEB9644A7B8C00", + "hash": "78927D8976AE70F0007E00D8A60F40391394E8E827B0B57CC948BFA0A527854D", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "1D4DD25AFEA11FC87958159344FD6398D64C88D92CFB23EFC266C3C061E5E260", + "Account": "rPL2Lit8teVgm68UVEsoU6Qb97TUJHFRd4", + "Balance": "4044762378", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 93130999 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7179192B121AA0A83CEDBC730EF186F7834579EDAF4E2FED35BC81C68C0D3D3A", + "PreviousFields": { + "Balance": "4043262378" + }, + "PreviousTxnID": "2B8603869E1185C3CE2EF692528980D01047C3D31A4CABB1EC287B286E38B5AD", + "PreviousTxnLgrSeq": 94084603 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpWtr31qKz6rDzGZfhMUF1NroWiXZDziya", + "Balance": "6598338", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 93772864 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "D21C2B61C5ED71CDA15A100C9322CE5F31871841776B14E295C26924ABA5C58F", + "PreviousFields": { + "Balance": "8098350", + "Sequence": 93772863 + }, + "PreviousTxnID": "D04FAEC7612E01E48CBCF75B002615F285AEE63CB1F734115A5E7C480965E697", + "PreviousTxnLgrSeq": 94084601 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "28681.45873443" + }, + "Flags": 65536, + "HighLimit": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "0" + }, + "HighNode": "4a", + "LowLimit": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rpWtr31qKz6rDzGZfhMUF1NroWiXZDziya", + "value": "99999999" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "F029ED3BE4C82EC0E1DE3F470FEBE2B59B06C2C5E32E1DFD400146358F28DAAC", + "PreviousFields": { + "Balance": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "E3376A5EA44AA36586A3217BF77075382760E25A82764759A17FE0D4E30B1346", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-77541406.67596129" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rPL2Lit8teVgm68UVEsoU6Qb97TUJHFRd4", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "0" + }, + "LowNode": "6" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "FAC08FA3F02DC4218C01347A616F1EB2F6A53C0CEC562864F3CF638C5EF6D535", + "PreviousFields": { + "Balance": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-77570088.13469572" + } + }, + "PreviousTxnID": "2B8603869E1185C3CE2EF692528980D01047C3D31A4CABB1EC287B286E38B5AD", + "PreviousTxnLgrSeq": 94084603 + } + } + ], + "DeliveredAmount": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "28681.45873443" + }, + "TransactionIndex": 16, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "5842415200000000000000000000000000000000", + "issuer": "rBbpmcuvmokBb7yFR6ZE8fNHbBLskyR8Ar", + "value": "28681.45873443" + } + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Sequence": 123729334, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "19.23285903654403" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "2479.798296306323" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "30440220393A643D6A8A78DD098FAA66450E2DD9C80F6268F76DF0453BA080635C8993E60220763D52B78CE84AD58E05C12C2162F812311D907CCBE450254F360FE5063E9B79", + "hash": "7C921B51A7FDB340DEEA210162FAD24366FC869904EB42CED6E9D6E682F6A309", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "19b14", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "9DBB7ADE16C6B4D763193B6D41161ACF6E93F22C6F4401FFC89B89ADCC378328", + "PreviousTxnID": "8875B2DBC3122739C9084140C33525B198E6FED0B2DC63CB8623485AC056D6A1", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028965", + "Flags": 0, + "OwnerCount": 137, + "Sequence": 123729335 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028975", + "OwnerCount": 136, + "Sequence": 123729334 + }, + "PreviousTxnID": "B83FC54EA93F2FCDDC1B982F784F63422D55FB6EE93258CAB077D473A49557C4", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "NewFields": { + "ExchangeRate": "570494a95ac3ae00", + "RootIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "TakerGetsCurrency": "0000000000000000000000004C54430000000000", + "TakerGetsIssuer": "06B36AC50AC7331069070C6350B202EAF2125C7C", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "E3555A7EA5B71BE132F1156144BA06C11C34FEECA6246B4565AFD43D54D56270", + "NewFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "OwnerNode": "19b15", + "Sequence": 123729334, + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "19.23285903654403" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "2479.798296306323" + } + } + } + } + ], + "TransactionIndex": 51, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Amount": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "1936.394762081382" + }, + "DeliverMax": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "1936.394762081382" + }, + "Destination": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "341462.487829553" + }, + "Sequence": 94793204, + "SigningPubKey": "ED9C7A917E06AE3550AEA072D25D3EAABDBB8D6AC1A1C0AF316866082D10145FF6", + "TransactionType": "Payment", + "TxnSignature": "CF7ECD5DBFFB285DBD3D5B3CDB362A5735A9F0061076F4FE4D14DDBD86856861284AE2DED56D29F9BB791A63F09993F3DBF508E6431FFAF513576CD70DDBD60A", + "hash": "7D3D5A6EABDE581B58CEC2CD03354BB4C0CCF37DDEABFBEE130F6CBC78BEE2C2", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-24004649.94610649" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rKNa1o3U7KKQJRBvXBQKdicqxARSWtV1D6", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "0" + }, + "LowNode": "14" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "054AA80318ED99E34DBF75EA0EEA8F4DE21BD52259760882FA454508FAC03805", + "PreviousFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-23734325.47657476" + } + }, + "PreviousTxnID": "F8D26FD33FD5361C1C5F293213512D6D136FCC1D562FD7BD626F55282CECDA1D", + "PreviousTxnLgrSeq": 94084409 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Balance": "5611216625", + "Flags": 0, + "OwnerCount": 1237, + "Sequence": 94793205 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7A794B5256B0129A726B10E003DC3EF737C4FB00216A74A2560B0B544D702136", + "PreviousFields": { + "Balance": "5611216635", + "Sequence": 94793204 + }, + "PreviousTxnID": "B7F6C0B673059887974E71DD5C50FAA1AE1F6D3A3893B2DA4455F2F6CEA85FCD", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "0" + }, + "HighNode": "13", + "LowLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "value": "9999999999999999e80" + }, + "LowNode": "a3" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "97EE65EC49FBD6A89E785DB49AEC04E11936B0017382C623F0B4266801C41F6C", + "PreviousFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "270324.4695317294" + } + }, + "PreviousTxnID": "B7F6C0B673059887974E71DD5C50FAA1AE1F6D3A3893B2DA4455F2F6CEA85FCD", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-143193.6567691495" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rKNa1o3U7KKQJRBvXBQKdicqxARSWtV1D6", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "0" + }, + "LowNode": "34c" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "B4F01D208B9BFC5C630BBE1525BD724D1A2CED0751BF9B803B7A954A3EC0AB69", + "PreviousFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-144808.2660341646" + } + }, + "PreviousTxnID": "F8D26FD33FD5361C1C5F293213512D6D136FCC1D562FD7BD626F55282CECDA1D", + "PreviousTxnLgrSeq": 94084409 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1614.6092650151" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "0" + }, + "HighNode": "336", + "LowLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "value": "9999999999999999e80" + }, + "LowNode": "95" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "BDDB87931825E4185EA1FD9EAF134270EBC1F74BBDFA967F67C511B5FC8034F4", + "PreviousFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "B6B97B64C5EBDC851491FBCB461D943A97E7F6E46DFCC5DE5E79F1A2F7D527AE", + "PreviousTxnLgrSeq": 94084569 + } + } + ], + "DeliveredAmount": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "1614.6092650151" + }, + "TransactionIndex": 5, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "1614.6092650151" + } + } + }, + { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 167782387, + "Sequence": 167782398, + "SigningPubKey": "0253C1DFDCF898FE85F16B71CCE80A5739F7223D54CC9EBA4749616593470298C5", + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "36936.61555142501" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402206AAC240E20F376964DA5364BC14BF946DA5351066BEDF26EE5087E94C42A852402201C170D16E4A94C45FE9E761B9E332DD385D1C6F1A2798F3BD5C67BA36E3D1785", + "hash": "7DE34555988BFD9537C2C558DC51EA64F6BFFFCF33EA70DCDEEF94D1E5408001", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "RootIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3", + "PreviousTxnID": "AFBC4B1DEE866310A10586B8A1F2C3BB00044FB3D20111BD3488E3E5B3DA5F28", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Balance": "15035590630", + "Flags": 0, + "OwnerCount": 17, + "Sequence": 167782399 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1ED8DDFD80F275CB1CE7F18BB9D906655DE8029805D8B95FB9020B30425821EB", + "PreviousFields": { + "Balance": "15035590650", + "Sequence": 167782398 + }, + "PreviousTxnID": "AFBC4B1DEE866310A10586B8A1F2C3BB00044FB3D20111BD3488E3E5B3DA5F28", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C95312966540", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "76C67ABC686A0553EA08EB6165D87E350732730B58BB54A25D826F1E77C51F9B", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 167782387, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "36936.621376075" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "86F0CC0375BEB2A2DA9B344C162267B9BBFC2C566E3ACBAC532083DD4592B112" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "DAA69EBFB86F266EEFAC3D21491B894E6643D7F2AC4CF5E2EBFD6696836305A7", + "NewFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C952FB5777C1", + "Sequence": 167782398, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "36936.61555142501" + } + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C952FB5777C1", + "NewFields": { + "ExchangeRate": "4f08c952fb5777c1", + "RootIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C952FB5777C1", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f08c95312966540", + "Flags": 0, + "PreviousTxnID": "76C67ABC686A0553EA08EB6165D87E350732730B58BB54A25D826F1E77C51F9B", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C95312966540", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F08C95312966540" + } + } + ], + "TransactionIndex": 36, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpgtbNuTeDtdBmLpjsL8KsdoukciuNSLtf", + "Amount": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rwCq6TENSo3Hh9LKipXnLaxaeXBXKubqki", + "value": "10641756.560621" + }, + "Amount2": "99666", + "Asset": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rwCq6TENSo3Hh9LKipXnLaxaeXBXKubqki" + }, + "Asset2": { + "currency": "XRP" + }, + "Fee": "12", + "Flags": 1048576, + "LastLedgerSequence": 94084626, + "Memos": [ + { + "Memo": { + "MemoData": "414D4D206465706F73697420696E69746961746564207669612058506D61726B65742E636F6D" + } + } + ], + "Sequence": 66662783, + "SigningPubKey": "02E1CC3E19157793F049F7CAC05FF774FAEE492153DEBF8B3CD66A3DB62CC9906C", + "SourceTag": 20221212, + "TransactionType": "AMMDeposit", + "TxnSignature": "3044022037A21C729887EC83B5089B9B60BC9B60558167BF6DBE52283DF67F8A7743701E0220722B939C7CE1AA49E57D8D1435F09B20DBD9AB8668BAEFC5AE0CF483B1D7C0B1", + "hash": "7F724230178309775772D7AFFEBFF9DD709BD943704C67B29753E0693D8A9E06", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "19979315.9906" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "value": "0" + }, + "HighNode": "33", + "LowLimit": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rpgtbNuTeDtdBmLpjsL8KsdoukciuNSLtf", + "value": "0" + }, + "LowNode": "10" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "13CDEF389DB820B1DD9C01FB88AF9B4206326D320A2DD8539C5E502069283D4D", + "PreviousFields": { + "Balance": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "19151789.9287" + } + }, + "PreviousTxnID": "04469ECB8605454A5976AC06D0879DDDBC2AE422060EBEF4A77FE4B44D1002D5", + "PreviousTxnLgrSeq": 94062134 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rwCq6TENSo3Hh9LKipXnLaxaeXBXKubqki" + }, + "AuctionSlot": { + "Account": "rbBfeoq9ZzYhwzCzR3ssD2x79GXPrNkXy", + "DiscountedFee": 33, + "Expiration": 791777280, + "Price": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "value": "45000000" + } + }, + "Flags": 0, + "LPTokenBalance": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "value": "3310128109714975e-4" + }, + "OwnerNode": "0", + "TradingFee": 339, + "VoteSlots": [ + { + "VoteEntry": { + "Account": "rLPbfj4zv3t7xCVvcGS9QopcxtfT5isS2m", + "VoteWeight": 57686 + } + }, + { + "VoteEntry": { + "Account": "rwSbj4GbJSxWEvDHhkN4ma54ZQ4NhAJGVn", + "TradingFee": 1000, + "VoteWeight": 126 + } + }, + { + "VoteEntry": { + "Account": "rh1DG8rSu7VCg7WZoNuKbubaKb8aXM1iu4", + "TradingFee": 1000, + "VoteWeight": 1707 + } + }, + { + "VoteEntry": { + "Account": "rxVZ3Z7bdjDmZDkCHhjAJDBK43dUzhvmP", + "TradingFee": 1000, + "VoteWeight": 27518 + } + }, + { + "VoteEntry": { + "Account": "rPSpbdtRc1gwvyHkq1qw86XFaF6VKfqr9S", + "TradingFee": 1000, + "VoteWeight": 61 + } + }, + { + "VoteEntry": { + "Account": "ra3urKnAtu3R96Cc3G7k46dWRWFkZtCEAb", + "TradingFee": 1000, + "VoteWeight": 34 + } + }, + { + "VoteEntry": { + "Account": "rfGvXTdJhQkuTV8XBTGeiTNhKWQMJoBVzk", + "TradingFee": 1000, + "VoteWeight": 85 + } + }, + { + "VoteEntry": { + "Account": "rUKt9SX1XcQA8q4QEvcGzXdMsar123FLKn", + "TradingFee": 1000, + "VoteWeight": 108 + } + } + ] + }, + "LedgerEntryType": "AMM", + "LedgerIndex": "33A29FF46A9C5BD2E67936FC7E895026763ECCD54BED68573692253339DA4171", + "PreviousFields": { + "LPTokenBalance": { + "currency": "03ED41506EA49D3D0F6B7C8212D3C5DA22C2C8B1", + "issuer": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "value": "3310119834454356e-4" + } + }, + "PreviousTxnID": "B47160AA7D90A20CAE59D7A2871DBD11F66CE52BC157D21A6C3CFB937D9113C3", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-4256714378784309e-3" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rwCq6TENSo3Hh9LKipXnLaxaeXBXKubqki", + "value": "0" + }, + "LowNode": "1" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "6BAF5F3BAE5160263E3E2802B305DB39EF84F003EDF9BB1A6B2D606620ED22E5", + "PreviousFields": { + "Balance": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-4256703737075077e-3" + } + }, + "PreviousTxnID": "B47160AA7D90A20CAE59D7A2871DBD11F66CE52BC157D21A6C3CFB937D9113C3", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "47.32837164" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rwCq6TENSo3Hh9LKipXnLaxaeXBXKubqki", + "value": "0" + }, + "HighNode": "1ba", + "LowLimit": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rpgtbNuTeDtdBmLpjsL8KsdoukciuNSLtf", + "value": "9999641898297400e-2" + }, + "LowNode": "10" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "A08F622AD4DC9088B2F2E4C7B26ABB745B2B3BA9B8F49093CEB9CADBA3BDF3F7", + "PreviousFields": { + "Balance": { + "currency": "504F4E474F000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "10641756.56062187" + } + }, + "PreviousTxnID": "F31D8D3A7EF4A6B712003418154D65CA77BB4B2A1A9A670C714FD2310F10B957", + "PreviousTxnLgrSeq": 94084600 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "33A29FF46A9C5BD2E67936FC7E895026763ECCD54BED68573692253339DA4171", + "Account": "rP5J7x4HyHKQUUfrfzvuq28iLwiKPf7yv5", + "Balance": "39866687388", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 92512005 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB585F5087494DC672D8EF59A0EBDA1D5E847B6CE2E36EC5B5121817C9D276E6", + "PreviousFields": { + "Balance": "39866587722" + }, + "PreviousTxnID": "650305AC3EDD5A1093FB8055E951E48389FE325B50E685136BEFCFC4A463C567", + "PreviousTxnLgrSeq": 94084601 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpgtbNuTeDtdBmLpjsL8KsdoukciuNSLtf", + "Balance": "933422329", + "Flags": 0, + "OwnerCount": 388, + "Sequence": 66662784 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C2145E8D25C3233E0866BBC1B478BFB47233D415B69F8210A6EB312DD179CE00", + "PreviousFields": { + "Balance": "933522007", + "Sequence": 66662783 + }, + "PreviousTxnID": "F31D8D3A7EF4A6B712003418154D65CA77BB4B2A1A9A670C714FD2310F10B957", + "PreviousTxnLgrSeq": 94084600 + } + } + ], + "TransactionIndex": 17, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 167782385, + "Sequence": 167782396, + "SigningPubKey": "0253C1DFDCF898FE85F16B71CCE80A5739F7223D54CC9EBA4749616593470298C5", + "TakerGets": "14935000000", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "37929.8221" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402207FC24417C280A877581BBDB065D1177D45FB44B27574F73EE23400B1DB66EC7F02207BFC0FD2F51E37EFE8527E61FC78AED52EB1B26F10C5F1A6B39E022CC900174C", + "hash": "7F95B207AEF1A05E5CE0814A865A067F540B425E26AD4650498B72311CF2ECE1", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "RootIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3", + "PreviousTxnID": "1CCA9507B308F8DF78DBFED8F4030D0EC9B188E98AFFCB19EA0CDEDD317618ED", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Balance": "15035590670", + "Flags": 0, + "OwnerCount": 17, + "Sequence": 167782397 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1ED8DDFD80F275CB1CE7F18BB9D906655DE8029805D8B95FB9020B30425821EB", + "PreviousFields": { + "Balance": "15035590690", + "Sequence": 167782396 + }, + "PreviousTxnID": "1CCA9507B308F8DF78DBFED8F4030D0EC9B188E98AFFCB19EA0CDEDD317618ED", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0905CEAC267800", + "NewFields": { + "ExchangeRate": "4f0905ceac267800", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0905CEAC267800", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f09067af7966000", + "Flags": 0, + "PreviousTxnID": "BA2B41293A026E5B06FE809B0C80C48F0F607A9276DF11A954A201FFDD529BDF", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F09067AF7966000", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F09067AF7966000" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8D689E1D07E7887FC5832D380DA6DC4C5964C15CC67C443D34A7F74652D175A6", + "NewFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F0905CEAC267800", + "Sequence": 167782396, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "37929.8221" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F09067AF7966000", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "BA2B41293A026E5B06FE809B0C80C48F0F607A9276DF11A954A201FFDD529BDF", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 167782385, + "TakerGets": "14935000000", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "37940.874" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "C3DE277EDD8E0F5AA912C94E6BA439E82B3C74834767C019E932CB76305287A9" + } + } + ], + "TransactionIndex": 34, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 144101820, + "Sequence": 144101824, + "SigningPubKey": "022D40673B44C82DEE1DDB8B9BB53DCCE4F97B27404DB850F068DD91D685E337EA", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "254809.0466560966" + }, + "TakerPays": "23793716053", + "TransactionType": "OfferCreate", + "TxnSignature": "3044022020E5532F2948BA33875F93018750E73A066E10BEA481E3932FEA034B9AFA993202204AED7313D8BB9E9F036F9865D47A1115EA5BFF919AC7FD01A15FF72FAB15C14C", + "hash": "80C087E969C89E41CC153D8E96391114596CA13096615FD3CBECEC98A5F397E3", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5921282b906db6c1", + "Flags": 0, + "PreviousTxnID": "3A4F2024CF352C9C11259889E81514EBBA2C7C2BF70C9FF0B38539B31F57219E", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975921282B906DB6C1", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975921282B906DB6C1" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759212CBC5209DBD5", + "NewFields": { + "ExchangeRate": "59212cbc5209dbd5", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759212CBC5209DBD5", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "44DC8D88900D8B73630C3D6560B28EC6B81BE145EA025A8C4AB395AF22DAC3D8", + "NewFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759212CBC5209DBD5", + "Sequence": 144101824, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "254809.0466560966" + }, + "TakerPays": "23793716053" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975921282B906DB6C1", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "3A4F2024CF352C9C11259889E81514EBBA2C7C2BF70C9FF0B38539B31F57219E", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 144101820, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "154169.8336402234" + }, + "TakerPays": "14388426682" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "9C20C00E971DD57BD157AC6EA8DF64C367452F76B90141E8C6A0A957EBD35A73" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "RootIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A", + "PreviousTxnID": "B144ED0857D28D46399688B036CF896E6DBF1EB5EE1CB750B4E64B39C5771580", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Balance": "100345307", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 144101825 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E0311EB450B6177F969B94DBDDA83E99B7A0576ACD9079573876F16C0C004F06", + "PreviousFields": { + "Balance": "100345322", + "Sequence": 144101824 + }, + "PreviousTxnID": "B144ED0857D28D46399688B036CF896E6DBF1EB5EE1CB750B4E64B39C5771580", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 3, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rGDreBvnHrX1get7na3J4oowN19ny4GzFn", + "Amount": "27024428", + "DeliverMax": "27024428", + "Destination": "raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA", + "DestinationTag": 3814501049, + "Fee": "20", + "Flags": 2147483648, + "LastLedgerSequence": 94085606, + "Sequence": 1132118, + "SigningPubKey": "02024F808D657322E73CEA9A0109CDBD9A3A56552CA87F847DD8558B47CD0F2E20", + "TransactionType": "Payment", + "TxnSignature": "3045022100B1D592712A51621B26CBE58FB9E12F38284C6073C5D19BED2F307457B712903A02201777E20F309C3DBE32D4A440E0F8F4FA4E24CCE407C5A0E653D9B2238C415CB0", + "hash": "82410C3A99011DA1AB77C4C9D78147BCD7BD1809661F13F07A4B3E58A686B930", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rGDreBvnHrX1get7na3J4oowN19ny4GzFn", + "Balance": "38870750664508", + "Flags": 131072, + "OwnerCount": 1, + "Sequence": 1132119 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8719BD164C9F79A760E19FB64691885E63CC595032E559971F89C1E22EAEC220", + "PreviousFields": { + "Balance": "38870777688956", + "Sequence": 1132118 + }, + "PreviousTxnID": "4818FF59B8076B61E426F7533F602996D9216BF6C1496114692F2F99C92B7468", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "raQwCVAJVqjrVm1Nj5SFRcX8i22BhdC9WA", + "Balance": "2313854255041", + "Flags": 131072, + "OwnerCount": 1, + "Sequence": 204571 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E5C6084FF22D11C5236D69FA9EA6F46ED694A663FCEDCE10D84B00BF09F74F1B", + "PreviousFields": { + "Balance": "2313827230613" + }, + "PreviousTxnID": "8F512098AB68A8775EAA6EBA34FAA4750AE4673F4AA7C5DD2734B8B76C9BE0DC", + "PreviousTxnLgrSeq": 94084606 + } + } + ], + "TransactionIndex": 60, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "27024428" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 123729275, + "Sequence": 123729331, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TransactionType": "OfferCancel", + "TxnSignature": "304402206C81B0B488049A99476DA63864503A78099E7EA96FE9B3EC4A3A9DBE5BFCA705022029F786B28ED332F61335C8354975F429CD501E6DBE03129C79129FA0FF864028", + "hash": "86EBE66B7D01F69A5B34C79DEC0F7B8621D4F485FB891E424F4CF4DBC6F2D11E", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "19b14", + "PreviousTxnID": "BF6F729EE2D6C941EB84ADE4E14C0E0A2631CD2568AD83A426F087975CDB37FE", + "PreviousTxnLgrSeq": 94084588, + "Sequence": 123729275, + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "27.1095319603214" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "3495.381058070019" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "147D99027772C5458660D16370C0CE1752F28DFEE90575DE20F2D8927FBEA0E1" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028995", + "Flags": 0, + "OwnerCount": 138, + "Sequence": 123729332 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960029005", + "OwnerCount": 139, + "Sequence": 123729331 + }, + "PreviousTxnID": "D3CAD77DA369288D6E9F3D828977F1B8BCDD59C622892D7D77E1C64D3008A947", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "570494a95ac3ae00", + "Flags": 0, + "PreviousTxnID": "D3CAD77DA369288D6E9F3D828977F1B8BCDD59C622892D7D77E1C64D3008A947", + "PreviousTxnLgrSeq": 94084608, + "RootIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "TakerGetsCurrency": "0000000000000000000000004C54430000000000", + "TakerGetsIssuer": "06B36AC50AC7331069070C6350B202EAF2125C7C", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "19b15", + "IndexPrevious": "19b13", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DF3339FE796ED3E629118B760BB5CDB86E3D496F8FCDAC784A7AEA7B40C68BEA", + "PreviousTxnID": "D3CAD77DA369288D6E9F3D828977F1B8BCDD59C622892D7D77E1C64D3008A947", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 48, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0.009743698947400346" + }, + "DeliverMax": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0.009743698947400346" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0.7788400340257631" + }, + "Sequence": 29665812, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "A3D016AB899AA5F2111ED2CFCC44877FBE6A46837AF3C88C7F201AFD50A9EE6387484181EAC54C40028C02613635B1953502EEA7E9F18551F1E3608F9556F10F", + "hash": "88D2EFCC697A12E2E40B7494897953BC58ECB7F293381437C0B07983B1877075", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009743698947400346" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "HighNode": "237c", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "197E542413061266DC6995ADD18728149974484D717A415649AE12E89E297DA5", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "5DDFB6E819730F37B7B1CD7101BA5D76ACC4166EDFF9D45AA6AD6A8251277FE5", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-30365.9226435823" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rGzrqeJ1WT5iiUcYVRArYEcioeMyUvRwJu", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0" + }, + "LowNode": "9d2" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "4977FF3D23BEA01F381AAF8692AF32D4915A706498856EE31357F762AE211B6B", + "PreviousFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-30365.18274945764" + } + }, + "PreviousTxnID": "FB5A8C974C98AEF99D4D7B39E19615E70F6DDCB2D7D3661C3D3D055EBCEE628B", + "PreviousTxnLgrSeq": 94084587 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-401.0411529242131" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "USD", + "issuer": "rGzrqeJ1WT5iiUcYVRArYEcioeMyUvRwJu", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "LowNode": "236b" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "5F46C4CC0E76D352F08758B6CC13BB2FE6EBF12F4BF29F7A5CB6F8709FDEE1BD", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-401.0509161105584" + } + }, + "PreviousTxnID": "FB5A8C974C98AEF99D4D7B39E19615E70F6DDCB2D7D3661C3D3D055EBCEE628B", + "PreviousTxnLgrSeq": 94084587 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "88D2EFCC697A12E2E40B7494897953BC58ECB7F293381437C0B07983B1877075", + "Balance": "97189504", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665813 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "Balance": "97189514", + "Sequence": 29665812 + }, + "PreviousTxnID": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0015449983893466" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0" + }, + "HighNode": "9d4", + "LowLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "EDFD482EE5A971AE673A8B5EB79405006DB3287A0B4B76C7888BAF899FF62FF7", + "PreviousFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.7414391230515426" + } + }, + "PreviousTxnID": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 10, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0.009743698947400346" + } + } + }, + { + "Account": "rUqqN1KKvLSknssUXrLX48vtnNdpvaqsZ7", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30447243, + "Sequence": 30447244, + "SigningPubKey": "022E70597C73E359D20C5939F9A9009B42D51DAD22E633762832E44336B95D177C", + "TakerGets": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "1736029.133" + }, + "TakerPays": "100000000000", + "TransactionType": "OfferCreate", + "TxnSignature": "30440220294E28D97D538C5BE0B82E96950A6BAE2FB57D2C5E249B486750AAC64035493902206D01A9A65D9FFCA7EE62578263488D0F03DBE2359AE2D2D11832B975A6435F4A", + "hash": "898C518D9A5402DA2CBE4EF563C90C6B963B1E2B8193738DE8320AD82C3F9640", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rUqqN1KKvLSknssUXrLX48vtnNdpvaqsZ7", + "RootIndex": "1BBEACDDD4D74F0AC4548C926F22916D6B00C59C24FFC036D6D66F0456A3A947" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1BBEACDDD4D74F0AC4548C926F22916D6B00C59C24FFC036D6D66F0456A3A947", + "PreviousTxnID": "24EAC52145FC7B8B31E4FD903268833174AF25F285B7F55813F88F86A3DCCA85", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "300435B0896C3FEDC9EC6C875EAA73206FF02FAF0E64C4A418551BE70BBF4020", + "NewFields": { + "Account": "rUqqN1KKvLSknssUXrLX48vtnNdpvaqsZ7", + "BookDirectory": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFD629D9F8", + "Sequence": 30447244, + "TakerGets": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "1736029.133" + }, + "TakerPays": "100000000000" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUqqN1KKvLSknssUXrLX48vtnNdpvaqsZ7", + "Balance": "100867187", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 30447245 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47AA01718D2EEC8C55C99463B8BA8BC4E1EDD346737FE9AC9A715B10653E7326", + "PreviousFields": { + "Balance": "100867202", + "Sequence": 30447244 + }, + "PreviousTxnID": "24EAC52145FC7B8B31E4FD903268833174AF25F285B7F55813F88F86A3DCCA85", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFD629D9F8", + "NewFields": { + "ExchangeRate": "591476efd629d9f8", + "RootIndex": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFD629D9F8", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "591476efe304c98f", + "Flags": 0, + "PreviousTxnID": "24EAC52145FC7B8B31E4FD903268833174AF25F285B7F55813F88F86A3DCCA85", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFE304C98F", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFE304C98F" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rUqqN1KKvLSknssUXrLX48vtnNdpvaqsZ7", + "BookDirectory": "49789A0B460DC77A2CED9349C432AEA97352345BA3C7313A591476EFE304C98F", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "24EAC52145FC7B8B31E4FD903268833174AF25F285B7F55813F88F86A3DCCA85", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 30447243, + "TakerGets": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "1736029.068" + }, + "TakerPays": "100000000000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "DA499D5CB497C363A798557B35C9ED5463A42287B22B3538356A6D69BDCB6135" + } + } + ], + "TransactionIndex": 63, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "4D756532417938746A66725F5934784A6847466158", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 93305416, + "Sequence": 93305419, + "SigningPubKey": "025EBE8E351CAC5C641624238CD36A360631728177A5314566CC6BA0BAD4EF65FC", + "TakerGets": "1732873", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "23.074816" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "30440220644F74CB2C0D6729B184EF2EEFAEC62DF90593C03714D4F508E06FEA7C3C883702207C452DC5F9F01EC023C1639A3983E0CF129ABA8D317B80AF239F09741ACBA228", + "hash": "8DE11442A8DB0B97E7F6B4718E062B7C232FE7734A32E606D883577421EAC61C", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "00F1E982285D673B0EB19CE82A2510B261818B94ADB09B7A341FA9253E0DA17E", + "NewFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BB13A93D79D9", + "Sequence": 93305419, + "TakerGets": "1732873", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "23.074816" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "RootIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "625124F968DCC1DEBB9EBE2C902DD6DE00945C218CC672DB067A8B30DC2F8542", + "PreviousTxnID": "21532642DFDA93CDA88147D6AFA4C3DF647CF351D64180104CBF23DF68FC8857", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "Balance": "68142050847", + "Flags": 0, + "OwnerCount": 11, + "Sequence": 93305420 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9C1D8ABFBDC2F6A287CF320407BF8957B3CA5FE87C52C1EAD494E867A32ED9DB", + "PreviousFields": { + "Balance": "68142050862", + "Sequence": 93305419 + }, + "PreviousTxnID": "21532642DFDA93CDA88147D6AFA4C3DF647CF351D64180104CBF23DF68FC8857", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rE5rYEY8W4ZKzKUg3Q9by6cz33sRKWbADR", + "BookDirectory": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BBF7079C6977", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "73B0BE40BE76D877702D8D3A362B697D16933C4D7C452F967ECB0298DD55D850", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 93305416, + "TakerGets": "1732028", + "TakerPays": { + "currency": "434F524500000000000000000000000000000000", + "issuer": "rcoreNywaoz2ZCQ8Lg2EbSLnGuRBmun6D", + "value": "23.080478" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "A4C3ADA7C291C966103CDC22647946983C0A6E673C4F82D59A7DB7E4BD6B895B" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BB13A93D79D9", + "NewFields": { + "ExchangeRate": "5004bb13a93d79d9", + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BB13A93D79D9", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5004bbf7079c6977", + "Flags": 0, + "PreviousTxnID": "73B0BE40BE76D877702D8D3A362B697D16933C4D7C452F967ECB0298DD55D850", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BBF7079C6977", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "434F524500000000000000000000000000000000", + "TakerPaysIssuer": "06C4F77E3CBA482FB688F8AA92DCA0A10A8FD774" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B4DFE259D685BAE2D7B72ED8C3C7587FA959B5A565CEC95F5004BBF7079C6977" + } + } + ], + "TransactionIndex": 56, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rNVyr1fqjobUQRzG4H45saNhjyV8L4QwHp", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "584D454D45000000000000000000000000000000", + "issuer": "rUNa1wQ4kNXLxC6MraVqQabJtTpptp7NJA", + "value": "0" + }, + "Sequence": 92068020, + "SigningPubKey": "0358A99F9B8BF334739A5393B82FF18FCDAF30F7AC79AD9245BA761100EBA77FB1", + "SourceTag": 74920348, + "TransactionType": "TrustSet", + "TxnSignature": "30440220575028151767157FF3E005FD123DBF35D9B5ED366D396F2DD011D722410F61880220391124C90DE38C912DDD3759D58C00E77AC3ADF3EF12F84CCBEEC6EADA350F02", + "hash": "8E875478A8C686AD2B12AC6F66975A0DAE74219BDFAF8D68ACE2FD223FB784C7", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "21", + "IndexPrevious": "1f", + "Owner": "rUNa1wQ4kNXLxC6MraVqQabJtTpptp7NJA", + "RootIndex": "15C127E382A7F47422036987E845E0CDF692E105FEDEABE64C35BB07CC1096F5" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "23B47835F4F9A99B60EE78CC2E934D9151B9510DD95D54CF055A70899B88844D", + "PreviousTxnID": "25BF797886114BF622FA5E8933FC15CFA4CFA88FE4942BA89F75B8145C2064BA", + "PreviousTxnLgrSeq": 94062791 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "6", + "Owner": "rNVyr1fqjobUQRzG4H45saNhjyV8L4QwHp", + "RootIndex": "90FDD2CD7F8F7F477E41F9A8FDC3B8FAFF55CF8830EB35BCC498CD73819662E8" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "ABB9643B4275EA7C6337335E7A2F2535E1EFEA56B097A7297294920D4E297B0E", + "PreviousTxnID": "54548DC0DDF8BC8CFB23093F8AE2C7ABCBE7097B84B546EF9D4B8F42BD5F88A9", + "PreviousTxnLgrSeq": 94084603 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rNVyr1fqjobUQRzG4H45saNhjyV8L4QwHp", + "Balance": "6780888", + "Flags": 0, + "OwnerCount": 23, + "Sequence": 92068021 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "D59A463D35E7015882B592BCDAE4ADBE0B7408874FB320E8BCA06ED506AB7B88", + "PreviousFields": { + "Balance": "6780900", + "OwnerCount": 24, + "Sequence": 92068020 + }, + "PreviousTxnID": "54548DC0DDF8BC8CFB23093F8AE2C7ABCBE7097B84B546EF9D4B8F42BD5F88A9", + "PreviousTxnLgrSeq": 94084603 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Balance": { + "currency": "584D454D45000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 2097152, + "HighLimit": { + "currency": "584D454D45000000000000000000000000000000", + "issuer": "rNVyr1fqjobUQRzG4H45saNhjyV8L4QwHp", + "value": "0" + }, + "HighNode": "7", + "LowLimit": { + "currency": "584D454D45000000000000000000000000000000", + "issuer": "rUNa1wQ4kNXLxC6MraVqQabJtTpptp7NJA", + "value": "0" + }, + "LowNode": "20", + "PreviousTxnID": "2C6AAF125E3891739E516D9C04418311E1282CCDA384214FB1B7115384685E6C", + "PreviousTxnLgrSeq": 93967780 + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "DB7F679CC44CDAF4F6359A2C3337E5DB1B2006F39120190F7EE12F08FD1E0842", + "PreviousFields": { + "Flags": 2228224, + "HighLimit": { + "currency": "584D454D45000000000000000000000000000000", + "issuer": "rNVyr1fqjobUQRzG4H45saNhjyV8L4QwHp", + "value": "9999.99999999379" + } + } + } + }, + { + "ModifiedNode": { + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "EBE091B6BBF486B625B04400DE011E04357AA90F0AD079A64ACF2AA78CEC5B73", + "PreviousTxnID": "906470DC76529747DC6003BC8266BC9F2DC7645D52FCF7157A927D7A8ABA5B29", + "PreviousTxnLgrSeq": 94083220 + } + } + ], + "TransactionIndex": 67, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 143700481, + "Sequence": 143700485, + "SigningPubKey": "039451ECAC6D4EB75E3C926E7DC7BA7721719A1521502F99EC7EB2FE87CEE9E824", + "TakerGets": "17892237542", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "388986.9059867146" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3044022071A02B665E688311D6A28DD8076C7B5E4E322979E3DDA378F171C17C53217A350220242AB0BCFB2D298FE6BA5928DA61B9550E20F73578E2D96D0C2344EDA17A0C26", + "hash": "92631532977C634CA40221035BAA3E4FFDE6EB2B3B229AE36DE7465600ABDF0E", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "RootIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96", + "PreviousTxnID": "B41B4A1755A29B0303E9B8BAFF0222F8057C6B1417E9FA8F3CB88C65752DD1B9", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007BA5A56A10993", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "4F1E545E91E29B42C00924EC045DAF2C794FB7C16884106CCCDBB41F9F31068E", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 143700481, + "TakerGets": "11219773357", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "244054.9784331323" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "266B266EF9EA427499A17991C0DB5AF7DC25F2E37A6FBD52C710DCCAFA611EDC" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Balance": "1000571169", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 143700486 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47FE64F9223D604034486F4DA7A175D5DA7F8A096952261CF8F3D77B74DC4AFA", + "PreviousFields": { + "Balance": "1000571184", + "Sequence": 143700485 + }, + "PreviousTxnID": "B41B4A1755A29B0303E9B8BAFF0222F8057C6B1417E9FA8F3CB88C65752DD1B9", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007B94A6465CB62", + "NewFields": { + "ExchangeRate": "5007b94a6465cb62", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007B94A6465CB62", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5007ba5a56a10993", + "Flags": 0, + "PreviousTxnID": "4F1E545E91E29B42C00924EC045DAF2C794FB7C16884106CCCDBB41F9F31068E", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007BA5A56A10993", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007BA5A56A10993" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "EFB1BE67D75D35AA81F38238D27161EA1FA546AF471DFFDD44277736BDBCC30D", + "NewFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007B94A6465CB62", + "Sequence": 143700485, + "TakerGets": "17892237542", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "388986.9059867146" + } + } + } + } + ], + "TransactionIndex": 76, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rnwKB3Ba1WaVphVJAFfgPwb5oLjUopYTrB", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92796107, + "SigningPubKey": "EDB0FB6AE5994804AA85C59F73A460350B2DFA3B2319442B1DCF67653DBF2C43FB", + "TransactionType": "TrustSet", + "TxnSignature": "56F2CD152C47A643E189B2F712EE2A7EBB5C25E0F022F765DB3C4E8A837BB0586ADE0361240F8739E3B4380E60F9CB2AD00676148C379FA1936515E56109B708", + "hash": "94AF3D37D357413E8DB65202518768798DEA926EF96D5A5836B2D76D5DABCE3A", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rnwKB3Ba1WaVphVJAFfgPwb5oLjUopYTrB", + "Balance": "29137296", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92796108, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47E99CDE63ECC189D6169E1D3B5F1B5C6865A744CE1E6DA5887F41F62D46980A", + "PreviousFields": { + "Balance": "29137308", + "Sequence": 92796107 + }, + "PreviousTxnID": "10E5F603AD6482E0F3C3CB6CD1690C01DFE0E7D3FBF5E0ED3482664791E54AAA", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 7, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Sequence": 123729336, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TakerGets": "20900828807", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "50252.07481291395" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100A332137DCC92EDB97141709E144964EDA6F73F73FD042DA4A436A59BD254860A02206E8F35BA63C886034B9EB92D69F4EEBEFD7074D29B67EEA29FC88B5DD3D585E5", + "hash": "98A43B919AEB47DB68EED3A31D88F9EF13215FA605F2553AB25CF248FD524C4E", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "6D8BFE82A628201D6B69E4E090F35E10ADD5CAD0AC494D729B46FBBF99DDFBE1", + "NewFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51454EC45", + "OwnerNode": "19b15", + "Sequence": 123729336, + "TakerGets": "20900828807", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "50252.07481291395" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "19b14", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "9DBB7ADE16C6B4D763193B6D41161ACF6E93F22C6F4401FFC89B89ADCC378328", + "PreviousTxnID": "D9B2B0AEA084E8C1DBA6024BFDF9B77AB1F701ED45F1B746F7E8E6F0AA3E0471", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028945", + "Flags": 0, + "OwnerCount": 139, + "Sequence": 123729337 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028955", + "OwnerCount": 138, + "Sequence": 123729336 + }, + "PreviousTxnID": "D9B2B0AEA084E8C1DBA6024BFDF9B77AB1F701ED45F1B746F7E8E6F0AA3E0471", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51454EC45", + "NewFields": { + "ExchangeRate": "4f088ab51454ec45", + "RootIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51454EC45", + "TakerPaysCurrency": "0000000000000000000000004555520000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + } + } + } + ], + "TransactionIndex": 53, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Sequence": 123729337, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TakerGets": "29377046113", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "70631.53010337884" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402201582A48F50CD55AC7A21886CA243267D4C9E60105B6324AB188B65CC87BB8CFF02202DC29714457A0AF440D878D1FFC724FED9816E05A19DB8727215C227A738BAEE", + "hash": "995149CE0F27F46B7CA1F1E39DAC35601C6F08DFF97191DD5009CE7EE766CFB7", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "19b14", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "9DBB7ADE16C6B4D763193B6D41161ACF6E93F22C6F4401FFC89B89ADCC378328", + "PreviousTxnID": "98A43B919AEB47DB68EED3A31D88F9EF13215FA605F2553AB25CF248FD524C4E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028935", + "Flags": 0, + "OwnerCount": 140, + "Sequence": 123729338 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028945", + "OwnerCount": 139, + "Sequence": 123729337 + }, + "PreviousTxnID": "98A43B919AEB47DB68EED3A31D88F9EF13215FA605F2553AB25CF248FD524C4E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51455472E", + "NewFields": { + "ExchangeRate": "4f088ab51455472e", + "RootIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51455472E", + "TakerPaysCurrency": "0000000000000000000000004555520000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + } + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "D182D790EA97257A7B9219672888208443407BB1F29A97082F52859DD9626B31", + "NewFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088AB51455472E", + "OwnerNode": "19b15", + "Sequence": 123729337, + "TakerGets": "29377046113", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "70631.53010337884" + } + } + } + } + ], + "TransactionIndex": 54, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBFVZq2vH2KhFJDxf9ojgA7tRWrDsvyUGj", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92751140, + "SigningPubKey": "EDD638C645847EF0982BCE03A93AC3F7F8A65B36E5B7A8AA8011A226F8A965DC87", + "TransactionType": "TrustSet", + "TxnSignature": "BC9FF66B3F56DF463391DBB87EF4F628A35E98662CC546B8EB22B9BB33EDE462C5B33A79575B636A7A0D881FF5F702F2B26E976B8DDDB0A1D53F325E6555C402", + "hash": "996976870B00622A48B69B97A34C1A063F5F40DE70C903C04F2FD67E8D74947C", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBFVZq2vH2KhFJDxf9ojgA7tRWrDsvyUGj", + "Balance": "29989868", + "Flags": 0, + "OwnerCount": 6, + "Sequence": 92751141, + "TicketCount": 6 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9B67D8540B6FB36B65F9B9FD5BE8E96D0799D4D711CBAB513DAE589CABDC897D", + "PreviousFields": { + "Balance": "29989880", + "Sequence": 92751140 + }, + "PreviousTxnID": "A2CBF888374EC61760183C3E29B1DB86FA975B81AE07F99865E865E4C27D7D93", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 39, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961378, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2855.04333" + }, + "TakerPays": "1183614270", + "TicketSequence": 90961385, + "TransactionType": "OfferCreate", + "TxnSignature": "C31F96907B604A805DF3B3556CA6A9C7B763D4C3E10248DCCB6A6DBA31C9463AC6FE9C41F57B854C8127A63E8D3CACA436CE0C10F80082FDEEE667CC7AA87200", + "hash": "9AF16F22553695556DC8E4A57F0CD49ECB2A5DDA274791454BDB273192586A4B", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "aea", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961385 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "04477E6690BA2A6512C203036F68FAA2949BDE06ABC10BBC0B876515FB8CD282" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "30A0AA5DA10DFA964FA4331FC67354E427DC2F395BEF619AB576B7A1866834FA", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBA7D4D080A00", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961385, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2855.042879400014" + }, + "TakerPays": "1183614270" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "9ECD38CF03E1B9C7E2AF83E0CCDC24AC4AF197CCE821722F28C5FE047A1E9D61", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f08a1c134c4a1d2", + "Flags": 0, + "PreviousTxnID": "EE1EE14CDE2B4173680E3CC3B51A8C1DDB2072A9C07117416CC321B61BE53D76", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A1C134C4A1D2", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A1C134C4A1D2" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A1C134C4A1D2", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "EE1EE14CDE2B4173680E3CC3B51A8C1DDB2072A9C07117416CC321B61BE53D76", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961378, + "TakerGets": "1972220920", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4791.80853" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "A42B2FF05A4809671E9EF08EC908C9FC505E85197CB82EC28D226416DA205437" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421419", + "Flags": 0, + "OwnerCount": 32, + "Sequence": 90961404, + "TicketCount": 18 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421429", + "OwnerCount": 33, + "TicketCount": 19 + }, + "PreviousTxnID": "9ECD38CF03E1B9C7E2AF83E0CCDC24AC4AF197CCE821722F28C5FE047A1E9D61", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBA7D4D080A00", + "NewFields": { + "ExchangeRate": "5a0eba7d4d080a00", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBA7D4D080A00", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + } + ], + "TransactionIndex": 24, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rELS4xDgjp8ZfR6MQGfPVhB5Pn42pvYJKW", + "Expiration": 792634803, + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084617, + "OfferSequence": 69213268, + "Sequence": 69213269, + "SigningPubKey": "03E41AE33C5913DA2470972AF0667B08BCC306483D83853C674DEC1111CBE28D71", + "TakerGets": { + "currency": "ELS", + "issuer": "rHXuEaRYnnJHbDeuBH5w8yPh5uwNVh5zAg", + "value": "55555.43908686671" + }, + "TakerPays": "50000000", + "TransactionType": "OfferCreate", + "TxnSignature": "30440220753959B33DD4FDA467FAE91A6EAD3FB22548471935DB2E45FE826C42D06DCCC4022037D267D166E858FF15B5A27849385F7B8085F4A348A8BB7622001F765117A154", + "hash": "9BF31B2E4C73CD15C078F07137112E83B104965D474545611D2AA57A4EB7E823", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rELS4xDgjp8ZfR6MQGfPVhB5Pn42pvYJKW", + "RootIndex": "0751804A2E2188EACDC2B90951C1E46212B0F239F29EB54DAFCEBEC48BE2C7BA" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0751804A2E2188EACDC2B90951C1E46212B0F239F29EB54DAFCEBEC48BE2C7BA", + "PreviousTxnID": "9119DF096827C8FEB825C34EC93402745AB639B1AA369114354C8E3A18FD2D32", + "PreviousTxnLgrSeq": 94084530 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "2CBF5C267C7BBD4B45391175A9573502FF01CC81AB7ADA50C5AA0CE0FC726BE7", + "NewFields": { + "Account": "rELS4xDgjp8ZfR6MQGfPVhB5Pn42pvYJKW", + "BookDirectory": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF9782F98D4AD", + "Expiration": 792634803, + "Sequence": 69213269, + "TakerGets": { + "currency": "ELS", + "issuer": "rHXuEaRYnnJHbDeuBH5w8yPh5uwNVh5zAg", + "value": "55555.43908686671" + }, + "TakerPays": "50000000" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rELS4xDgjp8ZfR6MQGfPVhB5Pn42pvYJKW", + "BookDirectory": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF97A164FB286", + "BookNode": "0", + "Expiration": 792634503, + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "9119DF096827C8FEB825C34EC93402745AB639B1AA369114354C8E3A18FD2D32", + "PreviousTxnLgrSeq": 94084530, + "Sequence": 69213268, + "TakerGets": { + "currency": "ELS", + "issuer": "rHXuEaRYnnJHbDeuBH5w8yPh5uwNVh5zAg", + "value": "55555.38868149835" + }, + "TakerPays": "50000000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "B93A936D49B086DBFA0BB87F819ECE2B754A2A5BD3719E15BE7BFCADF9FCCBCC" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF9782F98D4AD", + "NewFields": { + "ExchangeRate": "571ff9782f98d4ad", + "RootIndex": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF9782F98D4AD", + "TakerGetsCurrency": "000000000000000000000000454C530000000000", + "TakerGetsIssuer": "B55A1A058BEB283284811E4E9ACA8432194C59E5" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "571ff97a164fb286", + "Flags": 0, + "PreviousTxnID": "9119DF096827C8FEB825C34EC93402745AB639B1AA369114354C8E3A18FD2D32", + "PreviousTxnLgrSeq": 94084530, + "RootIndex": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF97A164FB286", + "TakerGetsCurrency": "000000000000000000000000454C530000000000", + "TakerGetsIssuer": "B55A1A058BEB283284811E4E9ACA8432194C59E5", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E5C94F1371961189FB277B38B4FB0AA0423970BB4A3C7599571FF97A164FB286" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rELS4xDgjp8ZfR6MQGfPVhB5Pn42pvYJKW", + "Balance": "92696500", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 69213270 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "FCB1B01FE0B36F433358D0A0F4328C871C9C8C3EC485C6B452FFDBDD04C3B9A0", + "PreviousFields": { + "Balance": "92696520", + "Sequence": 69213269 + }, + "PreviousTxnID": "9119DF096827C8FEB825C34EC93402745AB639B1AA369114354C8E3A18FD2D32", + "PreviousTxnLgrSeq": 94084530 + } + } + ], + "TransactionIndex": 69, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r4ub6QN7LLScGjh7myqXpje4hfuk2Jrw1H", + "Fee": "12", + "Flags": 0, + "LastLedgerSequence": 94084625, + "Sequence": 72967536, + "SigningPubKey": "ED6DC78BE40D14860C6535E47DD8D4048E40A8438549405C13F3524872FAEDA414", + "TakerGets": { + "currency": "XAH", + "issuer": "rswh1fvyLqHizBS2awu1vs6QcmwTBd9qiv", + "value": "324.221" + }, + "TakerPays": "10000000", + "TransactionType": "OfferCreate", + "TxnSignature": "B77A12EC985011717E820E73DE4550690A2CA49CA746B5D56187BAFC72BBE99A24BC2B708E3F063D001A3AAA7BA8CC7C8A6DE36EE5987C76F75C7AE94D0C7A01", + "hash": "9E14A1D1076C6785CCB53A4155A5A25BDC27355F6F1BDE348BBC7CED42613A84", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "3D979FC6B9C0671BE19DC633803FEF5F3189668087082E10590AF52B4446ADED", + "NewFields": { + "ExchangeRate": "590af52b4446aded", + "RootIndex": "3D979FC6B9C0671BE19DC633803FEF5F3189668087082E10590AF52B4446ADED", + "TakerGetsCurrency": "0000000000000000000000005841480000000000", + "TakerGetsIssuer": "17A73888B98222E485D927BCDFD63FC3895AD2AE" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "r4ub6QN7LLScGjh7myqXpje4hfuk2Jrw1H", + "RootIndex": "5DA0D19747B416190C0637B96023E73330D493E287C197E660B3ABFB919CCDC9" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "5DA0D19747B416190C0637B96023E73330D493E287C197E660B3ABFB919CCDC9", + "PreviousTxnID": "D6F5AE29ECF5AA0360192A641B92D648319A2B2E943447E1EFD0C5F5DC6668EC", + "PreviousTxnLgrSeq": 94084601 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8C51D2811A4DEEB53B940B02874C0B190D38DDA68D4E4C4986B61EE5C42A2A2E", + "NewFields": { + "Account": "r4ub6QN7LLScGjh7myqXpje4hfuk2Jrw1H", + "BookDirectory": "3D979FC6B9C0671BE19DC633803FEF5F3189668087082E10590AF52B4446ADED", + "Sequence": 72967536, + "TakerGets": { + "currency": "XAH", + "issuer": "rswh1fvyLqHizBS2awu1vs6QcmwTBd9qiv", + "value": "324.221" + }, + "TakerPays": "10000000" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r4ub6QN7LLScGjh7myqXpje4hfuk2Jrw1H", + "Balance": "103454578", + "Flags": 0, + "OwnerCount": 2, + "Sequence": 72967537 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "97669D4E58964F796BEB1BBB5A46B8F8A45344167D7E844E8C48DEDEFC8DF50E", + "PreviousFields": { + "Balance": "103454590", + "OwnerCount": 1, + "Sequence": 72967536 + }, + "PreviousTxnID": "D6F5AE29ECF5AA0360192A641B92D648319A2B2E943447E1EFD0C5F5DC6668EC", + "PreviousTxnLgrSeq": 94084601 + } + } + ], + "TransactionIndex": 73, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961370, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1907.18135" + }, + "TakerPays": "789076180", + "TicketSequence": 90961377, + "TransactionType": "OfferCreate", + "TxnSignature": "8AC93CFA0D6B3D4CB247596FB729CDA1C71C5BE689BCC3B3B383AFFE30EAF6082B966B47682C46847A90A7B23FC363778DB75A9FA81F43CDE3E84248CEC83807", + "hash": "9ECD38CF03E1B9C7E2AF83E0CCDC24AC4AF197CCE821722F28C5FE047A1E9D61", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "1A710A9FD424E1725E8C073ADBF6E13265FE6B90FB23D453BDCBEF6A18CF026F", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB2F057453E00", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961377, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "1907.18116109291" + }, + "TakerPays": "789076180" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousFields": { + "IndexPrevious": "ae9" + }, + "PreviousTxnID": "AF0DF94A96F5DCBF4DB325D900E72EEAC7FC11C6FA31FBC73E9CE27AE3CCF350", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "PreviousTxnID": "AF0DF94A96F5DCBF4DB325D900E72EEAC7FC11C6FA31FBC73E9CE27AE3CCF350", + "PreviousTxnLgrSeq": 94084608, + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D" + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f08a3f46c6f10fb", + "Flags": 0, + "PreviousTxnID": "FEE4C0CCBFC7A0A86DE6F6E7E51D2D06C255FFFD5C8FC2DEAFF49427805A1627", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A3F46C6F10FB", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A3F46C6F10FB" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "0", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "57103BFCB0CF9306E18A39838EBCF3329EB5BF2B2C1A0C829E19CB6E97D1B9CF", + "PreviousFields": { + "IndexNext": "ae9" + }, + "PreviousTxnID": "425F582A8F41173A5B0A28783464663B2FA093C3620FD1F6546A4629BEF93D47", + "PreviousTxnLgrSeq": 94084599 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421429", + "Flags": 0, + "OwnerCount": 33, + "Sequence": 90961404, + "TicketCount": 19 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421439", + "OwnerCount": 34, + "TicketCount": 20 + }, + "PreviousTxnID": "AF0DF94A96F5DCBF4DB325D900E72EEAC7FC11C6FA31FBC73E9CE27AE3CCF350", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A3F46C6F10FB", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "FEE4C0CCBFC7A0A86DE6F6E7E51D2D06C255FFFD5C8FC2DEAFF49427805A1627", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961370, + "TakerGets": "3944443449", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9593.16258" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "AFB30414096F34EA7A7D46455494269D4C115636BE0EC2B80CBEB74880270A50" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB2F057453E00", + "NewFields": { + "ExchangeRate": "5a0eb2f057453e00", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB2F057453E00", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961377 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "FB5EDAB097EC09D7A4B322E2C99BD9A5F679886D8D2095D7685399602A39E177" + } + } + ], + "TransactionIndex": 23, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30301441, + "Sequence": 30301445, + "SigningPubKey": "021C987881039AD42AEC336FB8460F1B1F4DDF0839CAF3EAB1AF69DDF8012C30A3", + "TakerGets": "10189405910", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "202666.2646096955" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100AB0D0941152C8E518557BFD1E8482A38850CF1A119B429F623A15949F5DAEC400220304E447F3976DF01BFE8B72E0A37506F513B9DD707A9DF506D4ED30BDAA2DB9B", + "hash": "A2D199D8DE44D77342BE5940FC36B5A2E50A706F0F9709F4324A119DE4FB6A85", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500712C56DFC5FEA", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "AC634E95B979374995FA52D59A83D568C9026EFBD9095FB2195A27B3B0ACB362", + "PreviousTxnLgrSeq": 94084599, + "Sequence": 30301441, + "TakerGets": "12371383046", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "246309.7827588554" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "32563B7D525C4FCF44E48FF985C7E4CBA38CD82DF1F174BE94CE3199E488C8EE" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500710F9D2697AD1", + "NewFields": { + "ExchangeRate": "500710f9d2697ad1", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500710F9D2697AD1", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "500712c56dfc5fea", + "Flags": 0, + "PreviousTxnID": "AC634E95B979374995FA52D59A83D568C9026EFBD9095FB2195A27B3B0ACB362", + "PreviousTxnLgrSeq": 94084599, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500712C56DFC5FEA", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500712C56DFC5FEA" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "Balance": "1000922652", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30301446 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7645DE0D353FF9ECB95EE6D8A5C51A666BBBA29860C30B45C529957871E586C1", + "PreviousFields": { + "Balance": "1000922667", + "Sequence": 30301445 + }, + "PreviousTxnID": "BD0872BB78B9F9A7A37B0510F53044F9137E9428E8CC90FAD4461AA644A642E4", + "PreviousTxnLgrSeq": 94084599 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "C148BF75768399490E4FA0A4210451EAA021F10FA57740F26CB0BE53850EB4CB", + "NewFields": { + "Account": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500710F9D2697AD1", + "Sequence": 30301445, + "TakerGets": "10189405910", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "202666.2646096955" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rUTEn2jLLv4ESmrUqQmhZfEfDN3LorhgvZ", + "RootIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "C1806EB01C8FA2A0E78311B4D24FBFD21003E89934435DB975F40610FE0D1FAC", + "PreviousTxnID": "BD0872BB78B9F9A7A37B0510F53044F9137E9428E8CC90FAD4461AA644A642E4", + "PreviousTxnLgrSeq": 94084599 + } + } + ], + "TransactionIndex": 40, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0.009704169982593124" + }, + "DeliverMax": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0.009704169982593124" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0.0002985896345682035" + }, + "Sequence": 29665815, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "E6C15D1583A5D958246AEC0C7F61D71F770523726E1D3D1D639707E0245CF617416DDA1381B1E65212478B0559EC3831A0434C84BE608B5649C74FFC66144F09", + "hash": "A602880FA0F31697D7454A2FFAC5981F5451027C83DDDEC2D5879D9F8B56E98E", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "374.5513114202406" + }, + "Flags": 16842752, + "HighLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0" + }, + "HighNode": "627", + "LowLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "raFbBJ3AVG1vrKS9DiKotxZnMbKuHxuecb", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "551510FCF1F0FDF14360C2D530D9449DBC89CA80D0BD1B07D55F5CC030EFB9EE", + "PreviousFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "374.5610155902232" + } + }, + "PreviousTxnID": "A4784B507419D46CE2FAD83EC4305BE86E9E6CD109AC07986E467F3E9F2A3A18", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0000000021191451317" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0" + }, + "HighNode": "257", + "LowLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "27" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "5F1CF805D1229FC7954D8E8D5B5CC87B90D02A82BFE8475E1A768AAC1E99775A", + "PreviousFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0002836618851887548" + } + }, + "PreviousTxnID": "C6CCF1D66193D6ACA31590E5452927E415C4E7E635301DE5198D03415927EEF8", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009704832179073668" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0" + }, + "HighNode": "3a7", + "LowLimit": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "2a" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "A92E75B22F28DBE5B8DA92B6365E02506C19727082EAF5E32E321F569131D24B", + "PreviousFields": { + "Balance": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0000006621964805439" + } + }, + "PreviousTxnID": "C0AC5CB24DF0450AC4AFA437C9626782B3017F2E6B2A73903B69E8922C759B77", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "A602880FA0F31697D7454A2FFAC5981F5451027C83DDDEC2D5879D9F8B56E98E", + "Balance": "97189474", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665816 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "C6CCF1D66193D6ACA31590E5452927E415C4E7E635301DE5198D03415927EEF8", + "Balance": "97189484", + "Sequence": 29665815 + }, + "PreviousTxnID": "C6CCF1D66193D6ACA31590E5452927E415C4E7E635301DE5198D03415927EEF8", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "10.94791755289698" + }, + "Flags": 16842752, + "HighLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0" + }, + "HighNode": "25a", + "LowLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "raFbBJ3AVG1vrKS9DiKotxZnMbKuHxuecb", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "F93714A9EE83A7D157B3B1DD40D2972139ACF334D8C297809695F467323C2F36", + "PreviousFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "10.94763389313094" + } + }, + "PreviousTxnID": "A4784B507419D46CE2FAD83EC4305BE86E9E6CD109AC07986E467F3E9F2A3A18", + "PreviousTxnLgrSeq": 94084597 + } + } + ], + "TransactionIndex": 13, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "0.009704169982593124" + } + } + }, + { + "Account": "rKU2yaZi8bzDAKjGDtw5KRmxiqm1oFWkWS", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92514129, + "SigningPubKey": "ED5E7E59D2D728B8DC1200F6BE56829F27EDDF92DB2D67D117738EA349DEAF7B09", + "TransactionType": "TrustSet", + "TxnSignature": "EB6101382EA2D3F46AD831A956BE853B152624F8447BAAA36330225AF5E8C23AC3899C41B9110315C7E442756CA35CB892FC75F89DC974AAA54B40E798E9E700", + "hash": "A63B38D8A47B8E267F3B9AD4024AA3D73EED00728EADBBCAA8054BDBF0C5D18F", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rKU2yaZi8bzDAKjGDtw5KRmxiqm1oFWkWS", + "Balance": "29969841", + "Flags": 0, + "OwnerCount": 6, + "Sequence": 92514130, + "TicketCount": 6 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1C705E24543DF87C621F03F454F78A82E415FE9B59821100660303A715F693D3", + "PreviousFields": { + "Balance": "29969853", + "Sequence": 92514129 + }, + "PreviousTxnID": "90D9E0EA5C771E5D75CD68DE67E7FE7C81F369550E12D4FB62A5BAF9C2BE9771", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 81, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Fee": "12", + "Flags": 0, + "LastLedgerSequence": 94084621, + "OfferSequence": 88619462, + "Sequence": 0, + "SigningPubKey": "EDBCC48EBFB7A77F0318265D45D93F860C9295E28FF89A57C7FDE6D2501441E750", + "TakerGets": "2147660", + "TakerPays": { + "currency": "XQN", + "issuer": "rahuJ7WNoKBATKEDDhx5t3Tj3f2jGhbNjd", + "value": "148114.459543371" + }, + "TicketSequence": 88619463, + "TransactionType": "OfferCreate", + "TxnSignature": "6B74B6446A1933C4C674764F98808D56B6BA8033CF5C9CD1C5AE81FAB2258B3BFF590B05BD4546A0785087288E0F3980BF751EF560A93FC08422FB1200D1AB06", + "hash": "A9DC504A4AD0F51BAA4233AAB40AAA0AB1ECCBC49740BFE1383F18337A2F852C", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Flags": 0, + "OwnerNode": "9f6a", + "PreviousTxnID": "E2C589482CFCB38CEF393F3FD4AC7060CFBB09B6F9F79CA3AD7B8DCD690AA56D", + "PreviousTxnLgrSeq": 94084513, + "TicketSequence": 88619463 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "0EECB664B614B4A46A4990FA563A007E38FC1E69C82F141959B06CAE48A84DFA" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Balance": "861688492", + "Flags": 0, + "OwnerCount": 171, + "Sequence": 88619466, + "TicketCount": 13 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5681BA06B7D08AD12A85CBCFD767A2E61D3D9BD590BBB5DDCBB35F22BAADA70F", + "PreviousFields": { + "Balance": "861688504", + "OwnerCount": 172, + "TicketCount": 14 + }, + "PreviousTxnID": "FB8EAF3BA6D534D9CF5072ADA03DEA1512D1EB2DADD19F0308B765DF313F2A97", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "814D1175BBEBDDFA95DD76A3439D716FC17A983BF20D509CD2F62E764A398E41", + "NewFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "BookDirectory": "E9865B19CF8CC68B55AF3FE9BB6D883D9622C024915DFD185318806B8A500A15", + "OwnerNode": "9f6a", + "Sequence": 88619463, + "TakerGets": "2147645", + "TakerPays": { + "currency": "XQN", + "issuer": "rahuJ7WNoKBATKEDDhx5t3Tj3f2jGhbNjd", + "value": "148114.459543371" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "BookDirectory": "E9865B19CF8CC68B55AF3FE9BB6D883D9622C024915DFD185318806B8A500A15", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "9f6a", + "PreviousTxnID": "4E7709B99AE33172137E754F9B3C83B295F98827DF04CA3ED06F5BE70590416A", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 88619462, + "TakerGets": "2147645", + "TakerPays": { + "currency": "XQN", + "issuer": "rahuJ7WNoKBATKEDDhx5t3Tj3f2jGhbNjd", + "value": "148114.459543371" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "824C17869C739C8BA6700A9F884072C5457DF61EC0171C383D650BC39A081ADA" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "9f60", + "Owner": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "RootIndex": "803D7CD7108997F42FA4DF5C63A16BCA2FF1232D2879FF9F357BCFC04C2CFF4C" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B3A97CB20739AFA0535FABDC2B08CD14A2FF05E2518F744BE24368F35DC1AA12", + "PreviousTxnID": "FB8EAF3BA6D534D9CF5072ADA03DEA1512D1EB2DADD19F0308B765DF313F2A97", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "ExchangeRate": "5318806b8a500a15", + "Flags": 0, + "RootIndex": "E9865B19CF8CC68B55AF3FE9BB6D883D9622C024915DFD185318806B8A500A15", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "00000000000000000000000058514E0000000000", + "TakerPaysIssuer": "37958924887BC1C5C48D9F27989AA12988C6096D" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E9865B19CF8CC68B55AF3FE9BB6D883D9622C024915DFD185318806B8A500A15" + } + } + ], + "TransactionIndex": 65, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961355, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": "1972690450", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4791.82292" + }, + "TicketSequence": 90961372, + "TransactionType": "OfferCreate", + "TxnSignature": "AD77C54B52AD4F7D49AAEDFCD5B0FA5EB684133DC095570138311137E717F22F60015B284850B77A1084536601E62B6A4289DFABBF7330D9832EAAA72710400B", + "hash": "AF0DF94A96F5DCBF4DB325D900E72EEAC7FC11C6FA31FBC73E9CE27AE3CCF350", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "ae9", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "1782C1B4315FA0CBD0005C53A718A1B8ED005AEA008067A3269B048EC625CBDD", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F8D85F26E8B", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "FEDAED4D458D230A6641FF06ED9ED2DE3FB3765E19D21D4EA524E4EA1106C6B7", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961355, + "TakerGets": "1183333038", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "2872.22145" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "419AA882C97C4F3A32880A2566EFA280E36F1788D40F4BB6B72D5E21E826B72A" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D", + "PreviousTxnID": "1782C1B4315FA0CBD0005C53A718A1B8ED005AEA008067A3269B048EC625CBDD", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f089f8d85f26e8b", + "Flags": 0, + "PreviousTxnID": "FEDAED4D458D230A6641FF06ED9ED2DE3FB3765E19D21D4EA524E4EA1106C6B7", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F8D85F26E8B", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F089F8D85F26E8B" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A13C7E1B0E27", + "NewFields": { + "ExchangeRate": "4f08a13c7e1b0e27", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A13C7E1B0E27", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421439", + "Flags": 0, + "OwnerCount": 34, + "Sequence": 90961404, + "TicketCount": 20 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421449", + "OwnerCount": 35, + "TicketCount": 21 + }, + "PreviousTxnID": "1782C1B4315FA0CBD0005C53A718A1B8ED005AEA008067A3269B048EC625CBDD", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "C675517E37485F04CAA08D09FDD566928FAC14072AE0CA458FA8521766474BA6", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A13C7E1B0E27", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961372, + "TakerGets": "1972689639", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4791.82292" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961372 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "D369DAD33544DF8E6E98B9D0C1CC6631BC343FF36C8FEF7BD0BD02262A948FFE" + } + } + ], + "TransactionIndex": 22, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Fee": "20", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 167782386, + "Sequence": 167782397, + "SigningPubKey": "0253C1DFDCF898FE85F16B71CCE80A5739F7223D54CC9EBA4749616593470298C5", + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "477908.2676" + }, + "TakerPays": "200000000000", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100B3CE8B4E397D6D113917F109ECD2311F951030C78669FF39BFBF940297F6C295022051FB8B78CA695999A25C9F8B425C63D03BE3B00911D8C46BF63331A8BCB49FAD", + "hash": "AFBC4B1DEE866310A10586B8A1F2C3BB00044FB3D20111BD3488E3E5B3DA5F28", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "RootIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "0A2600D85F8309FE7F75A490C19613F1CE0C37483B856DB69B8140154C2335F3", + "PreviousTxnID": "7F95B207AEF1A05E5CE0814A865A067F540B425E26AD4650498B72311CF2ECE1", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "Balance": "15035590650", + "Flags": 0, + "OwnerCount": 17, + "Sequence": 167782398 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1ED8DDFD80F275CB1CE7F18BB9D906655DE8029805D8B95FB9020B30425821EB", + "PreviousFields": { + "Balance": "15035590670", + "Sequence": 167782397 + }, + "PreviousTxnID": "7F95B207AEF1A05E5CE0814A865A067F540B425E26AD4650498B72311CF2ECE1", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0ede258600e7dc", + "Flags": 0, + "PreviousTxnID": "1F2A5340F8E3DE7264852AB45FF128B7FD836A21A40EA9295DDE0C2CB3E321E3", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE258600E7DC", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE258600E7DC" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE25C8CFD918", + "NewFields": { + "ExchangeRate": "5a0ede25c8cfd918", + "RootIndex": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE25C8CFD918", + "TakerGetsCurrency": "0000000000000000000000005553440000000000", + "TakerGetsIssuer": "0A20B3C85F482532A9578DBB3950B85CA06594D1" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE258600E7DC", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "1F2A5340F8E3DE7264852AB45FF128B7FD836A21A40EA9295DDE0C2CB3E321E3", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 167782386, + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "477908.3956" + }, + "TakerPays": "200000000000" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "721EB9FA3A4C5DEE5A0B9B237CC15C6DA6C23B63764764C4081F8F9EC67D3227" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8616F1E46276A8A29C1A59E1555BDC0DDC3C3CECA58559CD4D39DE7042264FB5", + "NewFields": { + "Account": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah", + "BookDirectory": "4627DFFCFF8B5A265EDBD8AE8C14A52325DBFEDAF4F5C32E5A0EDE25C8CFD918", + "Sequence": 167782397, + "TakerGets": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "477908.2676" + }, + "TakerPays": "200000000000" + } + } + } + ], + "TransactionIndex": 35, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 144101819, + "Sequence": 144101823, + "SigningPubKey": "022D40673B44C82DEE1DDB8B9BB53DCCE4F97B27404DB850F068DD91D685E337EA", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "175880.080312247" + }, + "TakerPays": "14167002716", + "TransactionType": "OfferCreate", + "TxnSignature": "304402200B5764B7323F93788CF61F3FF44DA61BAF14738123ACF8D747DA24EEBBB1E725022052C480C11435893DFB338DC291DE2333268B91BF4257FA3E10A265837944719D", + "hash": "B144ED0857D28D46399688B036CF896E6DBF1EB5EE1CB750B4E64B39C5771580", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "591c99f8079989c7", + "Flags": 0, + "PreviousTxnID": "22D17DB049759921024643ACCE3E267B545B61888F8D3BD4334FD34541EB1D42", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C99F8079989C7", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C99F8079989C7" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C9DE8994C7B12", + "NewFields": { + "ExchangeRate": "591c9de8994c7b12", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C9DE8994C7B12", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C99F8079989C7", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "22D17DB049759921024643ACCE3E267B545B61888F8D3BD4334FD34541EB1D42", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 144101819, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "34994.6523394669" + }, + "TakerPays": "2817275949" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "58CC8A9D58CDEFC7E558E083B1D8CBD508E893A16EFAF927DFA37583C34F1935" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "RootIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A", + "PreviousTxnID": "600406517AEF040B3234E374B6FD1559E7B9B96CC1947C5248E7C0124C9DD7A6", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "C9844901B27807FDCC1E98424DEB10F947104BA9098D9A405AEDAAF3B3BB371A", + "NewFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591C9DE8994C7B12", + "Sequence": 144101823, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "175880.080312247" + }, + "TakerPays": "14167002716" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Balance": "100345322", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 144101824 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E0311EB450B6177F969B94DBDDA83E99B7A0576ACD9079573876F16C0C004F06", + "PreviousFields": { + "Balance": "100345337", + "Sequence": 144101823 + }, + "PreviousTxnID": "600406517AEF040B3234E374B6FD1559E7B9B96CC1947C5248E7C0124C9DD7A6", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 2, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 143700482, + "Sequence": 143700484, + "SigningPubKey": "039451ECAC6D4EB75E3C926E7DC7BA7721719A1521502F99EC7EB2FE87CEE9E824", + "TakerGets": "12495760185", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "234340.1133430221" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402200339EC464DA0FFFE333C665D8CA29588AAD3BEFC86E45838978FABB7285DF35B02200805FA5C7E4DB8392E9AF1E484814D42E6046FE58EFE57E602631DBA50C4440D", + "hash": "B41B4A1755A29B0303E9B8BAFF0222F8057C6B1417E9FA8F3CB88C65752DD1B9", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "RootIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96", + "PreviousTxnID": "29C80692C5948BDB2B0BB15BC622F7F55E7B1D3C8BB9706514E4B0C93D94F80A", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F5742508CA67", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "CC420A9ABF281E07FE7CB3E6EB4FA28CB6FB73F9F44EDEE23E4403C4FFA256D1", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 143700482, + "TakerGets": "18745454168", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "472700.1812146666" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "085252F376D68D77F60E49299CD72D40CA0D39B3DD24289ED176E50ABD860E68" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Balance": "1000571184", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 143700485 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47FE64F9223D604034486F4DA7A175D5DA7F8A096952261CF8F3D77B74DC4AFA", + "PreviousFields": { + "Balance": "1000571199", + "Sequence": 143700484 + }, + "PreviousTxnID": "29C80692C5948BDB2B0BB15BC622F7F55E7B1D3C8BB9706514E4B0C93D94F80A", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006A9A093D1277A", + "NewFields": { + "ExchangeRate": "5006a9a093d1277a", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006A9A093D1277A", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5008f5742508ca67", + "Flags": 0, + "PreviousTxnID": "CC420A9ABF281E07FE7CB3E6EB4FA28CB6FB73F9F44EDEE23E4403C4FFA256D1", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F5742508CA67", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F5742508CA67" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8847405BE430A0CC44B50D5F08C46EDF37580EAC381E86A5A1CED80DE104CCE2", + "NewFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006A9A093D1277A", + "Sequence": 143700484, + "TakerGets": "12495760185", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "234340.1133430221" + } + } + } + } + ], + "TransactionIndex": 75, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0.7398980323244749" + }, + "DeliverMax": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0.7398980323244749" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "1046.540782035757" + }, + "Sequence": 29665811, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "F122663ED4C18B2054914117A9BACE4F2D34B780A1E7617E20AA3B2F6832205853A5A5B9139C14DE17D97E76CDE47248BD90BA61B1AA4D762D412D62A55B6804", + "hash": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-23969.39576384686" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rEwHAKhGbEA7D3waJxJogEd3meB28BUxQQ", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0" + }, + "LowNode": "9e2" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "68B3AA9DFFCC287696289234F24293A8D24E45B1451FE1E5582EA5E42A713F92", + "PreviousFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-23970.13566187918" + } + }, + "PreviousTxnID": "D8D3790D984DE63B306E0968631D3C991FBF007288362337B9837429BC3ECEF8", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "272271.6345399191" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "0" + }, + "HighNode": "33e", + "LowLimit": { + "currency": "OVO", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CF7D03A277BB38033EE1039387650B3720EB33056781C1BE75B19A4FC6B999AD", + "PreviousFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "273265.8465681891" + } + }, + "PreviousTxnID": "842C902D24727B066525EC681B562AFEFF28B6645C479A41A7748FC865A40B8A", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-32209029.01873399" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "OVO", + "issuer": "rEwHAKhGbEA7D3waJxJogEd3meB28BUxQQ", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "OVO", + "issuer": "r3jQzqfGVagsWNbSxMJpQV8VK7jHHmdv5j", + "value": "0" + }, + "LowNode": "346" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "D7026D6DDEAF1FEF6E1D38A016474992EAFB7C777102F0B43D1FA14B96D9DD4C", + "PreviousFields": { + "Balance": { + "currency": "OVO", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-32208034.80670572" + } + }, + "PreviousTxnID": "D8D3790D984DE63B306E0968631D3C991FBF007288362337B9837429BC3ECEF8", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "B4F866A6615F27437ED0D1B8423D254BC53F390363D16C402243EDCBE8BAF0A7", + "Balance": "97189514", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665812 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "8AA7CCD01D404D192EB7CDD923B7DC54CFCAA0B3DAD406E7DBA09DA4476D3366", + "Balance": "97189524", + "Sequence": 29665811 + }, + "PreviousTxnID": "8AA7CCD01D404D192EB7CDD923B7DC54CFCAA0B3DAD406E7DBA09DA4476D3366", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.7414391230515426" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0" + }, + "HighNode": "9d4", + "LowLimit": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "EDFD482EE5A971AE673A8B5EB79405006DB3287A0B4B76C7888BAF899FF62FF7", + "PreviousFields": { + "Balance": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0015410907270677" + } + }, + "PreviousTxnID": "DC5248296A413031ADBB0518E9827A136A19B157CAC7004862CE1802F3621417", + "PreviousTxnLgrSeq": 94084597 + } + } + ], + "TransactionIndex": 9, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "5377697373546563680000000000000000000000", + "issuer": "raq7pGaYrLZRa88v6Py9V5oWMYEqPYr8Tz", + "value": "0.7398980323244749" + } + } + }, + { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Expiration": 792720015, + "Fee": "10", + "Flags": 65536, + "LastLedgerSequence": 94084626, + "OfferSequence": 90961354, + "Sequence": 0, + "SigningPubKey": "ED4A8371720A1D404927F0B32DD49BDE4F8E2A8177D027482492AEE4F3C5045834", + "TakerGets": "3945380900", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9593.19366" + }, + "TicketSequence": 90961365, + "TransactionType": "OfferCreate", + "TxnSignature": "E395BC8E3E15ED75D90D9600C730AACBADEEF63EE114A59692EF8F91DD336A82E567655BE06B6D480DD5C14278D804CDAE00E20155446D3AB86093A172868D04", + "hash": "B6D1CDD6F4E841DCF81A641B66C3FAABE9A29831D5313461AE5BFD628757394E", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "ae9", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "32D3BEA733A3C7B90A32A6A57DF912F7BE843090DD460A54255F8083E925C2ED", + "PreviousTxnID": "41C32E3263D805CA78BD473900F08B59EA64CE8DA5FE2F86D98C29C37643D6F2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBD5E35BB6C00", + "BookNode": "0", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "PreviousTxnID": "02B487B97577865E208C1ECC0BFFE01D70A292477D0D03F2F9DA1B0AB58051BF", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 90961354, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "4753.645047726341" + }, + "TakerPays": "1972221730" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "4F9FBCD1B40F30E74FA8A0C706F5F4CEFEA6F55C4CBA0A396D6A5F815892F0F3" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "aea", + "IndexPrevious": "412", + "Owner": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "RootIndex": "F6ED7E4F8D3EAE3D246D421803B101F4C204AA91046C647121563B6F7DFD9310" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "53E435E1C3E5EBBA12349B35AD36843988423C4C6E64C6D3E92F508C6CEC005D", + "PreviousTxnID": "41C32E3263D805CA78BD473900F08B59EA64CE8DA5FE2F86D98C29C37643D6F2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A36FF160E419", + "NewFields": { + "ExchangeRate": "4f08a36ff160e419", + "RootIndex": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A36FF160E419", + "TakerPaysCurrency": "524C555344000000000000000000000000000000", + "TakerPaysIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Balance": "48203421459", + "Flags": 0, + "OwnerCount": 36, + "Sequence": 90961404, + "TicketCount": 22 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "AB4F967F07A17B276A162D2BE831BB2B4BB7D28C58A71E2B47040114CE4599AE", + "PreviousFields": { + "Balance": "48203421469", + "OwnerCount": 37, + "TicketCount": 23 + }, + "PreviousTxnID": "41C32E3263D805CA78BD473900F08B59EA64CE8DA5FE2F86D98C29C37643D6F2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0ebd5e35bb6c00", + "Flags": 0, + "PreviousTxnID": "02B487B97577865E208C1ECC0BFFE01D70A292477D0D03F2F9DA1B0AB58051BF", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBD5E35BB6C00", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EBD5E35BB6C00" + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "Flags": 0, + "OwnerNode": "ae9", + "PreviousTxnID": "A6F924B090289827515733829A2C4CAF2DABEA5920F6F1B845515F9E243D1D9D", + "PreviousTxnLgrSeq": 94084581, + "TicketSequence": 90961365 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "D3384A09A73FAC8F37658ACD33DB254EB22CDA4352FD226DC79B6B6B72F92775" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "D51D46912D5631316ECA8F8C85546546A9419442B9150E800E5F9BBB0297BB08", + "NewFields": { + "Account": "rpiFwLYi6Gb1ESHYorn2QG1WU5vw2u4exQ", + "BookDirectory": "54123B870896F4964184D7042DB75D78913D3E377BFC4ECA4F08A36FF160E419", + "Expiration": 792720015, + "Flags": 65536, + "OwnerNode": "aea", + "Sequence": 90961365, + "TakerGets": "3945379278", + "TakerPays": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9593.19366" + } + } + } + } + ], + "TransactionIndex": 20, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Amount": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "270324.4695317294" + }, + "DeliverMax": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "270324.4695317294" + }, + "Destination": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": "86718", + "Sequence": 94793203, + "SigningPubKey": "ED9C7A917E06AE3550AEA072D25D3EAABDBB8D6AC1A1C0AF316866082D10145FF6", + "TransactionType": "Payment", + "TxnSignature": "AF66CD6A25E5A862B3CC73DABAD8F233C721BCC3C8031DA642992A1FC62F819E7DD046F76E6F80A916CA9221B7E5D4160D14F86CEE12CCE21508E407FE7FFE0C", + "hash": "B7F6C0B673059887974E71DD5C50FAA1AE1F6D3A3893B2DA4455F2F6CEA85FCD", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Balance": "5611216635", + "Flags": 0, + "OwnerCount": 1237, + "Sequence": 94793204 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7A794B5256B0129A726B10E003DC3EF737C4FB00216A74A2560B0B544D702136", + "PreviousFields": { + "Balance": "5611299025", + "Sequence": 94793203 + }, + "PreviousTxnID": "DA8E94D41443A9C2FEB64FE20D327D090E09EC99E5E2FF55C986AE0EF6B955DE", + "PreviousTxnLgrSeq": 94084601 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "270324.4695317294" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "0" + }, + "HighNode": "13", + "LowLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "value": "9999999999999999e80" + }, + "LowNode": "a3" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "97EE65EC49FBD6A89E785DB49AEC04E11936B0017382C623F0B4266801C41F6C", + "PreviousFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + } + }, + "PreviousTxnID": "0F18A7377BEE81BFAB68131DB75C49C9ED3CC337973D4BE06660E82AC6071454", + "PreviousTxnLgrSeq": 94084555 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "A352BC92EBEDAB8EF7C02AB7D6E8A8AD0F1CE559459E49D158809F41CC0ED4CA", + "Account": "rf4W6VgoWtJo8KVKMjJEUhT98whxWanXzh", + "Balance": "134540035", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 93002742 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "BDB85A103C0FB55B8EB4E703C89D44DB4118A6B7B53A814852813C5BB28547FB", + "PreviousFields": { + "Balance": "134457655" + }, + "PreviousTxnID": "4BE7C3F6049FB7EAF32520C2778DFA49471AD9B6F613544433A32EE4543B8B86", + "PreviousTxnLgrSeq": 94084381 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "445671731.2875589" + }, + "Flags": 16842752, + "HighLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rf4W6VgoWtJo8KVKMjJEUhT98whxWanXzh", + "value": "0" + }, + "LowNode": "0" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "F11C7763D09A46869FA8EFD6FF73E5B5249FF36E5559F8C78976D61F8A8539FA", + "PreviousFields": { + "Balance": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "445942055.7570906" + } + }, + "PreviousTxnID": "4BE7C3F6049FB7EAF32520C2778DFA49471AD9B6F613544433A32EE4543B8B86", + "PreviousTxnLgrSeq": 94084381 + } + } + ], + "TransactionIndex": 4, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "4C41574153000000000000000000000000000000", + "issuer": "rfAWYnEAkQGAhbESWAMdNccWJvdcrgugMC", + "value": "270324.4695317294" + } + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 123729227, + "Sequence": 123729333, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TransactionType": "OfferCancel", + "TxnSignature": "3045022100CED5B789F3406D9679573B10B390F9598BE34B33D17D7ACC01ED416A5834446602204D231B8F3F54B429CCE4637F24B63224532A6CFFC627303EA9C6430249297D97", + "hash": "B83FC54EA93F2FCDDC1B982F784F63422D55FB6EE93258CAB077D473A49557C4", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD43232B3E", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "19b13", + "PreviousTxnID": "4B420B3D3E880D1D132EF7A05A0B498BF8539E1C02DBA13B21DA3F3BDF77CD69", + "PreviousTxnLgrSeq": 94084574, + "Sequence": 123729227, + "TakerGets": "29365223570", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "70638.44245112776" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "6C429E3A7545CCE0856D5583ADF226921ABB5A4AB4B22DB0002CC65BB24FD435" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "19b14", + "IndexPrevious": "19b12", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "7487E15A9421AEC70D13D44C8BE43B46ACA11BD74638F4D8EEE22D71DE18CE83", + "PreviousTxnID": "D97E7B6B54197AF80758623D4C4A818D64E515D4961DB2814F9BCBECBC69B705", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028975", + "Flags": 0, + "OwnerCount": 136, + "Sequence": 123729334 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028985", + "OwnerCount": 137, + "Sequence": 123729333 + }, + "PreviousTxnID": "D97E7B6B54197AF80758623D4C4A818D64E515D4961DB2814F9BCBECBC69B705", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f088bcd43232b3e", + "Flags": 0, + "PreviousTxnID": "4B420B3D3E880D1D132EF7A05A0B498BF8539E1C02DBA13B21DA3F3BDF77CD69", + "PreviousTxnLgrSeq": 94084574, + "RootIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD43232B3E", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "0000000000000000000000004555520000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD43232B3E" + } + } + ], + "TransactionIndex": 50, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Memos": [ + { + "Memo": { + "MemoData": "7450534B685770486C633275716147467038494252", + "MemoType": "696E7465726E616C6F726465726964" + } + } + ], + "OfferSequence": 97505273, + "Sequence": 97505281, + "SigningPubKey": "034D6788B751D18BBE92CAF1255431512D6D187446D47FAEE20FDB0BFA8144DB1E", + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9996.4912477595" + }, + "TakerPays": "4136781550", + "TransactionType": "OfferCreate", + "TxnSignature": "304502210087DF7A63C88E8FD841DE8B45258CFF076344A5850A2FF84BF6E4E2A8096456F70220306A1957357C5AE48EE64497F54FD5E9B9E800646D952AF8A336020E273D22C3", + "hash": "BBEFC10A4F627378921E0AB5D8F2205D1C74FDE4B8714EDABCF175B5C99DC127", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB19DCE1DF200", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "1", + "PreviousTxnID": "ACCE0C697B59D1390490BFD99017D1C1D35FB8BEFFDD1599F3BF8AB15E75BDC2", + "PreviousTxnLgrSeq": 94084607, + "Sequence": 97505273, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9996.46293310277" + }, + "TakerPays": "4134478090" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "385E7B214CE6F449151B303DAF38127B8D542D358DA905EE8A8BE306AEF44EE2" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "3B2759738A5C0E5EB5600C93EF43B2033616616F3E603F4EB95410C5BD6769A2", + "NewFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "BookDirectory": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB3B3AF914400", + "OwnerNode": "1", + "Sequence": 97505281, + "TakerGets": { + "currency": "524C555344000000000000000000000000000000", + "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De", + "value": "9996.490169478092" + }, + "TakerPays": "4136781550" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "Balance": "60817108113", + "Flags": 0, + "OwnerCount": 34, + "Sequence": 97505282 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "6BC9286C5146B76D0D140873B509D72581AABEB79037BF1D9849830FBF5A9FE6", + "PreviousFields": { + "Balance": "60817108128", + "Sequence": 97505281 + }, + "PreviousTxnID": "60E05E95317698F61A0737910912AED820EB0E49DF590A7FC878ABCE02547263", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5a0eb19dce1df200", + "Flags": 0, + "PreviousTxnID": "ACCE0C697B59D1390490BFD99017D1C1D35FB8BEFFDD1599F3BF8AB15E75BDC2", + "PreviousTxnLgrSeq": 94084607, + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB19DCE1DF200", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB19DCE1DF200" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB3B3AF914400", + "NewFields": { + "ExchangeRate": "5a0eb3b3af914400", + "RootIndex": "CFEC8953D22B1B50F20F46ECBCD51990A26BDB71951ED8265A0EB3B3AF914400", + "TakerGetsCurrency": "524C555344000000000000000000000000000000", + "TakerGetsIssuer": "E5E961C6A025C9404AA7B662DD1DF975BE75D13E" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rfmdBKhtJw2J22rw1JxQcchQTM68qzE4N2", + "RootIndex": "49B537464A9659478275132402EB6D5E8723F42ED20DB3CF4A4527A9A3F1589A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "E06052755A83D52A63C3392B87634326BE0E4E68ECB59B7DF3A2B1851229208D", + "PreviousTxnID": "60E05E95317698F61A0737910912AED820EB0E49DF590A7FC878ABCE02547263", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 45, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rBB5X3CxT8LGbwKqUszz9bx1DMshqK2Z7g", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92796532, + "SigningPubKey": "EDF5F8831C5D41BC9F51E71499A16381B6C7E7BCCCE2B52F12489192904CE60C66", + "TransactionType": "TrustSet", + "TxnSignature": "1751679A4B73BD767DBC376DD6EB6E6E3E36688918E31992A9CEFD38864B160E8F4CE6CD9C31EB0DC56C2E70961FFDB0E154AAAF37E9C2D852FFA29F7F91CE0C", + "hash": "BDCDEAF11F3612816EF695496D670D965B61C5245D0DBBB265896A94B2D237F7", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rBB5X3CxT8LGbwKqUszz9bx1DMshqK2Z7g", + "Balance": "29989867", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92796533, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8F39B8C6355F4E9DF1EDCD03013270D902DFB5E550D78092EAEC81F35F93C8CE", + "PreviousFields": { + "Balance": "29989879", + "Sequence": 92796532 + }, + "PreviousTxnID": "AC8DDDA3878D1CA18AF82EFD2B1E3C0E3C4E487C08FE6B90DB5F21C3D58AE0D9", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 33, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rQEGtFudk3FPi4CuSDdDyvqSgQjZeALySy", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92796241, + "SigningPubKey": "EDA8C92DC4159A7CBC2DB590C690DEED3E7103BEEF73201391AFF4E7DA3946AF70", + "TransactionType": "TrustSet", + "TxnSignature": "B27B18AE82E7BE59CB0A1D782CC980DBEFFBE5FA4B9F3CC344677A33E0F7F91AEB0C888EC6C7B93CD921A3E81204867B4883C8CB396BDB0F3CBA3F9B497F380F", + "hash": "BFDCBE69E62B19CCCCF9762354BDD65465222F4E2723F8E15DF62763FDE4624F", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQEGtFudk3FPi4CuSDdDyvqSgQjZeALySy", + "Balance": "29692527", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92796242, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "46D0961B6A6C965D6A825C17348660DBA43D058F0FC600C35094DEC6C1519845", + "PreviousFields": { + "Balance": "29692539", + "Sequence": 92796241 + }, + "PreviousTxnID": "171CFD345FCD799E629B2CB4E7FE7868DF718E5F925DF15B4E7663A4BB6C91C3", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 79, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rsciveSyY95Vn9ba1nSGiBcTdhQdZWkrBv", + "Fee": "12", + "Flags": 2228224, + "LastLedgerSequence": 94084626, + "LimitAmount": { + "currency": "5748590000000000000000000000000000000000", + "issuer": "rUikrq6kQdeuQAmowgRtazfi46qvQHzEBD", + "value": "0" + }, + "Sequence": 92794453, + "SigningPubKey": "EDB5373B48D053FC87BCBB677B3B9D1984EE804C7251551F98712D367BFB8F6C8A", + "TransactionType": "TrustSet", + "TxnSignature": "906BF6C042AFE9A6C43A7CE80A464C76F168510CB9D2E4077539CDD129EF1A3C240D50F3916A099B1798430FBD534646B328F158E30B699059CC76178025400B", + "hash": "BFE0B3D5EDB8A7E3A41F203EA06A93558B0375D21F59FFF5D9C321C1ABB8D486", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rsciveSyY95Vn9ba1nSGiBcTdhQdZWkrBv", + "Balance": "29682734", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 92794454, + "TicketCount": 5 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "3885EAEAAE48A3E0C0BE1260872CD0C02E719A7D546D2C393D334305A13993FC", + "PreviousFields": { + "Balance": "29682746", + "Sequence": 92794453 + }, + "PreviousTxnID": "B7E1CC08EC15F1364901C6AB3246F53911A60B65E697721301EF772B76A000DA", + "PreviousTxnLgrSeq": 94080355 + } + } + ], + "TransactionIndex": 28, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0.0002836601528397933" + }, + "DeliverMax": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0.0002836601528397933" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.01022059659998695" + }, + "Sequence": 29665814, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "377DD518A9FC3A677DFEE534D6EC650F8B6D2CE35DC7F96FFA8E1A48CECE02978C01077A9E5F85F8CC9E0645F0E4DF91D3A6B1B5C7FC707D65AB7B014EC1460A", + "hash": "C6CCF1D66193D6ACA31590E5452927E415C4E7E635301DE5198D03415927EEF8", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0002836618851887548" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0" + }, + "HighNode": "257", + "LowLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "27" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "5F1CF805D1229FC7954D8E8D5B5CC87B90D02A82BFE8475E1A768AAC1E99775A", + "PreviousFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.0000000017323489615" + } + }, + "PreviousTxnID": "A4784B507419D46CE2FAD83EC4305BE86E9E6CD109AC07986E467F3E9F2A3A18", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-2.582410001205142" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "r3o25dZscweKkkh1WxjXLZ1yUW4itQ5E6r", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0" + }, + "LowNode": "254" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "BD923737FA1FA0BCC2C07C6A72681C675E1A5054BA22875105619B5EEAE82295", + "PreviousFields": { + "Balance": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-2.582693661357982" + } + }, + "PreviousTxnID": "542A160F911E55FD6D59376A85FC69B2AA4495F7A6C863F94383A3D7005304D2", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.000001749818101029" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "HighNode": "bfa", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CE8BC6520C7A30953A4AC6733394E6924DAA4C3CB16CFB9EAC02EA7494417D59", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009711236922062219" + } + }, + "PreviousTxnID": "DADC4E8966CB4A1023558E74EF0C15BC886903795B06459D84507002574A0216", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-88.00659159830168" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "USD", + "issuer": "r3o25dZscweKkkh1WxjXLZ1yUW4itQ5E6r", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "LowNode": "be6" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "D76538A732D9E3D87753D16FF280F7836AF5B796D263A9D038705BA95E6A8BF8", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-87.99689665361475" + } + }, + "PreviousTxnID": "542A160F911E55FD6D59376A85FC69B2AA4495F7A6C863F94383A3D7005304D2", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "C6CCF1D66193D6ACA31590E5452927E415C4E7E635301DE5198D03415927EEF8", + "Balance": "97189484", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665815 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "DADC4E8966CB4A1023558E74EF0C15BC886903795B06459D84507002574A0216", + "Balance": "97189494", + "Sequence": 29665814 + }, + "PreviousTxnID": "DADC4E8966CB4A1023558E74EF0C15BC886903795B06459D84507002574A0216", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 12, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "5341564500000000000000000000000000000000", + "issuer": "rfAJaM2jr8frHwcXY52gLeqDEUmAFmzqFT", + "value": "0.0002836601528397933" + } + } + }, + { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Amount": "120120", + "DeliverMax": "120120", + "Destination": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Fee": "10", + "Flags": 131072, + "LastLedgerSequence": 94084609, + "SendMax": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "2445.972331050167" + }, + "Sequence": 94793205, + "SigningPubKey": "ED9C7A917E06AE3550AEA072D25D3EAABDBB8D6AC1A1C0AF316866082D10145FF6", + "TransactionType": "Payment", + "TxnSignature": "8507AB126DAF12E275B9EEED9969CF53FA846298055432954E554386A2D70909DD1CDFB48BD729E8B1996EF690C6BE7B45CCF1DA903BDBADB5912E9DF9FA0804", + "hash": "C712C85CB03443D87FB3D6892620F895B298E91A6FFE706B2B323B71CD73B340", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-44878963.17464885" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rNiL5mNNoMMQJrFJH9Ku9YePUZDXMci2VM", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "0" + }, + "LowNode": "311" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "1FF5CD8341A3AEE851417398E6E4834B7DDA1B23035405B66810965DC0094C0E", + "PreviousFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-44877348.56538383" + } + }, + "PreviousTxnID": "48C4D986E46EC5E23865917460D0B39A5BEC14D90AD2269CFE6C255B789D9834", + "PreviousTxnLgrSeq": 94084597 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "Balance": "5611300080", + "Flags": 0, + "OwnerCount": 1237, + "Sequence": 94793206 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7A794B5256B0129A726B10E003DC3EF737C4FB00216A74A2560B0B544D702136", + "PreviousFields": { + "Balance": "5611216625", + "Sequence": 94793205 + }, + "PreviousTxnID": "7D3D5A6EABDE581B58CEC2CD03354BB4C0CCF37DDEABFBEE130F6CBC78BEE2C2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "r9rRLst96Ue4YTDQkWWkX1ePB6p6Ye4FkA", + "value": "0" + }, + "HighNode": "336", + "LowLimit": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rhubarbMVC2nzASf3qSGQcUKtLnAzqcBjp", + "value": "9999999999999999e80" + }, + "LowNode": "95" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "BDDB87931825E4185EA1FD9EAF134270EBC1F74BBDFA967F67C511B5FC8034F4", + "PreviousFields": { + "Balance": { + "currency": "58525061794E6574000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "1614.6092650151" + } + }, + "PreviousTxnID": "7D3D5A6EABDE581B58CEC2CD03354BB4C0CCF37DDEABFBEE130F6CBC78BEE2C2", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "BC5D2834CE4875A98BE1FD9F3EDBE9EB5B81481CB064E8FF333DFADE1371664E", + "Account": "rNiL5mNNoMMQJrFJH9Ku9YePUZDXMci2VM", + "Balance": "2342732937", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 86796106 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "CA0D6B4B8399F382BC16C74362E685717A6A0601FCBC2EAAFD9475680DBFFF99", + "PreviousFields": { + "Balance": "2342816402" + }, + "PreviousTxnID": "48C4D986E46EC5E23865917460D0B39A5BEC14D90AD2269CFE6C255B789D9834", + "PreviousTxnLgrSeq": 94084597 + } + } + ], + "DeliveredAmount": "83465", + "TransactionIndex": 6, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "83465" + } + }, + { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 143700480, + "Sequence": 143700486, + "SigningPubKey": "039451ECAC6D4EB75E3C926E7DC7BA7721719A1521502F99EC7EB2FE87CEE9E824", + "TakerGets": "2998720770", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "75577.50924815325" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100F77C7DA67DC8864CC2D383898F3E83689BAF816621072C6701441EA6C5490A240220402B6A5781A42573CC327F36C96AADBF3C4CC603EDC3884ABFFD25F05AFA7A32", + "hash": "CD5F359A7BB3BA488F8742EC99D8918A60C2E1976954BBC6889F96F8B4CE8CBC", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "RootIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "07CE63F6E62E095CAF97BC77572A203D75ECB68219F97505AC5DF2DB061C9D96", + "PreviousTxnID": "92631532977C634CA40221035BAA3E4FFDE6EB2B3B229AE36DE7465600ABDF0E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006AA8B454E412A", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "22C661D131720C292108308DE522BCEE19BB067DF86EDE574FC319E9DB28CE1B", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 143700480, + "TakerGets": "6209023302", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "116503.9400927664" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "3F44E10C852583F23DF58A445F93D8100F58274AF9BA10F087C37F060A03E9CD" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "Balance": "1000571154", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 143700487 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "47FE64F9223D604034486F4DA7A175D5DA7F8A096952261CF8F3D77B74DC4AFA", + "PreviousFields": { + "Balance": "1000571169", + "Sequence": 143700486 + }, + "PreviousTxnID": "92631532977C634CA40221035BAA3E4FFDE6EB2B3B229AE36DE7465600ABDF0E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "5D662638B65DA1B17579962C131AC80754E006BA72326D93CEE01A86335210A8", + "NewFields": { + "Account": "rQ3fNyLjbvcDaPNS4EAJY8aT9zR3uGk17c", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F438E458C909", + "Sequence": 143700486, + "TakerGets": "2998720770", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "75577.50924815325" + } + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5006aa8b454e412a", + "Flags": 0, + "PreviousTxnID": "22C661D131720C292108308DE522BCEE19BB067DF86EDE574FC319E9DB28CE1B", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006AA8B454E412A", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475006AA8B454E412A" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F438E458C909", + "NewFields": { + "ExchangeRate": "5008f438e458c909", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475008F438E458C909", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + } + ], + "TransactionIndex": 77, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 123729274, + "Sequence": 123729330, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TransactionType": "OfferCancel", + "TxnSignature": "3045022100EE6AB28827BEEE365EA4F511D8637F4CC08748328711FAB74108C874ABDB78BD0220140555EDA88DC1EDFDB1DE53A6C885712735D868217CF21BF7E6C90EBDD6A363", + "hash": "D3CAD77DA369288D6E9F3D828977F1B8BCDD59C622892D7D77E1C64D3008A947", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "19b14", + "PreviousTxnID": "18CB4A6DC8D64CF6A5E7E32AC992F628CBC0C1E694B184416D49F172CCE22FF8", + "PreviousTxnLgrSeq": 94084588, + "Sequence": 123729274, + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "19.2650587000909" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "2483.94997602557" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "495EB181702D5485E87F7E9B651EF5BB90BC8D870807B0011AEF4B10A6A22CFB" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960029005", + "Flags": 0, + "OwnerCount": 139, + "Sequence": 123729331 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960029015", + "OwnerCount": 140, + "Sequence": 123729330 + }, + "PreviousTxnID": "8875B2DBC3122739C9084140C33525B198E6FED0B2DC63CB8623485AC056D6A1", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "ExchangeRate": "570494a95ac3ae00", + "Flags": 0, + "RootIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "TakerGetsCurrency": "0000000000000000000000004C54430000000000", + "TakerGetsIssuer": "06B36AC50AC7331069070C6350B202EAF2125C7C", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "PreviousTxnID": "BF6F729EE2D6C941EB84ADE4E14C0E0A2631CD2568AD83A426F087975CDB37FE", + "PreviousTxnLgrSeq": 94084588 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "19b15", + "IndexPrevious": "19b13", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "DF3339FE796ED3E629118B760BB5CDB86E3D496F8FCDAC784A7AEA7B40C68BEA", + "PreviousTxnID": "8811AC23838EF6BB3216574569DB0127F8F87580B4C4330969900196FF1A2A3F", + "PreviousTxnLgrSeq": 94084599 + } + } + ], + "TransactionIndex": 47, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rHrsM2gD2EqiziogUgDT4DunwjwJLxi3ZZ", + "Amount": "90000", + "DeliverMax": "90000", + "Destination": "ryouhapPYV5KNHmFUKrjNqsjxhnxvQiVt", + "Fee": "12", + "InvoiceID": "4D0ECFCDD6CAFC206878C65CF487544AC90AE7B5462B9448E96A4D24624AFE54", + "Memos": [ + { + "Memo": { + "MemoData": "58616D616E205365727669636520466565" + } + } + ], + "Sequence": 91258094, + "SigningPubKey": "037581370D8E98ABBEBB7BC7BA036712EFCB0A3D9ABF291C8BA43154DFF0FEE6E2", + "TransactionType": "Payment", + "TxnSignature": "3045022100B623AD106B374824867B42065292388D49C64029E641001498B2D1BCCB17121002202411655B396E1CD9A94A6F047D8A13EDCAAE0596939F7EBC4D182A65A90F7BC2", + "hash": "D826B845D98ADCF10EC411CD59415B83D674C2DE6AFDD9CEB086BCBD5C924F38", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rHrsM2gD2EqiziogUgDT4DunwjwJLxi3ZZ", + "Balance": "7680156", + "Flags": 0, + "OwnerCount": 10, + "Sequence": 91258095 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "101D1333DD46D0AB177FB7B1EDE3911485A83A9C136F420F19D1B1F242256332", + "PreviousFields": { + "Balance": "7770168", + "Sequence": 91258094 + }, + "PreviousTxnID": "4D0ECFCDD6CAFC206878C65CF487544AC90AE7B5462B9448E96A4D24624AFE54", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "ryouhapPYV5KNHmFUKrjNqsjxhnxvQiVt", + "Balance": "2809043054", + "EmailHash": "5B0F31F3678A837376CD437DAA2FCC77", + "Flags": 1048576, + "OwnerCount": 167, + "RegularKey": "r33MBTjz1hzaZSsyvRwHRmaMn9S5xpp9w6", + "Sequence": 80608752, + "TicketCount": 167 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "9185B96A67C38FC7BBA39BC44BB6CC9C19DBAE20778A2E3BBB0EBB60BE5F7E0E", + "PreviousFields": { + "Balance": "2808953054" + }, + "PreviousTxnID": "C99F1C3C91BC4AB5C73F16B4A6578B783FA3DD45CE0E2484E770C01EC00F4540", + "PreviousTxnLgrSeq": 94084607 + } + } + ], + "TransactionIndex": 61, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "90000" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 123729226, + "Sequence": 123729332, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TransactionType": "OfferCancel", + "TxnSignature": "304402202FD0C40492F27F5D19C6DA8C6884F0A713EC36CB5ED94E4D908E082A22BC4EC80220719C52E161E01EA64CB1C1C2A443EF8B3306470128E6ED4EEE3B142447AA0FF5", + "hash": "D97E7B6B54197AF80758623D4C4A818D64E515D4961DB2814F9BCBECBC69B705", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "19b14", + "IndexPrevious": "19b12", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "7487E15A9421AEC70D13D44C8BE43B46ACA11BD74638F4D8EEE22D71DE18CE83", + "PreviousTxnID": "CE309BF9153A0DF26471243A0299D1C0A6BB2213AF81038471D2BB86FAC3C600", + "PreviousTxnLgrSeq": 94084600 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD432421BA", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "19b13", + "PreviousTxnID": "7034239EDFE2139FC9225059B0AF7A2E6B47BC2877DB98BE65177741A576A2E6", + "PreviousTxnLgrSeq": 94084574, + "Sequence": 123729226, + "TakerGets": "20892417445", + "TakerPays": { + "currency": "EUR", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "50256.99272727461" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "A3ED2233C6A005C6D4450FD897B1A67F4990775FC28E7E38603E7EE757A74EE4" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028985", + "Flags": 0, + "OwnerCount": 137, + "Sequence": 123729333 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028995", + "OwnerCount": 138, + "Sequence": 123729332 + }, + "PreviousTxnID": "86EBE66B7D01F69A5B34C79DEC0F7B8621D4F485FB891E424F4CF4DBC6F2D11E", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "4f088bcd432421ba", + "Flags": 0, + "PreviousTxnID": "7034239EDFE2139FC9225059B0AF7A2E6B47BC2877DB98BE65177741A576A2E6", + "PreviousTxnLgrSeq": 94084574, + "RootIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD432421BA", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "0000000000000000000000004555520000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "BC05A0B94DB6C7C0B2D9E04573F0463DC15DB8033ABA85624F088BCD432421BA" + } + } + ], + "TransactionIndex": 49, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Fee": "10", + "Flags": 0, + "LastLedgerSequence": 94084610, + "Sequence": 123729335, + "SigningPubKey": "03C48299E57F5AE7C2BE1391B581D313F1967EA2301628C07AC412092FDC15BA22", + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "27.06422102607383" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "3489.538870107342" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "304402207539F928F59E78ED67B5A900BDE6F704B56BAEC76BAF1EF1D5F195184F9FFC7702202CC39002DDD4B990D2EE7EE8B7942E30BD88B8AF31F3202CBCC83253B50EA5F7", + "hash": "D9B2B0AEA084E8C1DBA6024BFDF9B77AB1F701ED45F1B746F7E8E6F0AA3E0471", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "506F0910A803628DAEF1DD559E936AC9B5D009B27EE7FD66D2013E517C95EAAF", + "NewFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "BookDirectory": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "OwnerNode": "19b15", + "Sequence": 123729335, + "TakerGets": { + "currency": "LTC", + "issuer": "rcRzGWq6Ng3jeYhqnmM4zcWcUh69hrQ8V", + "value": "27.06422102607383" + }, + "TakerPays": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "3489.538870107342" + } + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "19b14", + "Owner": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "RootIndex": "FDE0DCA95589B07340A7D5BE2FD72AA8EEAC878664CC9B707308B4419333E551" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "9DBB7ADE16C6B4D763193B6D41161ACF6E93F22C6F4401FFC89B89ADCC378328", + "PreviousTxnID": "7C921B51A7FDB340DEEA210162FAD24366FC869904EB42CED6E9D6E682F6A309", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "r3rhWeE31Jt5sWmi4QiGLMZnY3ENgqw96W", + "Balance": "91960028955", + "Flags": 0, + "OwnerCount": 138, + "Sequence": 123729336 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B1B9AAC12B56B1CFC93DDC8AF6958B50E89509F377ED4825A3D970F249892CE3", + "PreviousFields": { + "Balance": "91960028965", + "OwnerCount": 137, + "Sequence": 123729335 + }, + "PreviousTxnID": "7C921B51A7FDB340DEEA210162FAD24366FC869904EB42CED6E9D6E682F6A309", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "ExchangeRate": "570494a95ac3ae00", + "Flags": 0, + "RootIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "TakerGetsCurrency": "0000000000000000000000004C54430000000000", + "TakerGetsIssuer": "06B36AC50AC7331069070C6350B202EAF2125C7C", + "TakerPaysCurrency": "0000000000000000000000005553440000000000", + "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "CEA664F2B7C3F3A31B6DE8E3F179E3AE5E2C471FCD6039E7570494A95AC3AE00", + "PreviousTxnID": "7C921B51A7FDB340DEEA210162FAD24366FC869904EB42CED6E9D6E682F6A309", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 52, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Amount": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.01022059659998695" + }, + "DeliverMax": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.01022059659998695" + }, + "Destination": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Flags": 196608, + "LastLedgerSequence": 94084609, + "Paths": [ + [ + { + "account": "rB8KKJ16JAuhT4ZmBsai1zNpq6DP6Yrrmh", + "type": 1 + } + ] + ], + "SendMax": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0.01025652520778983" + }, + "Sequence": 29665813, + "SigningPubKey": "ED3DC1A8262390DBA0E9926050A7BE377DFCC7937CC94C5F5F24E6BD97D677BA6C", + "TransactionType": "Payment", + "TxnSignature": "B5EC3604526B0294573ECEB22732C94C4710581EC330A57B8EF680202634AB9CF5A906EA32A273FFD994C28E96C62FADEB80A45C476B07063DA6C3D6BFD48807", + "hash": "DADC4E8966CB4A1023558E74EF0C15BC886903795B06459D84507002574A0216", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-358.2743625685351" + }, + "Flags": 131072, + "HighLimit": { + "currency": "USD", + "issuer": "rB8KKJ16JAuhT4ZmBsai1zNpq6DP6Yrrmh", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "LowNode": "312" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "0E143A3E899812A04E169062D5E9F982575A56CB2193F9F11C5B50646041C8C8", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-358.2840868189816" + } + }, + "PreviousTxnID": "5DDFB6E819730F37B7B1CD7101BA5D76ACC4166EDFF9D45AA6AD6A8251277FE5", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "HighNode": "237c", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "197E542413061266DC6995ADD18728149974484D717A415649AE12E89E297DA5", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009743698947400346" + } + }, + "PreviousTxnID": "88D2EFCC697A12E2E40B7494897953BC58ECB7F293381437C0B07983B1877075", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-538.0489594183084" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "USD", + "issuer": "rB8KKJ16JAuhT4ZmBsai1zNpq6DP6Yrrmh", + "value": "1000000000" + }, + "HighNode": "0", + "LowLimit": { + "currency": "USD", + "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq", + "value": "0" + }, + "LowNode": "ad7" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "6984330E24A19B262652E03718CCF311E06F3B12882CC13D9C9F06E3ABD6D490", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-538.0392351678619" + } + }, + "PreviousTxnID": "5DDFB6E819730F37B7B1CD7101BA5D76ACC4166EDFF9D45AA6AD6A8251277FE5", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.009711236922062219" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0" + }, + "HighNode": "bfa", + "LowLimit": { + "currency": "USD", + "issuer": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "value": "9999999999999999e80" + }, + "LowNode": "8" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "CE8BC6520C7A30953A4AC6733394E6924DAA4C3CB16CFB9EAC02EA7494417D59", + "PreviousFields": { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0.000001551004431334" + } + }, + "PreviousTxnID": "542A160F911E55FD6D59376A85FC69B2AA4495F7A6C863F94383A3D7005304D2", + "PreviousTxnLgrSeq": 94084545 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "AccountTxnID": "DADC4E8966CB4A1023558E74EF0C15BC886903795B06459D84507002574A0216", + "Balance": "97189494", + "Flags": 0, + "OwnerCount": 404, + "Sequence": 29665814 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E7C799A822859C2DC1CA293CB3136B6590628B19F81D5C7BA8752B49BB422E84", + "PreviousFields": { + "AccountTxnID": "88D2EFCC697A12E2E40B7494897953BC58ECB7F293381437C0B07983B1877075", + "Balance": "97189504", + "Sequence": 29665813 + }, + "PreviousTxnID": "88D2EFCC697A12E2E40B7494897953BC58ECB7F293381437C0B07983B1877075", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "DeliveredAmount": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.009709685917630885" + }, + "TransactionIndex": 11, + "TransactionResult": "tesSUCCESS", + "delivered_amount": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.009709685917630885" + } + } + }, + { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30424030, + "Sequence": 30424035, + "SigningPubKey": "037E9B02A63FFC298C82B66D250932A5DCF89361122925CB42339E3C769245084C", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "41161.31084509362" + }, + "TakerPays": "3035042777", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100C2B840A8552BE8BD3234AA562850BA50BF3B1216830FB1977ADE414C0516B69F02205792F6079A49ED318DD583BDFB7AF926DB4B8BFECCAB0D177B87B89A673AEEAA", + "hash": "DFE5582189D6192497C1199E17AA699F8D7F6226FCB8AA96F7BE4511BD2F3059", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "591691a5b40854a9", + "Flags": 0, + "PreviousTxnID": "A6B3493F81327D1A5F6F78C9DD9DCFA4BBCAD2E22545597B16AD81BA56E65DCD", + "PreviousTxnLgrSeq": 94084600, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591691A5B40854A9", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591691A5B40854A9" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A3230665067F6", + "NewFields": { + "ExchangeRate": "591a3230665067f6", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A3230665067F6", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591691A5B40854A9", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "A6B3493F81327D1A5F6F78C9DD9DCFA4BBCAD2E22545597B16AD81BA56E65DCD", + "PreviousTxnLgrSeq": 94084600, + "Sequence": 30424030, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "302095.7419296014" + }, + "TakerPays": "19190904991" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "72F32146B93FA56DAD6794D156FC7541D78E8814D75504C1FAB23F5F0D4E3D59" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "99F5EC5259969673B1FE47D0A2DCEF3E198C2CFE5245CF211317E99637D66B55", + "NewFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A3230665067F6", + "Sequence": 30424035, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "41161.31084509362" + }, + "TakerPays": "3035042777" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Balance": "100882749", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30424036 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C84DB7EC299936754ADF7B0342A2E3B441F5076DAD476769D5021BA104BF9A7E", + "PreviousFields": { + "Balance": "100882764", + "Sequence": 30424035 + }, + "PreviousTxnID": "EA35FA390DF2C87A74B947B2D099E616AF799119F497F98E6EBF99A347F8D091", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "RootIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E", + "PreviousTxnID": "EA35FA390DF2C87A74B947B2D099E616AF799119F497F98E6EBF99A347F8D091", + "PreviousTxnLgrSeq": 94084608 + } + } + ], + "TransactionIndex": 30, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rEoYG7nQQyfuAiTL1FViY7dGUYdixC6PTy", + "Amount": "757530", + "DeliverMax": "757530", + "Destination": "rJGb4etn9GSwNHYVu7dNMbdiVgzqxaTSUG", + "Fee": "12", + "LastLedgerSequence": 94085605, + "Memos": [ + { + "Memo": { + "MemoData": "4669727374204C6564676572207472616E73616374696F6E20666565" + } + } + ], + "Sequence": 91643959, + "SigningPubKey": "034232653656DED23A25C5C292F05E12162C78567435BA25E2F8A47DF9E6023EE9", + "SourceTag": 74920348, + "TransactionType": "Payment", + "TxnSignature": "304402202E014C5F68C23267A581922E9102340CC3353859D1370F6E439CB829CFCC97E902203A2831FD6F0A55B20E8E048A62AD8B494B8BA804C993B8CF47C1EDF24CABB343", + "hash": "E342C7D4343D8347406B191AEAFA0921766C3D9CC014180102F25C0A73252E6F", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rJGb4etn9GSwNHYVu7dNMbdiVgzqxaTSUG", + "Balance": "1504252465243", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 86622343 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "8EB322D489D5899DE90DD1F9A1F5CC541D3261B4BE25279F6F018FDF6D5C20C8", + "PreviousFields": { + "Balance": "1504251707713" + }, + "PreviousTxnID": "897E7DD85A7DFD20AF2C2C811F91827707123B007F5F2D4A165B70B643600268", + "PreviousTxnLgrSeq": 94084607 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rEoYG7nQQyfuAiTL1FViY7dGUYdixC6PTy", + "Balance": "90186191", + "Flags": 0, + "OwnerCount": 67, + "Sequence": 91643960 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "B0D2869D98E570129FED85A9F5D6F0BA19358606B12676495BF830FD50CFF48A", + "PreviousFields": { + "Balance": "90943733", + "Sequence": 91643959 + }, + "PreviousTxnID": "D09B1F84AC7773F54126498ED151AC74526922EE41732A934049CEB526AAB978", + "PreviousTxnLgrSeq": 94084607 + } + } + ], + "TransactionIndex": 58, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "757530" + } + }, + { + "Account": "rL4H3dcrK3uzoa58ejQ2YXc8iGdrDQFEoS", + "Amount": "11686883", + "DeliverMax": "11686883", + "DeliverMin": "11453145", + "Destination": "rL4H3dcrK3uzoa58ejQ2YXc8iGdrDQFEoS", + "Fee": "12", + "Flags": 131072, + "LastLedgerSequence": 94084626, + "SendMax": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "5492183.139748964" + }, + "Sequence": 93505190, + "SigningPubKey": "ED1C743268B2BC9E87549B84D90BC6B4BEAF6ABAEFA7049CB2214CA567D3DE2F11", + "TransactionType": "Payment", + "TxnSignature": "4BCC6A702CE7202F38C12F56A3494984011802ECC31BDEC38D15763E47508F6D0AF3C9BB6513D28DDEBAA1F59C36397C51AFBFF3CCE255C7ADF2224E1C84F403", + "hash": "E72A6831AA130B44828A67B742757F6B8388E46C7E5C46652C215FBEAD1FC35B", + "metaData": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-1959914887.440993" + }, + "Flags": 16908288, + "HighLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rDwJrWbmBd2eGMmpGhA1NJLXYXhUHhv8sh", + "value": "0" + }, + "HighNode": "0", + "LowLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "0" + }, + "LowNode": "1" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "7C3D48ED20980D68B8C3FDA328F5AE2A87F5137BD29EB402C8BF94A07A9399C2", + "PreviousFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-1954422704.301244" + } + }, + "PreviousTxnID": "29B38C33CCF2D500600D746F109A7A985203A45EA78F5A6D677A916884BE9249", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "AMMID": "ED4CBF1A89198D096EAB02EEE41B5E1D2B895D9CEE0F27E9EFE509EA3C23A1C7", + "Account": "rDwJrWbmBd2eGMmpGhA1NJLXYXhUHhv8sh", + "Balance": "4124130383", + "Flags": 26214400, + "OwnerCount": 1, + "Sequence": 92443065 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "7D917B911BF3B3F3E052B85D540C4B26B33E4C9247FA7F03CEEF59F82877D30A", + "PreviousFields": { + "Balance": "4135718801" + }, + "PreviousTxnID": "29B38C33CCF2D500600D746F109A7A985203A45EA78F5A6D677A916884BE9249", + "PreviousTxnLgrSeq": 94084608 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rL4H3dcrK3uzoa58ejQ2YXc8iGdrDQFEoS", + "Balance": "20146020", + "Flags": 0, + "OwnerCount": 1, + "Sequence": 93505191 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C3545380C989F54ED39123AAD3BB8209FCEE7DA86A4E51D1C5A58BEA7F02E10D", + "PreviousFields": { + "Balance": "8557614", + "Sequence": 93505190 + }, + "PreviousTxnID": "F61DEF202287073382AB851AC6F79F425939A430B4B0A34536529793F3747B77", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 2228224, + "HighLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rL4H3dcrK3uzoa58ejQ2YXc8iGdrDQFEoS", + "value": "1000000000000000e-2" + }, + "HighNode": "0", + "LowLimit": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rpVajoWTXFkKWY7gtWSwcpEcpLDUjtktCA", + "value": "0" + }, + "LowNode": "23" + }, + "LedgerEntryType": "RippleState", + "LedgerIndex": "FCFDEB5FB09419E2A92AEFD99E2752841053057CD751D85AD72D6574900CE16B", + "PreviousFields": { + "Balance": { + "currency": "416D657269636100000000000000000000000000", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "-5492183.139748964" + } + }, + "PreviousTxnID": "F61DEF202287073382AB851AC6F79F425939A430B4B0A34536529793F3747B77", + "PreviousTxnLgrSeq": 94084606 + } + } + ], + "DeliveredAmount": "11588418", + "TransactionIndex": 82, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "11588418" + } + }, + { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 30424031, + "Sequence": 30424034, + "SigningPubKey": "037E9B02A63FFC298C82B66D250932A5DCF89361122925CB42339E3C769245084C", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "177730.1505367868" + }, + "TakerPays": "11304471889", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100A00E88FA111B687162F29AA7119DA7E2C19B14565DC602D3FA2970C2598C95DE0220091FECDEC99E41BAA4B3276F5AFC051CC929F442BDF96F9913ED54C52AA52613", + "hash": "EA35FA390DF2C87A74B947B2D099E616AF799119F497F98E6EBF99A347F8D091", + "metaData": { + "AffectedNodes": [ + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591698D030DA59F4", + "NewFields": { + "ExchangeRate": "591698d030da59f4", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591698D030DA59F4", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "591a29e091e1e529", + "Flags": 0, + "PreviousTxnID": "40ECC08AB895DB2187DA7DA86612AC35E1379AFA40A5689AC3EC2DE70D693A79", + "PreviousTxnLgrSeq": 94084600, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A29E091E1E529", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A29E091E1E529" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "1D64EBD8301DF5C786FD05BF61E6C17CF8372D2E81FAEF24839520849D5A199E", + "NewFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591698D030DA59F4", + "Sequence": 30424034, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "177730.1505367868" + }, + "TakerPays": "11304471889" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB7097591A29E091E1E529", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "40ECC08AB895DB2187DA7DA86612AC35E1379AFA40A5689AC3EC2DE70D693A79", + "PreviousTxnLgrSeq": 94084600, + "Sequence": 30424031, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "36753.90949911346" + }, + "TakerPays": "2706702666" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "6125183478D86B7DF9229647B8379A8EA370A5E8630BD59F36E021E227391D2B" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "Balance": "100882764", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 30424035 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "C84DB7EC299936754ADF7B0342A2E3B441F5076DAD476769D5021BA104BF9A7E", + "PreviousFields": { + "Balance": "100882779", + "Sequence": 30424034 + }, + "PreviousTxnID": "63528D19791CB93D762CEEDB1C5AEBF08538C8C75F2F51A340E52E6981272F32", + "PreviousTxnLgrSeq": 94084600 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "Owner": "rwchA2b36zu2r6CJfEMzPLQ1cmciKFcw9t", + "RootIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "D2932301FC455041F84607F18EEFB3E24C9B4B9269DAB4B79DEEBA3A96FED70E", + "PreviousTxnID": "63528D19791CB93D762CEEDB1C5AEBF08538C8C75F2F51A340E52E6981272F32", + "PreviousTxnLgrSeq": 94084600 + } + } + ], + "TransactionIndex": 29, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Fee": "12", + "Flags": 0, + "LastLedgerSequence": 94084621, + "OfferSequence": 88619454, + "Sequence": 0, + "SigningPubKey": "EDBCC48EBFB7A77F0318265D45D93F860C9295E28FF89A57C7FDE6D2501441E750", + "TakerGets": "10480980", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "221.344110543449" + }, + "TicketSequence": 88619453, + "TransactionType": "OfferCreate", + "TxnSignature": "A480FB2AB78B4FF7A973BC63697EC29F0E96E00BC5D196E21511193143F7A78E736D5D2D4B22C176EEF3610DF0751861C1CF4E082B06E46E4948C9879899B30B", + "hash": "FB8EAF3BA6D534D9CF5072ADA03DEA1512D1EB2DADD19F0308B765DF313F2A97", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Flags": 0, + "OwnerNode": "9f6a", + "PreviousTxnID": "E2C589482CFCB38CEF393F3FD4AC7060CFBB09B6F9F79CA3AD7B8DCD690AA56D", + "PreviousTxnLgrSeq": 94084513, + "TicketSequence": 88619453 + }, + "LedgerEntryType": "Ticket", + "LedgerIndex": "14B67DC029703B52D08B48191081BE0689B41D04B0A11C9C4074FF84E7AE2CA4" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "Balance": "861688504", + "Flags": 0, + "OwnerCount": 172, + "Sequence": 88619466, + "TicketCount": 14 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "5681BA06B7D08AD12A85CBCFD767A2E61D3D9BD590BBB5DDCBB35F22BAADA70F", + "PreviousFields": { + "Balance": "861688516", + "OwnerCount": 173, + "TicketCount": 15 + }, + "PreviousTxnID": "4E7709B99AE33172137E754F9B3C83B295F98827DF04CA3ED06F5BE70590416A", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007810BD45B0062", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "9f6a", + "PreviousTxnID": "3B292058C341CD13EB4F3DA3897296DD01E2EE7E366645D33B207540CF8E1E22", + "PreviousTxnLgrSeq": 94084605, + "Sequence": 88619454, + "TakerGets": "10480980", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "221.380584809868" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "61EC7BC572FAFB0E6C3A3B04062C27D2533A06A02CFBED3243DD267FD3DA986D" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500780BACDAE049A", + "NewFields": { + "ExchangeRate": "500780bacdae049a", + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500780BACDAE049A", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5007810bd45b0062", + "Flags": 0, + "PreviousTxnID": "3B292058C341CD13EB4F3DA3897296DD01E2EE7E366645D33B207540CF8E1E22", + "PreviousTxnLgrSeq": 94084605, + "RootIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007810BD45B0062", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE100799475007810BD45B0062" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexPrevious": "9f60", + "Owner": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "RootIndex": "803D7CD7108997F42FA4DF5C63A16BCA2FF1232D2879FF9F357BCFC04C2CFF4C" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "B3A97CB20739AFA0535FABDC2B08CD14A2FF05E2518F744BE24368F35DC1AA12", + "PreviousTxnID": "4E7709B99AE33172137E754F9B3C83B295F98827DF04CA3ED06F5BE70590416A", + "PreviousTxnLgrSeq": 94084605 + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "C039A0E2F48244D1F3BB0C8A6A95E7E6F309DDAB69FC1A15E95DCDF7A044C0D1", + "NewFields": { + "Account": "rDrvRfz24oqMZFoH8a45CE1qEo8U8m1EAX", + "BookDirectory": "623C4C4AD65873DA787AC85A0A1385FE6233B6DE10079947500780BACDAE049A", + "OwnerNode": "9f6a", + "Sequence": 88619453, + "TakerGets": "10480980", + "TakerPays": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "221.344110543449" + } + } + } + } + ], + "TransactionIndex": 64, + "TransactionResult": "tesSUCCESS" + } + }, + { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Fee": "15", + "Flags": 0, + "LastLedgerSequence": 94084610, + "OfferSequence": 144101817, + "Sequence": 144101821, + "SigningPubKey": "022D40673B44C82DEE1DDB8B9BB53DCCE4F97B27404DB850F068DD91D685E337EA", + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "164908.4438172974" + }, + "TakerPays": "9883984139", + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100B09658CD68F45FEB087B60908BE429330A2B177C476E0AACAC89F97519F4362B02207256A1B8AB1D00C9003320F555EFA66D47D11A213F2B3A63A23FBFC1099A40AB", + "hash": "FE286600AC66A0438D0E01B5BA59E1EEAA0106A979248330E52D15C23F2416A2", + "metaData": { + "AffectedNodes": [ + { + "DeletedNode": { + "FinalFields": { + "ExchangeRate": "5915483c5bea2592", + "Flags": 0, + "PreviousTxnID": "AF4E9CE2CA6C2F23FD5EDEA9DCA88B657D5F41640DB2419698E37C08CF1E6F3B", + "PreviousTxnLgrSeq": 94084606, + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975915483C5BEA2592", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0", + "TakerPaysCurrency": "0000000000000000000000000000000000000000", + "TakerPaysIssuer": "0000000000000000000000000000000000000000" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975915483C5BEA2592" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759154B2A36E63573", + "NewFields": { + "ExchangeRate": "59154b2a36e63573", + "RootIndex": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759154B2A36E63573", + "TakerGetsCurrency": "000000000000000000000000434E590000000000", + "TakerGetsIssuer": "0360E3E0751BD9A566CD03FA6CAFC78118B82BA0" + } + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB70975915483C5BEA2592", + "BookNode": "0", + "Flags": 0, + "OwnerNode": "0", + "PreviousTxnID": "AF4E9CE2CA6C2F23FD5EDEA9DCA88B657D5F41640DB2419698E37C08CF1E6F3B", + "PreviousTxnLgrSeq": 94084606, + "Sequence": 144101817, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "94156.63673998775" + }, + "TakerPays": "5640357838" + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "44E899A41D84E281061E72D74C18A578A35A7D9C09FB5ACF6EDB56322E0603E8" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "5100AC12E9E9AB9CD47BC8EA802B959A38B5AD22DE918E8748E9987753B59F2E", + "NewFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "BookDirectory": "1AC09600F4B502C8F7F830F80B616DCB6F3970CB79AB709759154B2A36E63573", + "Sequence": 144101821, + "TakerGets": { + "currency": "CNY", + "issuer": "rJ1adrpGS3xsnQMb9Cw54tWJVFPuSdZHK", + "value": "164908.4438172974" + }, + "TakerPays": "9883984139" + } + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0", + "IndexPrevious": "0", + "Owner": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "RootIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "AEA3074F10FE15DAC592F8A0405C61FB7D4C98F588C2D55C84718FAFBBD2604A", + "PreviousTxnID": "3A4F2024CF352C9C11259889E81514EBBA2C7C2BF70C9FF0B38539B31F57219E", + "PreviousTxnLgrSeq": 94084606 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rh3VLyj1GbQjX7eA15BwUagEhSrPHmLkSR", + "Balance": "100345352", + "Flags": 0, + "OwnerCount": 5, + "Sequence": 144101822 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "E0311EB450B6177F969B94DBDDA83E99B7A0576ACD9079573876F16C0C004F06", + "PreviousFields": { + "Balance": "100345367", + "Sequence": 144101821 + }, + "PreviousTxnID": "3A4F2024CF352C9C11259889E81514EBBA2C7C2BF70C9FF0B38539B31F57219E", + "PreviousTxnLgrSeq": 94084606 + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + } + } + ] + }, + "ledger_hash": "576A59C1EA928637915556DBF2BF9F6CC7ADAC942EAA6706BA91BB35751140A5", + "ledger_index": 94084608, + "validated": true +} From c2dd463c82d597b2cc27658daa2fca5251b934c6 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Thu, 13 Feb 2025 15:08:53 -0700 Subject: [PATCH 02/13] Fix UnlModify serialization --- .../modules/TransactionDeserializer.java | 2 +- .../modules/TransactionSerializer.java | 68 +++++------ .../UnlModifyTransactionSerializer.java | 20 +++- .../model/jackson/modules/Xrpl4jModule.java | 2 +- .../xrpl4j/model/transactions/UnlModify.java | 7 +- .../transactions/json/UnlModifyJsonTests.java | 113 ++++++++++++++---- 6 files changed, 152 insertions(+), 60 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index b11cdae4d..2a8578967 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -71,7 +71,7 @@ public Transaction deserialize(JsonParser jsonParser, DeserializationContext ctx if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { // if (objectNode.get("Account").isEmpty()) { if (objectNode.has("Account")) { - objectNode.remove("Account"); + //objectNode.remove("Account"); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java index 9b2366356..6cfb7cf54 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java @@ -40,38 +40,38 @@ * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the * TransactionType JSON field. */ -public class TransactionSerializer { //} extends StdSerializer { -// -// /** -// * No-args constructor. -// */ -// protected TransactionSerializer() { -// super(Transaction.class); -// } -// -// @Override -// public void serialize(Transaction value, JsonGenerator gen, SerializerProvider provider) throws IOException { -// -// if (UnlModify.class.isAssignableFrom(value.getClass())) { -// gen.writeStartObject(); -// -// // 1. Delegate to Jackson for the existing fields: -// provider.defaultSerializeValue(value, gen); // Delegate to Jackson -// -//// ObjectMapperFactory.create().writeValue(gen, value); -// -// // Serialize the existing fields (delegate to Jackson's default if possible) -//// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields -// -// // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show -// // up during serialization. -// gen.writeFieldName("Account"); -// gen.writeString(value.account().value()); -// -// gen.writeEndObject(); -// } else { -// // Rely on Jackson's automatic serialization -// gen.writeObject(value); -// } -// } +public class TransactionSerializer extends StdSerializer { + + /** + * No-args constructor. + */ + protected TransactionSerializer() { + super(Transaction.class); + } + + @Override + public void serialize(Transaction value, JsonGenerator gen, SerializerProvider provider) throws IOException { + + if (UnlModify.class.isAssignableFrom(value.getClass())) { + gen.writeStartObject(); + + // 1. Delegate to Jackson for the existing fields: + provider.defaultSerializeValue(value, gen); // Delegate to Jackson + +// ObjectMapperFactory.create().writeValue(gen, value); + + // Serialize the existing fields (delegate to Jackson's default if possible) +// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields + + // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show + // up during serialization. + gen.writeFieldName("Account"); + gen.writeString(value.account().value()); + + gen.writeEndObject(); + } else { + // Rely on Jackson's automatic serialization + gen.writeObject(value); + } + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java index ddc1abf8d..a83f1eae3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java @@ -21,12 +21,16 @@ */ import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.xrpl.xrpl4j.model.transactions.Transaction; import org.xrpl.xrpl4j.model.transactions.UnlModify; +import org.xrpl.xrpl4j.model.transactions.metadata.CreatedNode; import java.io.IOException; +import java.util.Map; /** * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the @@ -44,6 +48,20 @@ protected UnlModifyTransactionSerializer() { @Override public void serialize(UnlModify value, JsonGenerator gen, SerializerProvider provider) throws IOException { +// ObjectMapper codec = (ObjectMapper) jsonParser.getCodec(); +// JsonNode jsonNode = jsonParser.readValueAsTree(); +// Map.Entry nodeFieldAndValue = jsonNode.fields().next(); +// String affectedNodeType = nodeFieldAndValue.getKey(); + +// codec.getTypeFactory().constructParametricType(CreatedNode.class, ledgerObjectClass) + + +// ObjectMapper objectMapper = (ObjectMapper) gen.getCodec(); +// String json = objectMapper.writeValueAsString(value); + +// provider.defaultSerializeValue() + + // if (UnlModify.class.isAssignableFrom(value.getClass())) { // gen.writeStartObject(); @@ -51,7 +69,7 @@ public void serialize(UnlModify value, JsonGenerator gen, SerializerProvider pro // gen.getCurrentValue().toString().length() == 1 // ) { // 1. Delegate to Jackson for the existing fields: - provider.defaultSerializeValue(value, gen); // Delegate to Jackson +// provider.defaultSerializeValue(value, gen); // Delegate to Jackson // } // ObjectMapperFactory.create().writeValue(gen, value); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java index a35f991d0..661793047 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java @@ -61,7 +61,7 @@ public Xrpl4jModule() { addSerializer(LedgerIndex.class, new LedgerIndexSerializer()); addDeserializer(LedgerIndex.class, new LedgerIndexDeserializer()); - addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); +// addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); addDeserializer(Transaction.class, new TransactionDeserializer()); addDeserializer(ServerInfo.class, new ServerInfoDeserializer()); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index b2a4e93c1..4021ec725 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -28,6 +28,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; +import org.xrpl.xrpl4j.crypto.keys.ImmutablePublicKey; import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; @@ -92,9 +93,11 @@ default TransactionType transactionType() { * @return Always returns ACCOUNT_ZERO, which is the base58 encoding of the number zero. */ @Override - @JsonProperty(value = "Account", access = Access.WRITE_ONLY) + @JsonProperty(value = "Account" + , access = Access.READ_WRITE + ) @Value.Derived - @JsonIgnore(false) + @JsonSerialize default Address account() { return ACCOUNT_ZERO; } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java index 3f61e8590..3ffb7f54c 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java @@ -20,10 +20,12 @@ * =========================LICENSE_END================================== */ -import static org.assertj.core.api.FactoryBasedNavigableListAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; +import static org.xrpl.xrpl4j.model.AddressConstants.ACCOUNT_ZERO; import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.primitives.UnsignedInteger; +import com.google.common.primitives.UnsignedLong; import org.assertj.core.api.Assertions; import org.json.JSONException; import org.junit.jupiter.api.Test; @@ -36,6 +38,9 @@ import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; +import java.util.Collections; +import java.util.Map; + public class UnlModifyJsonTests extends AbstractJsonTest { @Test @@ -64,12 +69,12 @@ public void testJsonWithAccountZero() throws JsonProcessingException, JSONExcept @Test public void testJsonWithAccountZeroAndUnknownFields() throws JsonProcessingException, JSONException { UnlModify unlModify = UnlModify.builder() + .putUnknownFields("Foo", "Bar") .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") .unlModifyDisabling(UnsignedInteger.valueOf(1)) - .putUnknownFields("Foo", "Bar") .build(); String json = "{" + @@ -96,42 +101,79 @@ public void testJsonWithEmptyAccount() throws JsonProcessingException, JSONExcep .unlModifyDisabling(UnsignedInteger.valueOf(1)) .build(); - String json = "{" + - "\"Account\":\"\"," + + // What we expect the ObjectMapper to Serialize (given the above object) + String expectedSerializedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + "\"Fee\":\"12\"," + "\"LedgerSequence\":67850752," + "\"Sequence\":2470665," + "\"SigningPubKey\":\"\"," + "\"TransactionType\":\"UNLModify\"," + "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; - assertCanSerializeAndDeserialize(unlModify, json); + String serialized = objectMapper.writeValueAsString(unlModify); + JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); + + // What we provide the ObjectMapper to Deserialize + String expectedDeserializedJson = "{" + + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); + assertThat(deserialized).isEqualTo(unlModify); } @Test public void testJsonWithEmptyAccountAndUnknownFields() throws JsonProcessingException, JSONException { UnlModify unlModify = UnlModify.builder() + .putUnknownFields("Foo", "Bar") .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") .unlModifyDisabling(UnsignedInteger.valueOf(1)) - .putUnknownFields("Foo", "Bar") .build(); - String json = "{" + - "\"Foo\" : \"Bar\",\n" + - "\"Account\":\"\"," + + // What we expect the ObjectMapper to Serialize (given the above object) + String expectedSerializedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! "\"Fee\":\"12\"," + "\"LedgerSequence\":67850752," + "\"Sequence\":2470665," + "\"SigningPubKey\":\"\"," + "\"TransactionType\":\"UNLModify\"," + "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; - assertCanSerializeAndDeserialize(unlModify, json); + String serialized = objectMapper.writeValueAsString(unlModify); + JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); + + // What we provide the ObjectMapper to Deserialize + String expectedDeserializedJson = "{" + + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); + assertThat(deserialized).isEqualTo(unlModify); } @Test @@ -144,7 +186,8 @@ public void testJsonWithMissingAccount() throws JsonProcessingException, JSONExc .unlModifyDisabling(UnsignedInteger.valueOf(1)) .build(); - String json = "{" + + String expectedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + "\"Fee\":\"12\"," + "\"LedgerSequence\":67850752," + "\"Sequence\":2470665," + @@ -153,7 +196,20 @@ public void testJsonWithMissingAccount() throws JsonProcessingException, JSONExc "\"UNLModifyDisabling\":1," + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; - assertCanSerializeAndDeserialize(unlModify, json); + String serialized = objectMapper.writeValueAsString(unlModify); + JSONAssert.assertEquals(expectedJson, serialized, JSONCompareMode.STRICT); + + String jsonForDeserialization = "{" + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + + Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); + assertThat(deserialized).isEqualTo(unlModify); } @Test @@ -164,28 +220,43 @@ public void testJsonWithMissingAccountAndUnknownFields() throws JsonProcessingEx .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") .unlModifyDisabling(UnsignedInteger.valueOf(1)) - .putUnknownFields("Foo", "Bar") .build(); - String json = "{" + - "\"Foo\" : \"Bar\",\n" + + // What we expect the ObjectMapper to Serialize (given the above object) + String expectedSerializedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + "\"Fee\":\"12\"," + "\"LedgerSequence\":67850752," + "\"Sequence\":2470665," + "\"SigningPubKey\":\"\"," + "\"TransactionType\":\"UNLModify\"," + "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; - assertCanSerializeAndDeserialize(unlModify, json); + String serialized = objectMapper.writeValueAsString(unlModify); + JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); + + // What we provide the ObjectMapper to Deserialize + String expectedDeserializedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); + assertThat(deserialized).isEqualTo(unlModify); } // Using Transcation // Using Immutable // Using UnlModify - - // @Test // public void testDeserializeJson() throws JsonProcessingException { // String json = "{" + From abb1b2a4810b06302e2427d999446cd2d3f32765 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 10:53:37 -0500 Subject: [PATCH 03/13] Enhace all JSON transaction unit tests --- .../modules/TransactionDeserializer.java | 53 +- .../UnlModifyTransactionSerializer.java | 1 + .../model/jackson/modules/Xrpl4jModule.java | 39 +- .../transactions/UnlModifyDeserializer.java | 6 + .../model/transactions/AccountDelete.java | 23 +- .../xrpl4j/model/transactions/AccountSet.java | 8 +- .../xrpl4j/model/transactions/AmmBid.java | 20 +- .../xrpl4j/model/transactions/AmmCreate.java | 17 +- .../xrpl4j/model/transactions/AmmDelete.java | 14 +- .../xrpl4j/model/transactions/AmmDeposit.java | 24 +- .../xrpl4j/model/transactions/AmmVote.java | 20 +- .../model/transactions/AmmWithdraw.java | 24 +- .../model/transactions/CheckCancel.java | 27 +- .../xrpl4j/model/transactions/CheckCash.java | 15 +- .../model/transactions/CheckCreate.java | 12 +- .../xrpl4j/model/transactions/Clawback.java | 7 - .../model/transactions/DepositPreAuth.java | 7 - .../xrpl4j/model/transactions/DidDelete.java | 7 - .../xrpl4j/model/transactions/DidSet.java | 7 - .../model/transactions/EnableAmendment.java | 6 - .../model/transactions/EscrowCancel.java | 11 +- .../model/transactions/EscrowCreate.java | 11 +- .../model/transactions/EscrowFinish.java | 20 +- .../transactions/NfTokenAcceptOffer.java | 20 +- .../model/transactions/NfTokenBurn.java | 11 +- .../transactions/NfTokenCancelOffer.java | 11 +- .../transactions/NfTokenCreateOffer.java | 13 +- .../model/transactions/NfTokenMint.java | 12 +- .../model/transactions/OfferCancel.java | 11 +- .../model/transactions/OfferCreate.java | 12 +- .../model/transactions/OracleDelete.java | 7 - .../xrpl4j/model/transactions/OracleSet.java | 7 - .../xrpl4j/model/transactions/Payment.java | 30 +- .../transactions/PaymentChannelClaim.java | 7 - .../transactions/PaymentChannelCreate.java | 7 - .../transactions/PaymentChannelFund.java | 11 +- .../xrpl4j/model/transactions/SetFee.java | 6 - .../model/transactions/SetRegularKey.java | 11 +- .../model/transactions/SignerListSet.java | 7 - .../model/transactions/TicketCreate.java | 11 +- .../model/transactions/Transaction.java | 63 +- .../xrpl4j/model/transactions/TrustSet.java | 13 +- .../xrpl4j/model/transactions/UnlModify.java | 65 +-- .../xrpl4j/model/transactions/Wrappers.java | 205 +++---- .../XChainAccountCreateCommit.java | 7 - .../XChainAddAccountCreateAttestation.java | 7 - .../XChainAddClaimAttestation.java | 7 - .../model/transactions/XChainClaim.java | 7 - .../model/transactions/XChainCommit.java | 8 - .../transactions/XChainCreateBridge.java | 7 - .../transactions/XChainCreateClaimId.java | 7 - .../transactions/XChainModifyBridge.java | 9 - .../binary/BinarySerializationTests.java | 547 ++++++++---------- .../xrpl/xrpl4j/model/AbstractJsonTest.java | 3 +- .../transactions/NfTokenAcceptOfferTest.java | 2 +- .../json/AbstractTransactionJsonTest.java | 155 +++++ .../json/AccountDeleteJsonTests.java | 209 ++++--- .../json/AccountSetJsonTests.java | 452 +++++++-------- .../json/CheckCancelJsonTests.java | 185 ++++++ .../transactions/json/CheckCashJsonTests.java | 198 +++++++ .../json/CheckCreateJsonTests.java | 221 +++++++ .../transactions/json/CheckJsonTests.java | 437 -------------- .../json/EnableAmendmentJsonTests.java | 88 ++- .../json/EscrowCancelJsonTests.java | 136 +++++ .../json/EscrowCreateJsonTests.java | 270 +++++++++ .../json/EscrowFinishJsonTests.java | 289 +++++++++ .../transactions/json/EscrowJsonTests.java | 506 ---------------- .../json/NfTokenAcceptOfferJsonTests.java | 201 +++---- .../json/NfTokenBurnJsonTests.java | 168 +++--- .../json/NfTokenCancelOfferJsonTests.java | 181 +++--- .../json/NfTokenCreateOfferJsonTests.java | 123 ++-- .../json/NfTokenMintJsonTests.java | 171 +++--- .../json/OfferCancelJsonTests.java | 194 +++++++ .../json/OfferCreateJsonTests.java | 177 ++++++ .../transactions/json/OfferJsonTests.java | 243 -------- .../json/PaymentChannelClaimJsonTests.java | 164 ++++++ .../json/PaymentChannelCreateJsonTests.java | 194 +++++++ .../json/PaymentChannelFundJsonTests.java | 185 ++++++ .../json/PaymentChannelJsonTests.java | 424 -------------- .../transactions/json/PaymentJsonTests.java | 201 ++++--- .../json/SetRegularKeyJsonTest.java | 151 +++-- .../json/SignerListSetJsonTests.java | 247 +++++--- .../json/TicketCreateJsonTest.java | 154 ++--- .../transactions/json/TrustSetJsonTests.java | 165 +++--- .../transactions/json/UnlModifyJsonTests.java | 313 +++++----- 85 files changed, 4489 insertions(+), 3843 deletions(-) create mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java delete mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java delete mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java delete mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java create mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java delete mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelJsonTests.java diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index 2a8578967..b0b57823f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.node.ObjectNode; @@ -31,50 +32,64 @@ import org.xrpl.xrpl4j.model.transactions.UnlModify; import java.io.IOException; +import java.util.Objects; /** * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the * TransactionType JSON field. */ -public class TransactionDeserializer extends StdDeserializer { - +public class TransactionDeserializer extends StdDeserializer { + + private final Class clazz; + /** * No-args constructor. */ protected TransactionDeserializer() { super(Transaction.class); + this.clazz = (Class) Transaction.class; } - + + /** + * No-args constructor. + */ + protected TransactionDeserializer(final Class clazz) { + super(Transaction.class); + this.clazz = Objects.requireNonNull(clazz); + } + @Override - public Transaction deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { + public T deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec(); ObjectNode objectNode = objectMapper.readTree(jsonParser); - - TransactionType transactionType = TransactionType.forValue(objectNode.get("TransactionType").asText()); - Class transactionTypeClass = Transaction.typeMap.inverse().get(transactionType); - + + JsonNode node = objectNode.get("TransactionType"); + TransactionType transactionType = TransactionType.forValue(node.asText()); + Class transactionTypeClass = (Class) Transaction.typeMap.inverse().get(transactionType); + + // TODO: DELETE (no longer needed // If the transaction is of type `UnknownTransaction`, the `TransactionType` property must _not_ be removed. Thi // is so that the derived functions related to `TransactionType` in that class operate properly. However, for all // _other_ transaction types, the `TransactionType` property _must_ be removed so that it doesn't errantly show up // in the `unknownTransactionType` map. This approach works because every subclass of `Transaction` has a derived // Java method that specifies the type (thus allowing us to ignore this fiele in the general case). - if (!UnknownTransaction.class.isAssignableFrom(transactionTypeClass)) { - objectNode.remove("TransactionType"); - } - +// if (!UnknownTransaction.class.isAssignableFrom(transactionTypeClass)) { +// objectNode.remove("TransactionType"); +// } + // If the transaction is of type `UnlModify`, then remove the `Account` property. This is because the JSON returned // by the rippled/clio API v1 has a bug where the account value is often an empty string. For this particular // transaction type (i.e., `UnlModify`) the Java value for the account is always set to ACCOUNT_ZERO via a default // method, so we remove this value from the JSON before deserialization because (1) it's not needed (the default // method handles population in Java) and (2) if not removed, this field will end up in the `unknownFields` // property, which is incorrect. - if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { -// if (objectNode.get("Account").isEmpty()) { - if (objectNode.has("Account")) { - //objectNode.remove("Account"); - } - } - +// if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { +// // if (objectNode.get("Account").isEmpty()) { +// if (objectNode.has("Account")) { +// //objectNode.remove("Account"); +// } +// } + // TODO: Verify, and document if keeping. if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { objectNode.remove("Account"); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java index a83f1eae3..5d3fa09b0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.util.Map; +// TOOD: Delete if unused. /** * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the * TransactionType JSON field. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java index 661793047..aca929515 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java @@ -24,22 +24,21 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import org.xrpl.xrpl4j.codec.addresses.UnsignedByteArray; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; -import org.xrpl.xrpl4j.model.client.path.BookOffersOffer; import org.xrpl.xrpl4j.model.client.serverinfo.ServerInfo; import org.xrpl.xrpl4j.model.flags.Flags; import org.xrpl.xrpl4j.model.transactions.CurrencyAmount; +import org.xrpl.xrpl4j.model.transactions.ImmutableUnlModify; import org.xrpl.xrpl4j.model.transactions.Transaction; import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.metadata.AffectedNode; -import org.xrpl.xrpl4j.model.transactions.metadata.MetaLedgerEntryType; /** * Jackson module for the xrpl4j-model project. */ public class Xrpl4jModule extends SimpleModule { - + private static final String NAME = "Xrpl4jModule"; - + /** * No-arg constructor. */ @@ -55,22 +54,36 @@ public Xrpl4jModule() { "xrpl4j" ) ); - + addDeserializer(CurrencyAmount.class, new CurrencyAmountDeserializer()); - + addSerializer(LedgerIndex.class, new LedgerIndexSerializer()); addDeserializer(LedgerIndex.class, new LedgerIndexDeserializer()); - -// addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); - addDeserializer(Transaction.class, new TransactionDeserializer()); - + + // TODO + // addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); + addDeserializer(Transaction.class, new TransactionDeserializer<>()); + addDeserializer(ServerInfo.class, new ServerInfoDeserializer()); - + addSerializer(UnsignedByteArray.class, new UnsignedByteArraySerializer()); addDeserializer(UnsignedByteArray.class, new UnsignedByteArrayDeserializer()); - + addSerializer(Flags.class, new FlagsSerializer()); - + addDeserializer(AffectedNode.class, new AffectedNodeDeserializer()); + + + // // Add the custom serializer using a BeanSerializerModifier + // setSerializerModifier(new BeanSerializerModifier() { + // @Override + // public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, + // JsonSerializer serializer) { + // if (Transaction.class.isAssignableFrom(beanDesc.getBeanClass())) { // Check if it's a Transaction + // return new TransactionSerializer(); + // } + // return serializer; // Return the original serializer if not a Transaction + // } + // }); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java new file mode 100644 index 000000000..349d885c4 --- /dev/null +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java @@ -0,0 +1,6 @@ +package org.xrpl.xrpl4j.model.jackson.modules.transactions; + +import org.xrpl.xrpl4j.model.jackson.modules.TransactionDeserializer; + +public class UnlModifyDeserializer extends TransactionDeserializer { +} diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index d54a7ae13..2891f9a56 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; -import org.immutables.value.Value.Derived; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import java.util.Optional; @@ -38,7 +37,7 @@ @JsonSerialize(as = ImmutableAccountDelete.class) @JsonDeserialize(as = ImmutableAccountDelete.class) public interface AccountDelete extends Transaction { - + /** * Construct a builder for this class. * @@ -47,10 +46,10 @@ public interface AccountDelete extends Transaction { static ImmutableAccountDelete.Builder builder() { return ImmutableAccountDelete.builder(); } - + /** - * Set of {@link TransactionFlags}s for this {@link AccountDelete}, which only allows the - * {@code tfFullyCanonicalSig} flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link AccountDelete}, which only allows the {@code tfFullyCanonicalSig} + * flag, which is deprecated. * *

    The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -62,7 +61,7 @@ static ImmutableAccountDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The {@link Address} of an account to receive any leftover XRP after deleting the sending account. Must be a funded * account in the ledger, and must not be the sending account. @@ -71,7 +70,7 @@ default TransactionFlags flags() { */ @JsonProperty("Destination") Address destination(); - + /** * Arbitrary destination tag that identifies a hosted recipient or other information for the recipient of the deleted * account's leftover XRP. @@ -80,10 +79,4 @@ default TransactionFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.ACCOUNT_DELETE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 3b6e42b3c..119bb77e6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -372,13 +372,7 @@ default void checkTickSize() { ); } - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.ACCOUNT_SET; - } - + /** * There are several options which can be either enabled or disabled for an account. Account options are represented * by different types of flags depending on the situation. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index 4e742518d..a9c33a12f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -23,7 +23,7 @@ @JsonDeserialize(as = ImmutableAmmBid.class) @Beta public interface AmmBid extends Transaction { - + /** * Construct a {@code AmmBid} builder. * @@ -32,7 +32,7 @@ public interface AmmBid extends Transaction { static ImmutableAmmBid.Builder builder() { return ImmutableAmmBid.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmBid}, which only allows the {@code tfFullyCanonicalSig} flag, * which is deprecated. @@ -47,7 +47,7 @@ static ImmutableAmmBid.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -55,7 +55,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -63,7 +63,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * Pay at least this amount for the slot. Setting this value higher makes it harder for others to outbid you. If * omitted, pay the minimum necessary to win the bid. @@ -80,7 +80,7 @@ default TransactionFlags flags() { */ @JsonProperty("BidMin") Optional bidMin(); - + /** * Pay at most this amount for the slot. If the cost to win the bid is higher than this amount, the transaction fails. * If omitted, pay as much as necessary to win the bid. @@ -97,7 +97,7 @@ default TransactionFlags flags() { */ @JsonProperty("BidMax") Optional bidMax(); - + /** * A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the * address of the transaction sender @@ -106,10 +106,4 @@ default TransactionFlags flags() { */ @JsonProperty("AuthAccounts") List authAccounts(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_BID; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index 3711891db..6af69be68 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; import org.immutables.value.Value; -import org.xrpl.xrpl4j.model.flags.Flags; import org.xrpl.xrpl4j.model.flags.TransactionFlags; /** @@ -19,7 +18,7 @@ @JsonDeserialize(as = ImmutableAmmCreate.class) @Beta public interface AmmCreate extends Transaction { - + /** * Construct a {@code AmmCreate} builder. * @@ -28,7 +27,7 @@ public interface AmmCreate extends Transaction { static ImmutableAmmCreate.Builder builder() { return ImmutableAmmCreate.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmCreate}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -43,7 +42,7 @@ static ImmutableAmmCreate.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The first of the two assets to fund this AMM with. * @@ -51,7 +50,7 @@ default TransactionFlags flags() { */ @JsonProperty("Amount") CurrencyAmount amount(); - + /** * The second of the two assets to fund this AMM with. * @@ -59,7 +58,7 @@ default TransactionFlags flags() { */ @JsonProperty("Amount2") CurrencyAmount amount2(); - + /** * The fee to charge for trades against this AMM instance. * @@ -67,10 +66,4 @@ default TransactionFlags flags() { */ @JsonProperty("TradingFee") TradingFee tradingFee(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_CREATE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index 1133f8f0c..ca53791d9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -20,7 +20,7 @@ @JsonDeserialize(as = ImmutableAmmDelete.class) @Beta public interface AmmDelete extends Transaction { - + /** * Construct a {@code AmmDelete} builder. * @@ -29,7 +29,7 @@ public interface AmmDelete extends Transaction { static ImmutableAmmDelete.Builder builder() { return ImmutableAmmDelete.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmDelete}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -41,7 +41,7 @@ static ImmutableAmmDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -49,7 +49,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -57,10 +57,4 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_DELETE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java index a7e0090b1..afd05f906 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java @@ -21,7 +21,7 @@ @JsonDeserialize(as = ImmutableAmmDeposit.class) @Beta public interface AmmDeposit extends Transaction { - + /** * Construct a {@code AmmDeposit} builder. * @@ -30,7 +30,7 @@ public interface AmmDeposit extends Transaction { static ImmutableAmmDeposit.Builder builder() { return ImmutableAmmDeposit.builder(); } - + /** * A {@link AmmDepositFlags} for this transaction. This field must be set manually. * @@ -38,7 +38,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Flags") AmmDepositFlags flags(); - + /** * The definition for one of the assets in the AMM's pool. * @@ -46,7 +46,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -54,7 +54,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or * XRP) in the AMM's pool. @@ -63,7 +63,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Amount") Optional amount(); - + /** * The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's * pool and cannot be the same asset as Amount. @@ -72,7 +72,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Amount2") Optional amount2(); - + /** * The maximum effective price, in the deposit asset, to pay for each LP Token received. * @@ -80,7 +80,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("EPrice") Optional effectivePrice(); - + /** * How many of the AMM's LP Tokens to buy. * @@ -96,7 +96,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("LPTokenOut") Optional lpTokenOut(); - + /** * An optional {@link TradingFee} to set on the AMM instance. This field is only honored if the AMM's LP token balance * is zero, and can only be set if flags is {@link AmmDepositFlags#TWO_ASSET_IF_EMPTY}. @@ -105,10 +105,4 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("TradingFee") Optional tradingFee(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_DEPOSIT; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index b06abaf13..3d0188679 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -1,7 +1,6 @@ package org.xrpl.xrpl4j.model.transactions; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonProperty.Access; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; @@ -20,7 +19,7 @@ @JsonDeserialize(as = ImmutableAmmVote.class) @Beta public interface AmmVote extends Transaction { - + /** * Construct a {@code AmmVote} builder. * @@ -29,7 +28,7 @@ public interface AmmVote extends Transaction { static ImmutableAmmVote.Builder builder() { return ImmutableAmmVote.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmVote}, which only allows the {@code tfFullyCanonicalSig} flag, * which is deprecated. @@ -44,7 +43,7 @@ static ImmutableAmmVote.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -52,7 +51,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -60,7 +59,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The proposed fee to vote for. * @@ -68,13 +67,4 @@ default TransactionFlags flags() { */ @JsonProperty("TradingFee") TradingFee tradingFee(); - - @JsonProperty(value = "TransactionType" - // , access = Access.WRITE_ONLY - ) // <-- Serialize only - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_VOTE; - } - } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index 76253950e..34308e4f7 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -4,8 +4,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; -import com.google.common.base.Preconditions; -import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.AmmWithdrawFlags; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -23,7 +21,7 @@ @JsonDeserialize(as = ImmutableAmmWithdraw.class) @Beta public interface AmmWithdraw extends Transaction { - + /** * Construct a {@code AmmWithdraw} builder. * @@ -32,7 +30,7 @@ public interface AmmWithdraw extends Transaction { static ImmutableAmmWithdraw.Builder builder() { return ImmutableAmmWithdraw.builder(); } - + /** * A {@link AmmWithdrawFlags} for this transaction. * @@ -40,7 +38,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Flags") AmmWithdrawFlags flags(); - + /** * The definition for one of the assets in the AMM's pool. * @@ -48,7 +46,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -56,7 +54,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or * XRP) in the AMM's pool. @@ -65,7 +63,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Amount") Optional amount(); - + /** * The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's * pool and cannot be the same asset as Amount. @@ -74,7 +72,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Amount2") Optional amount2(); - + /** * The maximum effective price, in the deposit asset, to pay for each LP Token received. * @@ -82,7 +80,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("EPrice") Optional effectivePrice(); - + /** * How many of the AMM's LP Tokens to buy. * @@ -98,10 +96,4 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("LPTokenIn") Optional lpTokensIn(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.AMM_WITHDRAW; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 1b566a051..2f3fdec1b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,19 +24,18 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.immutables.value.Value; -import org.immutables.value.Value.Derived; import org.xrpl.xrpl4j.model.flags.TransactionFlags; /** - * Cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the - * destination of the check can cancel a Check at any time using this transaction type. - * If the Check has expired, any address can cancel it. + * Cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of + * the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can + * cancel it. */ @Value.Immutable @JsonSerialize(as = ImmutableCheckCancel.class) @JsonDeserialize(as = ImmutableCheckCancel.class) public interface CheckCancel extends Transaction { - + /** * Construct a builder for this class. * @@ -45,10 +44,10 @@ public interface CheckCancel extends Transaction { static ImmutableCheckCancel.Builder builder() { return ImmutableCheckCancel.builder(); } - + /** - * Set of {@link TransactionFlags}s for this {@link CheckCancel}, which only allows the - * {@code tfFullyCanonicalSig} flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link CheckCancel}, which only allows the {@code tfFullyCanonicalSig} + * flag, which is deprecated. * *

    The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -60,7 +59,7 @@ static ImmutableCheckCancel.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The ID of the Check ledger object to cancel, as a 64-character hexadecimal string. * @@ -68,10 +67,4 @@ default TransactionFlags flags() { */ @JsonProperty("CheckID") Hash256 checkId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.CHECK_CANCEL; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index 75f5291f8..08df11d80 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -101,15 +101,10 @@ default TransactionFlags flags() { */ @Value.Check default void validateOnlyOneAmountSet() { - Preconditions.checkArgument((amount().isPresent() || deliverMin().isPresent()) && - !(amount().isPresent() && deliverMin().isPresent()), - "The CheckCash transaction must include either amount or deliverMin, but not both."); - } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.CHECK_CASH; + Preconditions.checkArgument( + (amount().isPresent() || deliverMin().isPresent()) && + !(amount().isPresent() && deliverMin().isPresent()), + "The CheckCash transaction must include either amount or deliverMin, but not both." + ); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index d471ccbcb..7d32b1aa9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; -import org.immutables.value.Value.Derived; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import java.util.Optional; @@ -105,11 +104,4 @@ default TransactionFlags flags() { */ @JsonProperty("InvoiceID") Optional invoiceId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.CHECK_CREATE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java index 5ef1a5a35..04b68c4df 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java @@ -50,11 +50,4 @@ default TransactionFlags flags() { */ @JsonProperty("Amount") IssuedCurrencyAmount amount(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.CLAWBACK; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index a2100264e..c163f798a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -93,11 +93,4 @@ default void validateFieldPresence() { !(authorize().isPresent() && unauthorize().isPresent()), "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.DEPOSIT_PRE_AUTH; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index c39620736..965760d3f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -45,11 +45,4 @@ static ImmutableDidDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.DID_DELETE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java index 441288fbe..bf0f00795 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java @@ -70,11 +70,4 @@ default TransactionFlags flags() { */ @JsonProperty("Data") Optional data(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.DID_SET; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index b20c02e29..97b2c5970 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -63,10 +63,4 @@ static ImmutableEnableAmendment.Builder builder() { */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.ENABLE_AMENDMENT; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index 9f02b910d..13095f5c3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -75,11 +75,4 @@ default TransactionFlags flags() { */ @JsonProperty("OfferSequence") UnsignedInteger offerSequence(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.ESCROW_CANCEL; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java index 3508084f0..21366fb2e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -132,11 +132,4 @@ default void check() { ); } } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.ESCROW_CREATE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index ccb496c6f..1bb90c175 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -33,14 +33,11 @@ import com.ripple.cryptoconditions.CryptoConditionWriter; import com.ripple.cryptoconditions.Fulfillment; import com.ripple.cryptoconditions.PreimageSha256Fulfillment; -import com.ripple.cryptoconditions.PreimageSha256Fulfillment.AbstractPreimageSha256Fulfillment; import com.ripple.cryptoconditions.der.DerEncodingException; import org.immutables.value.Value; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.immutables.FluentCompareTo; -import org.xrpl.xrpl4j.model.transactions.AccountSet.AccountSetFlag; import java.util.Arrays; import java.util.Base64; @@ -75,9 +72,7 @@ static ImmutableEscrowFinish.Builder builder() { * @param currentLedgerBaseFeeDrops The number of drops that the ledger demands at present. * @param fulfillment The {@link Fulfillment} that is being presented to the ledger for computation * purposes. - * * @return An {@link XrpCurrencyAmount} representing the computed fee. - * * @see "https://xrpl.org/escrowfinish.html" */ static XrpCurrencyAmount computeFee( @@ -254,7 +249,7 @@ default EscrowFinish normalizeCondition() { // condition is equivalent to the raw value when re-written. if (!Arrays.equals(CryptoConditionWriter.writeCondition(condition), conditionRawValueBytes)) { logger.warn("EscrowFinish Condition was malformed: mismatch between raw value and parsed condition. " + - "conditionRawValue() will contain the condition value, but condition() will be empty."); + "conditionRawValue() will contain the condition value, but condition() will be empty."); return this; } @@ -264,7 +259,7 @@ default EscrowFinish normalizeCondition() { } catch (DerEncodingException | IllegalArgumentException e) { logger.warn( "EscrowFinish Condition was malformed. conditionRawValue() will contain the condition value, but " + - "condition() will be empty: {}", + "condition() will be empty: {}", e.getMessage(), e ); @@ -336,7 +331,7 @@ default EscrowFinish normalizeFulfillment() { // fulfillment is equivalent to the raw value when re-written. if (!Arrays.equals(CryptoConditionWriter.writeFulfillment(fulfillment), fulfillmentRawValueBytes)) { logger.warn("EscrowFinish Fulfillment was malformed: mismatch between raw value and parsed fulfillment. " + - "fulfillmentRawValue() will contain the fulfillment value, but fulfillment() will be empty."); + "fulfillmentRawValue() will contain the fulfillment value, but fulfillment() will be empty."); return this; } @@ -346,7 +341,7 @@ default EscrowFinish normalizeFulfillment() { } catch (DerEncodingException | IllegalArgumentException e) { logger.warn( "EscrowFinish Fulfillment was malformed. fulfillmentRawValue() will contain the fulfillment value, " + - "but fulfillment() will be empty: {}", + "but fulfillment() will be empty: {}", e.getMessage(), e ); @@ -360,11 +355,4 @@ default EscrowFinish normalizeFulfillment() { throw new RuntimeException(e); } } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.ESCROW_FINISH; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index e0d54e77a..0ba8b113a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -82,13 +82,13 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { * for the transfer fee charged by the issuer, the amount that * the seller would receive is at least as much as the amount * indicated in the sell offer. - * + *

    * This functionality is intended to allow the owner of an * NfT to offer their token for sale to a third party * broker, who may then attempt to sell the NfT on for a * larger amount, without the broker having to own the NfT * or custody funds. - * + *

    * If both offers are for the same asset, it is possible that * the order in which funds are transferred might cause a * transaction that would succeed to fail due to an apparent @@ -97,7 +97,7 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { * proposal requires that the account attempting to buy the * NfT is debited first and that funds due to the broker * are credited before crediting the seller. - * + *

    * Note: in brokered mode, The offers referenced by BuyOffer * and SellOffer must both specify the same TokenID; that is, * both must be for the same NfT.

    @@ -114,10 +114,10 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { @Value.Check default void brokerFeeNotPresentInDirectModeAndAtleastOneOfferPresent() { Preconditions.checkState(buyOffer().isPresent() || sellOffer().isPresent(), - "PLease specify one offer for direct mode and both offers for brokered mode."); + "Please specify one offer for direct mode and both offers for brokered mode."); if ((buyOffer().isPresent() || sellOffer().isPresent()) && - !(buyOffer().isPresent() && sellOffer().isPresent())) { + !(buyOffer().isPresent() && sellOffer().isPresent())) { Preconditions.checkState(!brokerFee().isPresent(), "No BrokerFee needed in direct mode."); } } @@ -136,10 +136,4 @@ default void brokerFeeNotPresentInDirectModeAndAtleastOneOfferPresent() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.NFTOKEN_ACCEPT_OFFER; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java index 642a1863c..61179153b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -95,11 +95,4 @@ static ImmutableNfTokenBurn.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.NFTOKEN_BURN; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java index 5569e71df..b0c32f607 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -90,11 +90,4 @@ default void nonEmptyTokenOffers() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.NFTOKEN_CANCEL_OFFER; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index 300db2cf0..6049e67f0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -88,7 +88,7 @@ static ImmutableNfTokenCreateOffer.Builder builder() { *

    If the offer is to buy a token, this field must be present * and it must be different than Account (since an offer to * buy a token one already holds is meaningless). - * + *

    * If the offer is to sell a token, this field must not be * present, as the owner is, implicitly, the same as Account * (since an offer to sell a token one doesn't already hold @@ -129,11 +129,4 @@ static ImmutableNfTokenCreateOffer.Builder builder() { default NfTokenCreateOfferFlags flags() { return NfTokenCreateOfferFlags.empty(); } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.NFTOKEN_CREATE_OFFER; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java index 897f40083..a4a828ac6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.NfTokenMintFlags; @@ -107,11 +106,4 @@ static ImmutableNfTokenMint.Builder builder() { default NfTokenMintFlags flags() { return NfTokenMintFlags.empty(); } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.NFTOKEN_MINT; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index cf9f7a9ad..f819f0327 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -71,11 +71,4 @@ default TransactionFlags flags() { */ @JsonProperty("OfferSequence") Optional offerSequence(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.OFFER_CANCEL; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index f3e98d1d6..ed6c2387b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -93,12 +93,4 @@ default OfferCreateFlags flags() { */ @JsonProperty("Expiration") Optional expiration(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.OFFER_CREATE; - } - } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java index 5f9f7b44f..f27eaf6a1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java @@ -49,11 +49,4 @@ default TransactionFlags flags() { */ @JsonProperty("OracleDocumentID") OracleDocumentId oracleDocumentId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.ORACLE_DELETE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java index f19bddf84..7116087e8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java @@ -97,11 +97,4 @@ default TransactionFlags flags() { */ @JsonProperty("PriceDataSeries") List priceDataSeries(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.ORACLE_SET; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 6621be55d..77d28a6c6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -25,9 +25,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; -import org.xrpl.xrpl4j.model.flags.Flags; import org.xrpl.xrpl4j.model.flags.PaymentFlags; -import org.xrpl.xrpl4j.model.flags.TrustSetFlags; import java.util.List; import java.util.Optional; @@ -42,7 +40,7 @@ @JsonSerialize(as = ImmutablePayment.class) @JsonDeserialize(as = ImmutablePayment.class) public interface Payment extends Transaction { - + /** * Construct a builder for this class. * @@ -51,7 +49,7 @@ public interface Payment extends Transaction { static ImmutablePayment.Builder builder() { return ImmutablePayment.builder(); } - + /** * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a * {@link PaymentFlags} object containing the {@link Long} representation of the set bits. @@ -65,7 +63,7 @@ static ImmutablePayment.Builder builder() { default PaymentFlags flags() { return PaymentFlags.empty(); } - + /** * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to this * amount instead. @@ -74,7 +72,7 @@ default PaymentFlags flags() { */ @JsonProperty("Amount") CurrencyAmount amount(); - + /** * The unique {@link Address} of the account receiving the payment. Maybe be empty for an AccountSet or other * transaction that is not a payment. @@ -83,7 +81,7 @@ default PaymentFlags flags() { */ @JsonProperty("Destination") Address destination(); - + /** * Arbitrary {@link UnsignedInteger} tag that identifies the reason for the payment to the destination, or a hosted * recipient to pay. @@ -92,7 +90,7 @@ default PaymentFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); - + /** * Arbitrary 256-bit hash representing a specific reason or identifier for this payment. * @@ -100,7 +98,7 @@ default PaymentFlags flags() { */ @JsonProperty("InvoiceID") Optional invoiceId(); - + /** * A {@link List} of {@link List}s of payment paths to be used for this transaction. Must be omitted for XRP-to-XRP * transactions. @@ -113,7 +111,7 @@ default PaymentFlags flags() { */ @JsonProperty("Paths") List> paths(); - + /** * Highest amount of source currency this transaction is allowed to cost, including transfer fees, exchange rates, and * slippage. Does not include the XRP destroyed as a cost for submitting the transaction. @@ -127,7 +125,7 @@ default PaymentFlags flags() { */ @JsonProperty("SendMax") Optional sendMax(); - + /** * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the * {@link PaymentFlags#tfPartialPayment()}* flag is set. @@ -136,12 +134,4 @@ default PaymentFlags flags() { */ @JsonProperty("DeliverMin") Optional deliverMin(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.PAYMENT; - } - -} +} \ No newline at end of file diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index 440051b2c..8f0170def 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -128,11 +128,4 @@ default PaymentChannelClaimFlags flags() { */ @JsonProperty("PublicKey") Optional publicKey(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.PAYMENT_CHANNEL_CLAIM; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index 4fb8692d3..df3a163fe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -117,11 +117,4 @@ default TransactionFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.PAYMENT_CHANNEL_CREATE; - } - } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java index 7a593c2a9..b7c3478e2 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -93,11 +93,4 @@ default TransactionFlags flags() { */ @JsonProperty("Expiration") Optional expiration(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.PAYMENT_CHANNEL_FUND; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index be9e15bab..8b7ee2412 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -152,10 +152,4 @@ default UnsignedInteger reserveIncrement() { */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.SET_FEE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index b95620ec7..82b31f35c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -72,11 +72,4 @@ default TransactionFlags flags() { */ @JsonProperty("RegularKey") Optional

    regularKey(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.SET_REGULAR_KEY; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 82753acf5..1aee6acaa 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -82,11 +82,4 @@ default TransactionFlags flags() { */ @JsonProperty("SignerEntries") List signerEntries(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.SIGNER_LIST_SET; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java index 1df1fa215..720adba0d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -69,11 +69,4 @@ static ImmutableTicketCreate.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.TICKET_CREATE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java index dc8beec21..1856b2344 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java @@ -24,16 +24,12 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonProperty.Access; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.collect.BiMap; import com.google.common.collect.ImmutableBiMap; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.crypto.signing.Signature; -import org.xrpl.xrpl4j.model.jackson.modules.TransactionSerializer; import java.util.List; import java.util.Map; @@ -43,7 +39,7 @@ * Provides an abstract interface for all concrete XRPL transactions. */ public interface Transaction { - + /** * A bidirectional map of immutable transaction types to their corresponding {@link TransactionType}. * @@ -99,7 +95,7 @@ public interface Transaction { .put(ImmutableOracleDelete.class, TransactionType.ORACLE_DELETE) .put(ImmutableUnknownTransaction.class, TransactionType.UNKNOWN) .build(); - + /** * The unique {@link Address} of the account that initiated this transaction. * @@ -107,28 +103,27 @@ public interface Transaction { */ @JsonProperty("Account") Address account(); - + /** * The type of transaction. * * @return A {@link TransactionType}. */ -// // NOTE: This method is marked `@Derived`, which means the Immutable JSON serializer/deserializer won't include -// // this property. However, by marking the `access` as `WRITE_ONLY`, we ensure that this property is always serialized -// // from Java into JSON, but never deserialized from JSON into Java. This has two effects: (1) The `TransactionType` -// // is never entered into the `unknownFields` Map, and (2) The Java default method implementation always ensures that -// // the actual Java `TransactionType` is always populated properly, via the lookup in `typeMap`. -// @JsonProperty(value = "TransactionType" -// , access = Access.WRITE_ONLY -// ) // <-- Serialize only -// @Value.Derived -// default + // TODO FIX DOCS + // NOTE: This method is marked `@Derived`, which means the Immutable JSON serializer/deserializer won't include + // this property. However, by marking the `access` as `WRITE_ONLY`, we ensure that this property is always + // serialized + // from Java into JSON, but never deserialized from JSON into Java. This has two effects: (1) The + // `TransactionType` + // is never entered into the `unknownFields` Map, and (2) The Java default method implementation always ensures + // that + // the actual Java `TransactionType` is always populated properly, via the lookup in `typeMap`. @JsonProperty("TransactionType") - TransactionType transactionType(); -// { -// return typeMap.get(this.getClass()); -// } - + @Value.Default // Must be `Default` not `Derived`, else this field will be serialized into `unknownFields`. + default TransactionType transactionType() { + return typeMap.get(this.getClass()); + } + /** * The {@link String} representation of an integer amount of XRP, in drops, to be destroyed as a cost for distributing * this Payment transaction to the network. @@ -141,7 +136,7 @@ public interface Transaction { */ @JsonProperty("Fee") XrpCurrencyAmount fee(); - + /** * The sequence number of the account submitting the {@link Transaction}. A {@link Transaction} is only valid if the * Sequence number is exactly 1 greater than the previous transaction from the same account. @@ -157,7 +152,7 @@ public interface Transaction { default UnsignedInteger sequence() { return UnsignedInteger.ZERO; } - + /** * The sequence number of the {@link org.xrpl.xrpl4j.model.ledger.TicketObject} to use in place of a * {@link #sequence()} number. If this is provided, {@link #sequence()} must be 0. Cannot be used with @@ -167,7 +162,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("TicketSequence") Optional ticketSequence(); - + /** * Hash value identifying another transaction. If provided, this {@link Transaction} is only valid if the sending * account's previously-sent transaction matches the provided hash. @@ -176,7 +171,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("AccountTxnID") Optional accountTransactionId(); - + /** * Highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long * the transaction can wait to be validated or rejected. @@ -185,7 +180,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("LastLedgerSequence") Optional lastLedgerSequence(); - + /** * Additional arbitrary information used to identify this {@link Transaction}. * @@ -193,7 +188,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("Memos") List memos(); - + /** * Array of {@link SignerWrapper}s that represent a multi-signature which authorizes this {@link Transaction}. * @@ -201,7 +196,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("Signers") List signers(); - + /** * Arbitrary {@link UnsignedInteger} used to identify the reason for this {@link Transaction}, or a sender on whose * behalf this {@link Transaction} is made. @@ -210,7 +205,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("SourceTag") Optional sourceTag(); - + /** * The {@link PublicKey} that corresponds to the private key used to sign this transaction. If an empty string, ie * {@link PublicKey#MULTI_SIGN_PUBLIC_KEY}, indicates a multi-signature is present in the @@ -225,7 +220,7 @@ default UnsignedInteger sequence() { default PublicKey signingPublicKey() { return PublicKey.MULTI_SIGN_PUBLIC_KEY; } - + /** * The signature that verifies this transaction as originating from the account it says it is from. * @@ -235,12 +230,12 @@ default PublicKey signingPublicKey() { */ @JsonProperty("TxnSignature") Optional transactionSignature(); - + @JsonProperty("NetworkID") Optional networkId(); - + @JsonAnyGetter @JsonInclude(Include.NON_ABSENT) Map unknownFields(); - + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index 74d2b510a..70227d3eb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,8 +25,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; -import org.xrpl.xrpl4j.model.flags.Flags; -import org.xrpl.xrpl4j.model.flags.PaymentFlags; import org.xrpl.xrpl4j.model.flags.TrustSetFlags; import java.util.Optional; @@ -87,11 +85,4 @@ default TrustSetFlags flags() { */ @JsonProperty("QualityOut") Optional qualityOut(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.TRUST_SET; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index 4021ec725..1196f8ac1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -20,19 +20,13 @@ * =========================LICENSE_END================================== */ -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonProperty.Access; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; -import org.xrpl.xrpl4j.crypto.keys.ImmutablePublicKey; -import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; -import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -58,30 +52,6 @@ static ImmutableUnlModify.Builder builder() { return ImmutableUnlModify.builder(); } - @JsonProperty(value = "TransactionType") - @Value.Derived - default TransactionType transactionType() { - return TransactionType.UNL_MODIFY; - } - -// // TODO: FIXME -// @JsonCreator -// static UnlModify create( -// @JsonProperty("Account") String account, // Only the "name" is in the JSON -// @JsonProperty("SigningPubKey") PublicKey signingPublicKey, -// @JsonProperty("LedgerSequence") LedgerIndex ledgerSequence, -// @JsonProperty("UNLModifyDisabling") UnsignedInteger unlModifyDisabling, -// @JsonProperty("UNLModifyValidator") String unlModifyValidator -// ) { -// return ImmutableUnlModify.builder() -// .fee(XrpCurrencyAmount.ofDrops(0)) -// .signingPublicKey(signingPublicKey) -// .unlModifyDisabling(unlModifyDisabling) -// .unlModifyValidator(unlModifyValidator) -// .ledgerSequence(ledgerSequence) -// .build(); // The derived account() will be calculated automatically -// } - /** * This field is overridden in this class because of a bug in rippled that causes this field to be missing in API * responses. In other pseudo-transactions such as {@link SetFee} and {@link EnableAmendment}, the rippled API sets @@ -93,11 +63,8 @@ default TransactionType transactionType() { * @return Always returns ACCOUNT_ZERO, which is the base58 encoding of the number zero. */ @Override - @JsonProperty(value = "Account" - , access = Access.READ_WRITE - ) - @Value.Derived - @JsonSerialize + @JsonProperty(value = "Account") + @Value.Default // Must be `Default` not `Derived`, else this field will be serialized into `unknownFields`. default Address account() { return ACCOUNT_ZERO; } @@ -128,26 +95,30 @@ default Address account() { @JsonProperty("UNLModifyValidator") String unlModifyValidator(); + // TODO: Check the transactionType and WARN if this is incorrect (but allow it). + // TODO: Add the above check to all transactions. + // TODO: Add unit tests to verify the transaction for all txs (basically, expect a warning?) + @Value.Check default UnlModify normalize() { if (unknownFields().containsKey("Account")) { Map newUnknownFields = new HashMap<>(unknownFields()); // Copy the original - newUnknownFields.remove("Account"); - newUnknownFields.remove("TransactionType"); + // newUnknownFields.remove("Account"); + // newUnknownFields.remove("TransactionType"); - return ImmutableUnlModify.builder().from(this) - .unknownFields(Collections.unmodifiableMap(newUnknownFields)) - .build(); - } else { + // return ImmutableUnlModify.builder().from(this) + // .unknownFields(Collections.unmodifiableMap(newUnknownFields)) + // .build(); -// if (value() == Integer.MIN_VALUE) { -// return ImmutableNormalized.builder() -// .value(0) -// .build(); -// } + } else { - return this; + // if (value() == Integer.MIN_VALUE) { + // return ImmutableNormalized.builder() + // .value(0) + // .build(); + // } } + return this; } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java index 7e036c2cf..365b3fe7c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java @@ -20,7 +20,6 @@ * =========================LICENSE_END================================== */ -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonRawValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -84,7 +83,7 @@ */ @SuppressWarnings("TypeName") public class Wrappers { - + /** * A wrapped {@link String} representing an address on the XRPL. */ @@ -93,24 +92,26 @@ public class Wrappers { @JsonSerialize(as = Address.class, using = AddressSerializer.class) @JsonDeserialize(as = Address.class, using = AddressDeserializer.class) abstract static class _Address extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a {@link Address}'s value's length is equal to 34 characters and starts with `r`. */ @Value.Check public void validateAddress() { Preconditions.checkArgument(this.value().startsWith("r"), "Invalid Address: Bad Prefix"); - Preconditions.checkArgument(this.value().length() >= 25 && this.value().length() <= 35, - "Classic Addresses must be (25,35) characters long inclusive."); + Preconditions.checkArgument( + this.value().length() >= 25 && this.value().length() <= 35, + "Classic Addresses must be (25,35) characters long inclusive." + ); } - + } - + /** * A wrapped {@link String} representing an X-Address on the XRPL. */ @@ -119,14 +120,14 @@ public void validateAddress() { @JsonSerialize(as = XAddress.class) @JsonDeserialize(as = XAddress.class) abstract static class _XAddress extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing the Hex representation of a 256-bit Hash. */ @@ -135,12 +136,12 @@ public String toString() { @JsonSerialize(as = Hash256.class, using = Hash256Serializer.class) @JsonDeserialize(as = Hash256.class, using = Hash256Deserializer.class) abstract static class _Hash256 extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a {@link Hash256}'s value's length is equal to 64 characters. */ @@ -148,7 +149,7 @@ public String toString() { public void validateLength() { Preconditions.checkArgument(this.value().length() == 64, "Hash256 Strings must be 64 characters long."); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof Hash256) { @@ -159,13 +160,13 @@ public boolean equals(Object obj) { } return false; } - + @Override public int hashCode() { return value().toUpperCase(Locale.ENGLISH).hashCode(); } } - + /** * A {@link CurrencyAmount} for the XRP currency (non-issued). {@link XrpCurrencyAmount}s are a {@link String} * representation of an unsigned integer representing the amount in XRP drops. @@ -175,10 +176,10 @@ public int hashCode() { @JsonSerialize(as = XrpCurrencyAmount.class, using = XrpCurrencyAmountSerializer.class) @JsonDeserialize(as = XrpCurrencyAmount.class, using = XrpCurrencyAmountDeserializer.class) abstract static class _XrpCurrencyAmount extends Wrapper implements Serializable, CurrencyAmount { - + static final BigDecimal SMALLEST_XRP = new BigDecimal("0.000001"); static final DecimalFormat FORMATTER = new DecimalFormat("###,###"); - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. Because XRP is capped to 100B units (1e17 * drops), this value will never overflow Java's signed long number. @@ -197,7 +198,7 @@ public static XrpCurrencyAmount ofDrops(final long drops) { return ofDrops(UnsignedLong.valueOf(drops), false); } } - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. * @@ -207,11 +208,11 @@ public static XrpCurrencyAmount ofDrops(final long drops) { */ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops) { Objects.requireNonNull(drops); - + // Note: ofDrops() throws an exception if too big. return _XrpCurrencyAmount.ofDrops(drops, false); } - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. * @@ -222,13 +223,13 @@ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops) { */ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops, final boolean isNegative) { Objects.requireNonNull(drops); - + return XrpCurrencyAmount.builder() .value(drops) .isNegative(isNegative) .build(); } - + /** * Constructs an {@link XrpCurrencyAmount} using decimal amount of XRP. * @@ -238,11 +239,11 @@ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops, final boolean */ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { Objects.requireNonNull(amount); - + if (FluentCompareTo.is(amount).equalTo(BigDecimal.ZERO)) { return ofDrops(UnsignedLong.ZERO); } - + final BigDecimal absAmount = amount.abs(); // Whether positive or negative, ensure the amount is not too small and not too big. Preconditions.checkArgument( @@ -253,7 +254,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { FluentCompareTo.is(absAmount).lessThanOrEqualTo(MAX_XRP_BD), String.format("Amount must be less-than-or-equal-to %s", MAX_XRP_BD) ); - + if (amount.signum() == 0) { // zero return ofDrops(UnsignedLong.ZERO); // <-- Should never happen per the first check above, but just in case. } else { // positive or negative @@ -261,7 +262,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { return ofDrops(UnsignedLong.valueOf(absAmount.scaleByPowerOfTen(6).toBigIntegerExact()), isNegative); } } - + /** * Indicates whether this amount is positive or negative. * @@ -283,7 +284,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { public boolean isNegative() { return false; } - + /** * Convert this XRP amount into a decimal representing a value denominated in whole XRP units. For example, a value * of `1.0` represents 1 unit of XRP; a value of `0.5` represents a half of an XRP unit. @@ -299,7 +300,7 @@ public BigDecimal toXrp() { return amount; } } - + /** * Adds another {@link XrpCurrencyAmount} to this amount. * @@ -314,7 +315,7 @@ public XrpCurrencyAmount plus(XrpCurrencyAmount other) { (other.value().longValue() * (other.isNegative() ? -1 : 1)); return XrpCurrencyAmount.ofDrops(result); } - + /** * Subtract another {@link XrpCurrencyAmount} from this amount. * @@ -329,7 +330,7 @@ public XrpCurrencyAmount minus(XrpCurrencyAmount other) { (other.value().longValue() * (other.isNegative() ? -1 : 1)); return XrpCurrencyAmount.ofDrops(result); } - + /** * Multiplies this amount by another {@link XrpCurrencyAmount}. * @@ -343,12 +344,12 @@ public XrpCurrencyAmount times(XrpCurrencyAmount other) { this.isNegative() || other.isNegative() ); } - + @Override public String toString() { return String.format("%s%s", isNegative() ? "-" : "", this.value().toString()); } - + /** * Validates that this {@link XrpCurrencyAmount} does not exceed the maximum number of drops. */ @@ -361,23 +362,23 @@ protected void check() { ) ); } - + } - + @Value.Immutable @Wrapped @JsonSerialize(as = Marker.class, using = MarkerSerializer.class) @JsonDeserialize(as = Marker.class, using = MarkerDeserializer.class) abstract static class _Marker extends Wrapper implements Serializable { - + @Override @JsonRawValue public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing the NFT Id. */ @@ -386,12 +387,12 @@ public String toString() { @JsonSerialize(as = NfTokenId.class, using = NfTokenIdSerializer.class) @JsonDeserialize(as = NfTokenId.class, using = NfTokenIdDeserializer.class) abstract static class _NfTokenId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a NfTokenId value's length is equal to 64 characters. */ @@ -399,7 +400,7 @@ public String toString() { public void validateLength() { Preconditions.checkArgument(this.value().length() == 64, "TokenId must be 64 characters long."); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof NfTokenId) { @@ -411,7 +412,7 @@ public boolean equals(Object obj) { return false; } } - + /** * A wrapped {@link String} containing the Uri. */ @@ -420,7 +421,7 @@ public boolean equals(Object obj) { @JsonSerialize(as = NfTokenUri.class, using = NfTokenUriSerializer.class) @JsonDeserialize(as = NfTokenUri.class) abstract static class _NfTokenUri extends Wrapper implements Serializable { - + /** * Constructs an {@link NfTokenUri} using a String value. * @@ -431,7 +432,7 @@ abstract static class _NfTokenUri extends Wrapper implements Serializabl public static NfTokenUri ofPlainText(String plaintext) { return NfTokenUri.of(BaseEncoding.base16().encode(plaintext.getBytes(StandardCharsets.UTF_8))); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof NfTokenUri) { @@ -443,7 +444,7 @@ public boolean equals(Object obj) { return false; } } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the TransferFee. * @@ -456,12 +457,7 @@ public boolean equals(Object obj) { @JsonSerialize(as = TransferFee.class, using = TransferFeeSerializer.class) @JsonDeserialize(as = TransferFee.class, using = TransferFeeDeserializer.class) abstract static class _TransferFee extends Wrapper implements Serializable { - - @Override - public String toString() { - return this.value().toString(); - } - + /** * Construct {@link TransferFee} as a percentage value. * @@ -480,8 +476,12 @@ public static TransferFee ofPercent(BigDecimal percent) { ); return TransferFee.of(UnsignedInteger.valueOf(percent.scaleByPowerOfTen(3).toBigIntegerExact())); } - - + + @Override + public String toString() { + return this.value().toString(); + } + /** * Validates that a NfTokenId value's length is equal to 64 characters. */ @@ -490,11 +490,12 @@ public void validateBounds() { Preconditions.checkArgument( FluentCompareTo.is(value()).lessThanOrEqualTo(UnsignedInteger.valueOf(50000)) && FluentCompareTo.is(value()).greaterThanEqualTo(UnsignedInteger.valueOf(0)), - "TransferFee should be in the range 0 to 50000."); + "TransferFee should be in the range 0 to 50000." + ); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing a Network ID. */ @@ -503,12 +504,7 @@ public void validateBounds() { @JsonSerialize(as = NetworkId.class, using = NetworkIdSerializer.class) @JsonDeserialize(as = NetworkId.class, using = NetworkIdDeserializer.class) abstract static class _NetworkId extends Wrapper implements Serializable { - - @Override - public String toString() { - return this.value().toString(); - } - + /** * Construct a {@link NetworkId} from a {@code long}. The supplied value must be less than or equal to * 4,294,967,295, the largest unsigned 32-bit integer. @@ -520,8 +516,13 @@ public String toString() { public static NetworkId of(long networkId) { return NetworkId.of(UnsignedInteger.valueOf(networkId)); } + + @Override + public String toString() { + return this.value().toString(); + } } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the TransferFee. * @@ -534,12 +535,7 @@ public static NetworkId of(long networkId) { @JsonDeserialize(as = TradingFee.class, using = TradingFeeDeserializer.class) @Beta abstract static class _TradingFee extends Wrapper implements Serializable { - - @Override - public String toString() { - return this.value().toString(); - } - + /** * Construct {@link TradingFee} as a percentage value. * @@ -554,7 +550,12 @@ public static TradingFee ofPercent(BigDecimal percent) { ); return TradingFee.of(UnsignedInteger.valueOf(percent.scaleByPowerOfTen(3).toBigIntegerExact())); } - + + @Override + public String toString() { + return this.value().toString(); + } + /** * Get the {@link TradingFee} as a {@link BigDecimal}. * @@ -563,9 +564,9 @@ public static TradingFee ofPercent(BigDecimal percent) { public BigDecimal bigDecimalValue() { return BigDecimal.valueOf(value().longValue(), 3); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the VoteWeight. * @@ -578,12 +579,12 @@ public BigDecimal bigDecimalValue() { @JsonDeserialize(as = VoteWeight.class, using = VoteWeightDeserializer.class) @Beta abstract static class _VoteWeight extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + /** * Get the {@link VoteWeight} as a {@link BigDecimal}. * @@ -592,9 +593,9 @@ public String toString() { public BigDecimal bigDecimalValue() { return BigDecimal.valueOf(value().longValue(), 3); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedLong} containing an XChainClaimID. * @@ -607,14 +608,14 @@ public BigDecimal bigDecimalValue() { @JsonDeserialize(as = XChainClaimId.class, using = XChainClaimIdDeserializer.class) @Beta abstract static class _XChainClaimId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedLong} representing a counter for XLS-38 sidechains. This * wrapper mostly exists to ensure we serialize fields of this type as a hex String in JSON, as these fields are @@ -629,14 +630,14 @@ public String toString() { @JsonDeserialize(as = XChainCount.class, using = XChainCountDeserializer.class) @Beta abstract static class _XChainCount extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link String} containing a DID Document. * @@ -649,14 +650,14 @@ public String toString() { @JsonDeserialize(as = DidDocument.class, using = DidDocumentDeserializer.class) @Beta abstract static class _DidDocument extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing a DID URI. * @@ -669,14 +670,14 @@ public String toString() { @JsonDeserialize(as = DidUri.class, using = DidUriDeserializer.class) @Beta abstract static class _DidUri extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing DID Data. * @@ -689,14 +690,14 @@ public String toString() { @JsonDeserialize(as = DidData.class, using = DidDataDeserializer.class) @Beta abstract static class _DidData extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link UnsignedInteger} containing an Oracle document ID. * @@ -709,14 +710,14 @@ public String toString() { @JsonDeserialize(as = OracleDocumentId.class, using = OracleDocumentIdDeserializer.class) @Beta abstract static class _OracleDocumentId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link String} containing an Oracle provider. * @@ -729,14 +730,14 @@ public String toString() { @JsonDeserialize(as = OracleProvider.class, using = OracleProviderDeserializer.class) @Beta abstract static class _OracleProvider extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing an Oracle URI. * @@ -749,14 +750,14 @@ public String toString() { @JsonDeserialize(as = OracleUri.class, using = OracleUriDeserializer.class) @Beta abstract static class _OracleUri extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing an Oracle asset price. * @@ -769,11 +770,11 @@ public String toString() { @JsonDeserialize(as = AssetPrice.class, using = AssetPriceDeserializer.class) @Beta abstract static class _AssetPrice extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java index 8e05360f7..b6c1b740c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java @@ -77,11 +77,4 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_ACCOUNT_CREATE_COMMIT; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java index 807a52b09..6da308668 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java @@ -141,11 +141,4 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java index 8134553b4..df3ac3f0b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java @@ -134,11 +134,4 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_ADD_CLAIM_ATTESTATION; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java index 07fceea2d..ce389521f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java @@ -89,11 +89,4 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_CLAIM; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java index 07618b1d8..805dc3b40 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; -import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -82,11 +81,4 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_COMMIT; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java index 83e271bf0..dd9b83cce 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java @@ -68,11 +68,4 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_CREATE_BRIDGE; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java index 6a6fe957a..babfe2d50 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java @@ -66,11 +66,4 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_CREATE_CLAIM_ID; - } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java index 4ac5fe652..90b8b4fb5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java @@ -6,8 +6,6 @@ import com.google.common.annotations.Beta; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; -import org.xrpl.xrpl4j.model.flags.PaymentFlags; -import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.flags.XChainModifyBridgeFlags; import java.util.Optional; @@ -73,11 +71,4 @@ default XChainModifyBridgeFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); - - @JsonProperty(value = "TransactionType") - @Value.Derived - @Override - default TransactionType transactionType() { - return TransactionType.XCHAIN_MODIFY_BRIDGE; - } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java index 11df2d770..9ac1cc849 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java @@ -20,10 +20,6 @@ * =========================LICENSE_END================================== */ -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.xrpl.xrpl4j.crypto.TestConstants.ED_PUBLIC_KEY; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Strings; @@ -33,7 +29,6 @@ import com.ripple.cryptoconditions.CryptoConditionReader; import com.ripple.cryptoconditions.der.DerEncodingException; import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.codec.binary.XrplBinaryCodec; import org.xrpl.xrpl4j.crypto.keys.PublicKey; import org.xrpl.xrpl4j.crypto.signing.Signature; import org.xrpl.xrpl4j.model.flags.AccountSetTransactionFlags; @@ -53,82 +48,18 @@ import org.xrpl.xrpl4j.model.ledger.RippleStateObject; import org.xrpl.xrpl4j.model.ledger.SignerEntry; import org.xrpl.xrpl4j.model.ledger.SignerEntryWrapper; -import org.xrpl.xrpl4j.model.transactions.AccountDelete; -import org.xrpl.xrpl4j.model.transactions.AccountSet; -import org.xrpl.xrpl4j.model.transactions.Address; -import org.xrpl.xrpl4j.model.transactions.AmmBid; -import org.xrpl.xrpl4j.model.transactions.AmmCreate; -import org.xrpl.xrpl4j.model.transactions.AmmDelete; -import org.xrpl.xrpl4j.model.transactions.AmmDeposit; -import org.xrpl.xrpl4j.model.transactions.AmmVote; -import org.xrpl.xrpl4j.model.transactions.AmmWithdraw; -import org.xrpl.xrpl4j.model.transactions.AssetPrice; -import org.xrpl.xrpl4j.model.transactions.CheckCancel; -import org.xrpl.xrpl4j.model.transactions.CheckCash; -import org.xrpl.xrpl4j.model.transactions.CheckCreate; -import org.xrpl.xrpl4j.model.transactions.CurrencyAmount; -import org.xrpl.xrpl4j.model.transactions.DepositPreAuth; -import org.xrpl.xrpl4j.model.transactions.DidData; -import org.xrpl.xrpl4j.model.transactions.DidDelete; -import org.xrpl.xrpl4j.model.transactions.DidDocument; -import org.xrpl.xrpl4j.model.transactions.DidSet; -import org.xrpl.xrpl4j.model.transactions.DidUri; -import org.xrpl.xrpl4j.model.transactions.EscrowCancel; -import org.xrpl.xrpl4j.model.transactions.EscrowCreate; -import org.xrpl.xrpl4j.model.transactions.EscrowFinish; -import org.xrpl.xrpl4j.model.transactions.Hash256; -import org.xrpl.xrpl4j.model.transactions.ImmutableAmmBid; -import org.xrpl.xrpl4j.model.transactions.ImmutableAmmCreate; -import org.xrpl.xrpl4j.model.transactions.ImmutableAmmDelete; -import org.xrpl.xrpl4j.model.transactions.ImmutableAmmDeposit; -import org.xrpl.xrpl4j.model.transactions.ImmutableDidDelete; -import org.xrpl.xrpl4j.model.transactions.ImmutableDidSet; -import org.xrpl.xrpl4j.model.transactions.ImmutableOracleDelete; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainAccountCreateCommit; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainAddClaimAttestation; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainClaim; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainCreateBridge; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainCreateClaimId; -import org.xrpl.xrpl4j.model.transactions.ImmutableXChainModifyBridge; -import org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount; -import org.xrpl.xrpl4j.model.transactions.NetworkId; -import org.xrpl.xrpl4j.model.transactions.OfferCancel; -import org.xrpl.xrpl4j.model.transactions.OfferCreate; -import org.xrpl.xrpl4j.model.transactions.OracleDelete; -import org.xrpl.xrpl4j.model.transactions.OracleDocumentId; -import org.xrpl.xrpl4j.model.transactions.OracleProvider; -import org.xrpl.xrpl4j.model.transactions.OracleSet; -import org.xrpl.xrpl4j.model.transactions.Payment; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelClaim; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelCreate; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelFund; -import org.xrpl.xrpl4j.model.transactions.PriceData; -import org.xrpl.xrpl4j.model.transactions.PriceDataWrapper; -import org.xrpl.xrpl4j.model.transactions.SetRegularKey; -import org.xrpl.xrpl4j.model.transactions.SignerListSet; -import org.xrpl.xrpl4j.model.transactions.TradingFee; -import org.xrpl.xrpl4j.model.transactions.Transaction; -import org.xrpl.xrpl4j.model.transactions.TrustSet; -import org.xrpl.xrpl4j.model.transactions.XChainAccountCreateCommit; -import org.xrpl.xrpl4j.model.transactions.XChainAddAccountCreateAttestation; -import org.xrpl.xrpl4j.model.transactions.XChainAddClaimAttestation; -import org.xrpl.xrpl4j.model.transactions.XChainBridge; -import org.xrpl.xrpl4j.model.transactions.XChainClaim; -import org.xrpl.xrpl4j.model.transactions.XChainClaimId; -import org.xrpl.xrpl4j.model.transactions.XChainCommit; -import org.xrpl.xrpl4j.model.transactions.XChainCount; -import org.xrpl.xrpl4j.model.transactions.XChainCreateBridge; -import org.xrpl.xrpl4j.model.transactions.XChainCreateClaimId; -import org.xrpl.xrpl4j.model.transactions.XChainModifyBridge; -import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; +import org.xrpl.xrpl4j.model.transactions.*; import java.math.BigDecimal; -public class BinarySerializationTests { +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +public class BinarySerializationTests { + ObjectMapper objectMapper = ObjectMapperFactory.create(); XrplBinaryCodec binaryCodec = XrplBinaryCodec.getInstance(); - + private static IssuedCurrencyAmount currencyAmount(int amount) { return IssuedCurrencyAmount.builder() .currency("WCG") @@ -136,7 +67,7 @@ private static IssuedCurrencyAmount currencyAmount(int amount) { .value(amount + "") .build(); } - + @Test public void serializeAccountSetTransactionWithNetworkId() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -145,12 +76,12 @@ public void serializeAccountSetTransactionWithNetworkId() throws JsonProcessingE .sequence(UnsignedInteger.valueOf(10598)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000321FFFFFFFF240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA03" + "8E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithPresentOptionalStringFields() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -163,14 +94,14 @@ public void serializeAccountSetTransactionWithPresentOptionalStringFields() thro .emailHash("F9879D71855B5FF21E4963273A886BFC") .walletLocator("F9879D71855B5FF21E4963273A886BFCF9879D71855B5FF21E4963273A886BFC") .build(); - + String expectedBinary = "12000321FFFFFFFF240000296641F9879D71855B5FF21E4963273A886BFC57F98" + "79D71855B5FF21E4963273A886BFCF9879D71855B5FF21E4963273A886BFC68400000000000000A722103AB" + "40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB73007702ABCD81140F3D0C7D2" + "CFAB2EC8295451F0B3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithEmptyStrings() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -181,12 +112,12 @@ public void serializeAccountSetTransactionWithEmptyStrings() throws JsonProcessi .domain("") .messageKey("") .build(); - + String expectedBinary = "12000321FFFFFFFF240000296668400000000000000A72007300" + "770081140F3D0C7D2CFAB2EC8295451F0B3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithEmptyFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -194,12 +125,12 @@ public void serializeAccountSetTransactionWithEmptyFlags() throws JsonProcessing .fee(XrpCurrencyAmount.ofDrops(10)) .sequence(UnsignedInteger.valueOf(10598)) .build(); - + String expectedBinary = "120003240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA03" + "8E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithZeroFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -208,12 +139,12 @@ public void serializeAccountSetTransactionWithZeroFlags() throws JsonProcessingE .sequence(UnsignedInteger.valueOf(10598)) .flags(AccountSetTransactionFlags.of(0L)) .build(); - + String expectedBinary = "1200032200000000240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B" + "3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithNonZeroFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -222,12 +153,12 @@ public void serializeAccountSetTransactionWithNonZeroFlags() throws JsonProcessi .sequence(UnsignedInteger.valueOf(10598)) .flags(AccountSetTransactionFlags.builder().tfDisallowXrp().build()) .build(); - + String expectedBinary = "1200032280100000240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA" + "038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountDelete() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -238,12 +169,12 @@ public void serializeAccountDelete() throws JsonProcessingException { .destinationTag(UnsignedInteger.valueOf(13)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001521FFFFFFFF240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeAccountDeleteWithZeroFlags() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -254,12 +185,12 @@ public void serializeAccountDeleteWithZeroFlags() throws JsonProcessingException .destinationTag(UnsignedInteger.valueOf(13)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200152200000000240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeAccountDeleteWithNonZeroFlags() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -270,12 +201,12 @@ public void serializeAccountDeleteWithNonZeroFlags() throws JsonProcessingExcept .destinationTag(UnsignedInteger.valueOf(13)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200152280000000240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeCheckCancel() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -285,12 +216,12 @@ public void serializeCheckCancel() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(12)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001221FFFFFFFF240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCancelWithZeroFlags() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -300,12 +231,12 @@ public void serializeCheckCancelWithZeroFlags() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(12)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200122200000000240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCancelWithNonZeroFlags() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -315,12 +246,12 @@ public void serializeCheckCancelWithNonZeroFlags() throws JsonProcessingExceptio .fee(XrpCurrencyAmount.ofDrops(12)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200122280000000240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCashWithZeroFlags() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -331,12 +262,12 @@ public void serializeCheckCashWithZeroFlags() throws JsonProcessingException { .amount(XrpCurrencyAmount.ofDrops(100)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120011220000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithNonZeroFlags() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -347,12 +278,12 @@ public void serializeCheckCashWithNonZeroFlags() throws JsonProcessingException .amount(XrpCurrencyAmount.ofDrops(100)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithXrpAmount() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -363,12 +294,12 @@ public void serializeCheckCashWithXrpAmount() throws JsonProcessingException { .amount(XrpCurrencyAmount.ofDrops(100)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001121FFFFFFFF24000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithXrpDeliverMin() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -378,12 +309,12 @@ public void serializeCheckCashWithXrpDeliverMin() throws JsonProcessingException .fee(XrpCurrencyAmount.ofDrops(12)) .deliverMin(XrpCurrencyAmount.ofDrops(100)) .build(); - + String expectedBinary = "12001124000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056" + "FCBD657F5733468400000000000000C6A40000000000000647300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithIssuedCurrencyDeliverMin() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -397,13 +328,13 @@ public void serializeCheckCashWithIssuedCurrencyDeliverMin() throws JsonProcessi .value("100") .build()) .build(); - + String expectedBinary = "12001124000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A40" + "56FCBD657F5733468400000000000000C6AD5038D7EA4C68000000000000000000000000000555344000000000049FF0C73CA" + "6AF9733DA805F76CA2C37776B7C46B7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test void serializeCheckCreate() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -417,13 +348,13 @@ void serializeCheckCreate() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001021FFFFFFFF24000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeCheckCreateWithZeroFlags() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -437,13 +368,13 @@ void serializeCheckCreateWithZeroFlags() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120010220000000024000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeCheckCreateWithNonZeroFlags() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -457,13 +388,13 @@ void serializeCheckCreateWithNonZeroFlags() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120010228000000024000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeDepositPreAuth() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -473,12 +404,12 @@ void serializeDepositPreAuth() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001321FFFFFFFF240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeDepositPreAuthWithZeroFlags() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -488,12 +419,12 @@ void serializeDepositPreAuthWithZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200132200000000240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeDepositPreAuthWithNonZeroFlags() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -503,12 +434,12 @@ void serializeDepositPreAuthWithNonZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200132280000000240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeEscrowCreate() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -525,13 +456,13 @@ void serializeEscrowCreate() throws JsonProcessingException, DerEncodingExceptio ) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000121FFFFFFFF24000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCreateWithZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -548,13 +479,13 @@ void serializeEscrowCreateWithZeroFlags() throws JsonProcessingException, DerEnc ) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120001220000000024000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCreateWithNonZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -571,13 +502,13 @@ void serializeEscrowCreateWithNonZeroFlags() throws JsonProcessingException, Der ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120001228000000024000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCancel() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -588,12 +519,12 @@ void serializeEscrowCancel() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000421FFFFFFFF240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowCancelWithZeroFlags() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -604,12 +535,12 @@ void serializeEscrowCancelWithZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200042200000000240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowCancelWithNonZeroFlags() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -620,12 +551,12 @@ void serializeEscrowCancelWithNonZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200042280000000240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowFinish() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -640,13 +571,13 @@ void serializeEscrowFinish() throws JsonProcessingException, DerEncodingExceptio .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000221FFFFFFFF240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeEscrowFinishWithZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -661,13 +592,13 @@ void serializeEscrowFinishWithZeroFlags() throws JsonProcessingException, DerEnc .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200022200000000240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeEscrowFinishWithNonZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -682,23 +613,23 @@ void serializeEscrowFinishWithNonZeroFlags() throws JsonProcessingException, Der .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200022280000000240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeXrpPaymentWithEmptyFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -709,22 +640,22 @@ void serializeXrpPaymentWithEmptyFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000021FFFFFFFF230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeXrpPaymentWithZeroFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -735,22 +666,22 @@ void serializeXrpPaymentWithZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .flags(PaymentFlags.UNSET) .build(); - + String expectedBinary = "1200002200000000230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeXrpPaymentWithNonZeroFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -761,32 +692,32 @@ void serializeXrpPaymentWithNonZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .flags(PaymentFlags.builder().tfPartialPayment(true).build()) .build(); - + String expectedBinary = "1200002280020000230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeIssuedCurrencyPayment() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Address issuer = Address.builder() .value("rDgZZ3wyprx4ZqrGQUkquE9Fs2Xs8XBcdw") .build(); - + CurrencyAmount amount = IssuedCurrencyAmount.builder() .currency("USD") .issuer(issuer) .value("1234567890123456") .build(); - + Payment payment = Payment.builder() .flags(PaymentFlags.builder() .tfPartialPayment(true) @@ -799,13 +730,13 @@ void serializeIssuedCurrencyPayment() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(789)) .sequence(UnsignedInteger.valueOf(1)) .build(); - + String expectedBinary = "1200002280020000230000000124000000012E0000000261D84462D53C8ABAC000000000000000" + "000000000055534400000000008B1CE810C13D6F337DAC85863B3D70265A24DF4468400000000000031573008114EE39E6D" + "05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializePaymentChannelCreateWithEmptyFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -821,13 +752,13 @@ void serializePaymentChannelCreateWithEmptyFlags() throws JsonProcessingExceptio .cancelAfter(UnsignedLong.valueOf(533171558)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000D21FFFFFFFF230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelCreateWithZeroFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -843,13 +774,13 @@ void serializePaymentChannelCreateWithZeroFlags() throws JsonProcessingException .cancelAfter(UnsignedLong.valueOf(533171558)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000D2200000000230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelCreateWithNonZeroFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -865,13 +796,13 @@ void serializePaymentChannelCreateWithNonZeroFlags() throws JsonProcessingExcept .cancelAfter(UnsignedLong.valueOf(533171558)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000D2280000000230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelClaimWithEmptyFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -886,16 +817,16 @@ void serializePaymentChannelClaimWithEmptyFlags() throws JsonProcessingException .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000F21FFFFFFFF24000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelClaimWithZeroFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -910,16 +841,16 @@ void serializePaymentChannelClaimWithZeroFlags() throws JsonProcessingException .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .flags(PaymentChannelClaimFlags.of(0)) .build(); - + String expectedBinary = "12000F220000000024000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelClaimWithNonZeroFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -934,16 +865,16 @@ void serializePaymentChannelClaimWithNonZeroFlags() throws JsonProcessingExcepti "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .build(); - + String expectedBinary = "12000F228002000024000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelFund() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -955,13 +886,13 @@ void serializePaymentChannelFund() throws JsonProcessingException { .expiration(UnsignedLong.valueOf(543171558)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedJson = "12000E21FFFFFFFF24000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializePaymentChannelFundWithZeroFlags() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -973,13 +904,13 @@ void serializePaymentChannelFundWithZeroFlags() throws JsonProcessingException { .expiration(UnsignedLong.valueOf(543171558)) .flags(TransactionFlags.UNSET) .build(); - + String expectedJson = "12000E220000000024000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializePaymentChannelFundWithNonZeroFlags() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -991,13 +922,13 @@ void serializePaymentChannelFundWithNonZeroFlags() throws JsonProcessingExceptio .expiration(UnsignedLong.valueOf(543171558)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedJson = "12000E228000000024000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializeTrustSetWithEmptyFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1011,13 +942,13 @@ void serializeTrustSetWithEmptyFlags() throws JsonProcessingException { .build()) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001421FFFFFFFF240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithZeroFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1031,13 +962,13 @@ void serializeTrustSetWithZeroFlags() throws JsonProcessingException { .value("10000000") .build()) .build(); - + String expectedBinary = "1200142200000000240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithNonZeroFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1053,13 +984,13 @@ void serializeTrustSetWithNonZeroFlags() throws JsonProcessingException { .value("10000000") .build()) .build(); - + String expectedBinary = "1200142280020000240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithMaxValue() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1075,26 +1006,26 @@ void serializeTrustSetWithMaxValue() throws JsonProcessingException { PublicKey.fromBase16EncodedPublicKey("EDD299D60BCE7980F6082945B5597FFFD35223F1950673BFA4D4AED6FDE5097156") ) .build(); - + String expectedBinary = "120014240000000563EC6386F26FC0FFFF7872706C346A436F696E00000000000000000000" + "6AF21A4FCA7AF4F62AA88E72CA923CDAE72FBC1668400000000000000A7321EDD299D60BCE7980F6082945B5597FFFD35223F19506" + "73BFA4D4AED6FDE5097156811473C6A5937EB779F5CF33600DB0ADB8556A497318"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, objectMapper.getTypeFactory().constructType(TrustSet.class) ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.toPlainString()).isEqualTo(originalValue.toPlainString()); } - + @Test void serializeTrustSetWithMaxValueMinusOnePowerOfTen() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1110,26 +1041,26 @@ void serializeTrustSetWithMaxValueMinusOnePowerOfTen() throws JsonProcessingExce PublicKey.fromBase16EncodedPublicKey("ED930B5CBBBCA68DE43CC928E4F3860151E1E5F10D52478B38512651363F4DE8D0") ) .build(); - + String expectedBinary = "120014240000000563EC2386F26FC0FFFF7872706C346A436F696E00000000000000000000" + "7F65AB9FC20D6D3140698670A12869D6A7D9EE9568400000000000000A7321ED930B5CBBBCA68DE43CC928E4F3860151E1E5F10D52" + "478B38512651363F4DE8D08114EBC899C616EE2D4765C3CBBEB51E6131F701537C"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, objectMapper.getTypeFactory().constructType(TrustSet.class) ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.toPlainString()).isEqualTo(originalValue.toPlainString()); } - + @Test void serializeTrustSetWithMaxValuePlusOnePowerOfTenThrows() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1145,13 +1076,13 @@ void serializeTrustSetWithMaxValuePlusOnePowerOfTenThrows() throws JsonProcessin .value(new BigDecimal(IssuedCurrencyAmount.MAX_VALUE).scaleByPowerOfTen(1).toEngineeringString()) .build()) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeTrustSetWithMaxValuePlusOneThrows() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1167,13 +1098,13 @@ void serializeTrustSetWithMaxValuePlusOneThrows() throws JsonProcessingException .value(new BigDecimal(IssuedCurrencyAmount.MAX_VALUE).add(BigDecimal.ONE).toEngineeringString()) .build()) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessageEndingWith("has more than 16 digits"); } - + @Test void serializeTrustSetWithMinPositiveValue() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1189,26 +1120,26 @@ void serializeTrustSetWithMinPositiveValue() throws JsonProcessingException { PublicKey.fromBase16EncodedPublicKey("ED55D61E72F14EC798ABC10BC96381573717658B46F58E416EC0C74A467835AB4D") ) .build(); - + String expectedBinary = "120014240000000563C0438D7EA4C680007872706C346A436F696E00000000000" + "00000000002B8C37A261B75FC294AC84B40D249456715277D68400000000000000A7321ED55D61E72F14EC798ABC10BC9" + "6381573717658B46F58E416EC0C74A467835AB4D8114D8C033D20D216FD8939778C229F8BD9CF9585EAC"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, TrustSet.class ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.setScale(96).toString()).isEqualTo(originalValue.toString()); } - + @Test void serializeTrustSetWithMinPositiveValuePlusOne() throws JsonProcessingException { BigDecimal value = new BigDecimal(IssuedCurrencyAmount.MIN_POSITIVE_VALUE) @@ -1226,26 +1157,26 @@ void serializeTrustSetWithMinPositiveValuePlusOne() throws JsonProcessingExcepti PublicKey.fromBase16EncodedPublicKey("ED098659726D4B0CDCD35E37135766FF2038579291351CC08DE70C32851D049A83") ) .build(); - + String expectedBinary = "120014240000000563C043E871B540C0007872706C346A436F696E000000000000000" + "00000ED7C3F2940D37A688A1D3F9AB883A8E3AB4D5FE168400000000000000A7321ED098659726D4B0CDCD35E37135766FF20" + "38579291351CC08DE70C32851D049A838114FC675B42929326571785885ECD4E61FA82F4AAAC"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, TrustSet.class ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.setScale(96).toString()).isEqualTo(originalValue.setScale(96).toString()); } - + @Test void serializeTrustSetWithMinPositiveValueMinusOneThrows() throws JsonProcessingException { BigDecimal value = new BigDecimal(IssuedCurrencyAmount.MIN_POSITIVE_VALUE) @@ -1263,13 +1194,13 @@ void serializeTrustSetWithMinPositiveValueMinusOneThrows() throws JsonProcessing PublicKey.fromBase16EncodedPublicKey("ED098659726D4B0CDCD35E37135766FF2038579291351CC08DE70C32851D049A83") ) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingException { RippleStateObject rippleStateObject = RippleStateObject.builder() @@ -1299,7 +1230,7 @@ void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingExcept .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "1100722200200000250000000155000000000000000000000000000000000000000000000000000000000" + "000000062AC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E366" + "EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC6386F26" + @@ -1308,7 +1239,7 @@ void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingExcept String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MIN_VALUE).subtract( @@ -1343,7 +1274,7 @@ void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessin .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "11007222002000002500000001550000000000000000000000000000000000000000000000000000000" + "00000000062AC632BFF5F46BFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183" + "E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC6" + @@ -1352,7 +1283,7 @@ void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessin String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMinBalanceValueMinusOneThrows() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MIN_VALUE).subtract(new BigDecimal("1e80")) @@ -1386,14 +1317,14 @@ void serializeRippleStateObjectWithMinBalanceValueMinusOneThrows() throws JsonPr .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String transactionJson = objectMapper.writeValueAsString(rippleStateObject); assertThatThrownBy( () -> binaryCodec.encode(transactionJson) ).isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingException { RippleStateObject rippleStateObject = RippleStateObject.builder() @@ -1423,7 +1354,7 @@ void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingExcep .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "110072220020000025000000015500000000000000000000000000000000000000000000000000" + "000000000000006280438D7EA4C680000000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172" + "A6B9300183E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6" + @@ -1433,7 +1364,7 @@ void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingExcep String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MAX_NEGATIVE_VALUE) @@ -1465,7 +1396,7 @@ void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcess .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "11007222002000002500000001550000000000000000000000000000000000000000000000000000000" + "000000000628043E871B540C0000000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183" + "E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC" + @@ -1474,7 +1405,7 @@ void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcess String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMaxNegativeValuePlusOneThrows() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MAX_NEGATIVE_VALUE) @@ -1506,13 +1437,13 @@ void serializeRippleStateObjectWithMaxNegativeValuePlusOneThrows() throws JsonPr .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String transactionJson = objectMapper.writeValueAsString(rippleStateObject); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test public void serializeOfferCreateWithEmptyFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1525,14 +1456,14 @@ public void serializeOfferCreateWithEmptyFlags() throws JsonProcessingException .expiration(UnsignedInteger.valueOf(456)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000721FFFFFFFF2400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCreateWithZeroFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1545,14 +1476,14 @@ public void serializeOfferCreateWithZeroFlags() throws JsonProcessingException { .flags(OfferCreateFlags.of(0)) .expiration(UnsignedInteger.valueOf(456)) .build(); - + String expectedBinary = "12000722000000002400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCreateWithNonZeroFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1565,14 +1496,14 @@ public void serializeOfferCreateWithNonZeroFlags() throws JsonProcessingExceptio .flags(OfferCreateFlags.builder().tfSell(true).build()) .expiration(UnsignedInteger.valueOf(456)) .build(); - + String expectedBinary = "12000722800800002400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancel() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1582,12 +1513,12 @@ public void serializeOfferCancel() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(123)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000821FFFFFFFF2400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancelWithZeroFlags() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1597,12 +1528,12 @@ public void serializeOfferCancelWithZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(123)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000822000000002400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancelWithNonZeroFlags() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1612,12 +1543,12 @@ public void serializeOfferCancelWithNonZeroFlags() throws JsonProcessingExceptio .offerSequence(UnsignedInteger.valueOf(123)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000822800000002400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeSetRegularKey() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1627,13 +1558,13 @@ public void serializeSetRegularKey() throws JsonProcessingException { .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000521FFFFFFFF240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test public void serializeSetRegularKeyWithZeroFlags() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1643,13 +1574,13 @@ public void serializeSetRegularKeyWithZeroFlags() throws JsonProcessingException .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200052200000000240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test public void serializeSetRegularKeyWithNonZeroFlags() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1659,13 +1590,13 @@ public void serializeSetRegularKeyWithNonZeroFlags() throws JsonProcessingExcept .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200052280000000240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test void serializeSignerListSet() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1695,14 +1626,14 @@ void serializeSignerListSet() throws JsonProcessingException { ) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000C21FFFFFFFF240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeSignerListSetWithZeroFlags() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1732,14 +1663,14 @@ void serializeSignerListSetWithZeroFlags() throws JsonProcessingException { ) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000C2200000000240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeSignerListSetWithNonZeroFlags() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1769,14 +1700,14 @@ void serializeSignerListSetWithNonZeroFlags() throws JsonProcessingException { ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000C2280000000240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeXChainAccountCreateCommitTest() throws JsonProcessingException { XChainAccountCreateCommit commit = XChainAccountCreateCommit.builder() @@ -1807,17 +1738,17 @@ void serializeXChainAccountCreateCommitTest() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "12002C228000000024000000016140000000000F424068400000000000000A601D4000000000002" + "71073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402202984DDE7F0B566F0" + "81F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B" + "8123CD2C9F5CF188114B5F762798A53D543A014CAF8B297CFF8F2F937E88314AF80285F637EE4AF3C20378F9DFB12511ACB8D" + "27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E" + "785DC231A1058A05E56E3F09CF4E60000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C"; - + assertSerializesAndDeserializes(commit, expectedBinary); } - + @Test void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException { XChainAddAccountCreateAttestation attestation = XChainAddAccountCreateAttestation.builder() @@ -1856,7 +1787,7 @@ void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException "2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F4205800") ) .build(); - + String expectedBinary = "12002E2400000005201B0000000D3015FFFFFFFFFFFFFFFF61400000000098968068400000000000001" + "4601D40000000000000647121ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC27321EDF54108BA" + "2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1744003E74AEF1F585F156786429D2FC87A89E5C6B5A56D68B" + @@ -1866,10 +1797,10 @@ void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException "9A79DEA67CB5D585111FEF0A29203FA0408014145E7A3E3D7200A794FA801C66CE3775B6416EE4128015145E7A3E3D7200A794FA8" + "01C66CE3775B6416EE4120010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000" + "000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(attestation, expectedBinary); } - + @Test void serializeXChainAddClaimAttestation() throws JsonProcessingException { XChainAddClaimAttestation attestation = XChainAddClaimAttestation.builder() @@ -1907,7 +1838,7 @@ void serializeXChainAddClaimAttestation() throws JsonProcessingException { "741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF04") ) .build(); - + String expectedBinary = "12002D2400000009201B000000133014FFFFFFFFFFFFFFFF614000000000989680684000000000000014" + "7121ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E11367321ED0406B134786FE0751717226657F7BF" + "8AFE96442C05D28ACEC66FB64852BA604C7440D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8" + @@ -1917,10 +1848,10 @@ void serializeXChainAddClaimAttestation() throws JsonProcessingException { "203FA0408014141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598015141F30A4D728AB98B0950EC3B9815E6C8D43A7D559001013" + "0101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543" + "A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(attestation, expectedBinary); } - + @Test void serializeXChainClaim() throws JsonProcessingException { XChainClaim claim = XChainClaim.builder() @@ -1947,17 +1878,17 @@ void serializeXChainClaim() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "12002B228000000024000000013014FFFFFFFFFFFFFFFF61400000000000271068400000000000000A" + "73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220445F7469FDA401787D9EE8" + "A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72C" + "ED142E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88314550FC62003E785DC231A1058A05E56E3F09CF4E6011914AF80" + "285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05" + "E56E3F09CF4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializeXChainCommit() throws JsonProcessingException { XChainCommit commit = XChainCommit.builder() @@ -1983,17 +1914,17 @@ void serializeXChainCommit() throws JsonProcessingException { "B13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE") ) .build(); - + String expectedBinary = "12002A228000000024000000013014FFFFFFFFFFFFFFFF6140000000000027106840000000000000" + "0A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074453043021F177323F0D93612C82A" + "4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06E" + "E9B12BBFFE8114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D2700" + "0000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000" + "000000000000000000"; - + assertSerializesAndDeserializes(commit, expectedBinary); } - + @Test void serializeXChainCreateBridge() throws JsonProcessingException { XChainCreateBridge createBridge = XChainCreateBridge.builder() @@ -2019,17 +1950,17 @@ void serializeXChainCreateBridge() throws JsonProcessingException { ) .flags(TransactionFlags.UNSET) .build(); - + String binary = "1200302200000000240000000168400000000000000A601D40000000000003E8601E40000000000027" + "1073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220101BCA4B5B5A" + "37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980F" + "F86FE4269E369F6FC7A270918114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C2037" + "8F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09C" + "F4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(createBridge, binary); } - + @Test void serializeXChainCreateClaimId() throws JsonProcessingException { XChainCreateClaimId claimId = XChainCreateClaimId.builder() @@ -2055,17 +1986,17 @@ void serializeXChainCreateClaimId() throws JsonProcessingException { "15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD") ) .build(); - + String binary = "1200292280000000240000000168400000000000000A601D400000000000271073210330E7FC9D56BB25D68" + "93BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868" + "DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD8114B5F7627" + "98A53D543A014CAF8B297CFF8F2F937E8801214AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF" + "3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F0" + "9CF4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(claimId, binary); } - + @Test void serializeXChainModifyBridge() throws JsonProcessingException { XChainModifyBridge transaction = XChainModifyBridge.builder() @@ -2091,17 +2022,17 @@ void serializeXChainModifyBridge() throws JsonProcessingException { "4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E5") ) .build(); - + String binary = "12002F2200000000240000000168400000000000000A601D40000000000003E8601E40000000000027107" + "3210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100D2CABC1B0E0635A8E" + "E2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D" + "30B8750BA4805E58114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511AC" + "B8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000" + "000000000000000000000000000"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidSet() throws JsonProcessingException { DidSet transaction = DidSet.builder() @@ -2120,15 +2051,15 @@ void serializeDidSet() throws JsonProcessingException { .data(DidData.of("617474657374")) .uri(DidUri.of("6469645F6578616D706C65")) .build(); - + String binary = "1200312280000000240000000368400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F227" + "958D5C0C111CC7CF947FC5A933477440AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD77299932566" + "7A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C08750B6469645F6578616D706C65701A03646F6370" + "1B06617474657374811401476926B590BA3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidSetWithEmptyValues() throws JsonProcessingException { DidSet transaction = DidSet.builder() @@ -2147,15 +2078,15 @@ void serializeDidSetWithEmptyValues() throws JsonProcessingException { .data(DidData.of("")) .uri(DidUri.of("")) .build(); - + String binary = "1200312280000000240000000368400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F2" + "27958D5C0C111CC7CF947FC5A933477440AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD7729993" + "25667A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C087500701A00701B00811401476926B590BA" + "3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidDelete() throws JsonProcessingException { DidDelete transaction = DidDelete.builder() @@ -2171,14 +2102,14 @@ void serializeDidDelete() throws JsonProcessingException { ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String binary = "1200322280000000240000000468400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F22" + "7958D5C0C111CC7CF947FC5A93347744071E28B12465A1B47162C22E121DF61089DCD9AAF5773704B76179E771666886C8AA" + "D5A33A87E34CC381A7D924E3FE3645F0BF98D565DE42C81E1A7A7E7981802811401476926B590BA3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeOracleSet() throws JsonProcessingException { OracleSet oracleSet = OracleSet.builder() @@ -2238,7 +2169,7 @@ void serializeOracleSet() throws JsonProcessingException { "B40B4101F62264C280C3C9A492B3FF01DCF4AE0CEF12BB6FB2E4EB681B9B81D710A") ) .build(); - + String expectedBinary = "12003324001ECFA62F6644CDA420330000000368400000000000000A7321EDA6501D3E53D47" + "F10AE37A0C6B34194CF8A205DE9611FE81B63E7B62105E90EAC744007205F518BC5D1D4F67E33101F140F692796706278" + "25CDFA4BECDFE7C1D38B40B4101F62264C280C3C9A492B3FF01DCF4AE0CEF12BB6FB2E4EB681B9B81D710A701C0863757" + @@ -2252,7 +2183,7 @@ void serializeOracleSet() throws JsonProcessingException { "0000000004D59520000000000E1F1"; assertSerializesAndDeserializes(oracleSet, expectedBinary); } - + @Test void serializeOracleDelete() throws JsonProcessingException { OracleDelete oracleDelete = OracleDelete.builder() @@ -2267,10 +2198,10 @@ void serializeOracleDelete() throws JsonProcessingException { .build(); String expectedBinary = "120034240000000A201B0000001120330000000168400000000000000F7321ED6884529" + "D21E8059F689827F5BF2AD5CBC138A3427A04C12B004C9BE9BBB22A7781141AFFBE9553C7325305491B100D02E6BED8CE6BA5"; - + assertSerializesAndDeserializes(oracleDelete, expectedBinary); } - + @Test void serializeAmmWithdraw() throws JsonProcessingException { AmmWithdraw ammWithdraw = AmmWithdraw.builder() @@ -2320,7 +2251,7 @@ void serializeAmmWithdraw() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "1200252200010000240000000161D5071AFD498D00000000000000000000000000004C50540000" + "000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D0000000000000000000000" + "0000004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5601AD5071AFD498D0000000000000000000000" + @@ -2331,7 +2262,7 @@ void serializeAmmWithdraw() throws JsonProcessingException { "0000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; assertSerializesAndDeserializes(ammWithdraw, expectedBinary); } - + @Test void serializeAmmBid() throws JsonProcessingException { AmmBid ammBid = AmmBid.builder() @@ -2368,17 +2299,17 @@ void serializeAmmBid() throws JsonProcessingException { AuthAccountWrapper.of(AuthAccount.of(Address.of("rPZtDb6ZHtfYzMmzyUGvehoi2vYhrNAPhy"))) ) .build(); - + String expectedBinary = "120027240000000168400000000000000A6CD5071AFD498D00000000000000000000000000004C5" + "0540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C56DD5071AFD498D00000000000000000000000000004C5054" + "0000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5732102B4A8F64B97151FA303F86417751B7EA5AF1D0014FCC11" + "0C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271F019E01B8114F78AD4FDA66653106AE45EE5FE" + "683C457E6BA9C5E1F103184755534400000000000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9" + "C50418524C555344000000000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammBid, expectedBinary); } - + @Test void serializeAmmCreate() throws JsonProcessingException { AmmCreate ammCreate = AmmCreate.builder() @@ -2404,15 +2335,15 @@ void serializeAmmCreate() throws JsonProcessingException { ) .tradingFee(TradingFee.of(UnsignedInteger.ONE)) .build(); - + String expectedBinary = "120023150001240000000161D5071AFD498D00000000000000000000000000004C505400000000" + "00F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D00000000000000000000000000" + "004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5732102B4A8F64B97151FA303F86417751B7EA5AF1D" + "0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271"; - + assertSerializesAndDeserializes(ammCreate, expectedBinary); } - + @Test void serializeAmmDelete() throws JsonProcessingException { AmmDelete ammDelete = AmmDelete.builder() @@ -2433,15 +2364,15 @@ void serializeAmmDelete() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "120028240000000168400000000000000A732102B4A8F64B97151FA303F86417751B7EA5AF1" + "D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000000000" + "00000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C5553440000000000000000000000" + "00000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammDelete, expectedBinary); } - + @Test void serializeAmmDeposit() throws JsonProcessingException { AmmDeposit ammDeposit = AmmDeposit.builder() @@ -2492,7 +2423,7 @@ void serializeAmmDeposit() throws JsonProcessingException { ) .tradingFee(TradingFee.ofPercent(BigDecimal.ONE)) .build(); - + String expectedBinary = "1200241503E82200080000240000000161D5071AFD498D00000000000000000000000000004C50" + "540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D0000000000000000" + "0000000000004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C56019D5071AFD498D0000000000000000" + @@ -2501,10 +2432,10 @@ void serializeAmmDeposit() throws JsonProcessingException { "1B7EA5AF1D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000" + "00000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C55534400000000000000000000" + "0000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammDeposit, expectedBinary); } - + @Test void serializeAmmVote() throws JsonProcessingException { AmmVote ammVote = AmmVote.builder() @@ -2526,15 +2457,15 @@ void serializeAmmVote() throws JsonProcessingException { ) .tradingFee(TradingFee.ofPercent(BigDecimal.ONE)) .build(); - + String expectedBinary = "1200261503E8240000000168400000000000000A732102B4A8F64B97151FA303F86417751B7" + "EA5AF1D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000" + "00000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C55534400000000000000000" + "0000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammVote, expectedBinary); } - + private void assertSerializesAndDeserializes( T transaction, String expectedBinary @@ -2542,7 +2473,7 @@ private void assertSerializesAndDeserializes( String transactionJson = objectMapper.writeValueAsString(transaction); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); T deserialized = objectMapper.readValue( decodedBinary, @@ -2550,5 +2481,5 @@ private void assertSerializesAndDeserializes( ); assertThat(deserialized).isEqualTo(transaction); } - + } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/AbstractJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/AbstractJsonTest.java index 6ec181716..a3be5c6ae 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/AbstractJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/AbstractJsonTest.java @@ -23,7 +23,6 @@ import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import org.json.JSONException; import org.junit.jupiter.api.BeforeEach; @@ -38,7 +37,7 @@ import org.xrpl.xrpl4j.model.ledger.LedgerObject; import org.xrpl.xrpl4j.model.transactions.Transaction; -public class AbstractJsonTest { +public abstract class AbstractJsonTest { protected Logger logger = LoggerFactory.getLogger(this.getClass()); protected ObjectMapper objectMapper; diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOfferTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOfferTest.java index 6f371d173..ceb51e6ba 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOfferTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOfferTest.java @@ -55,7 +55,7 @@ public void throwWhenNoOfferIsPresent() { .fee(XrpCurrencyAmount.ofDrops(100)) .build()) .isInstanceOf(IllegalStateException.class) - .hasMessage("PLease specify one offer for direct mode and both offers for brokered mode."); + .hasMessage("Please specify one offer for direct mode and both offers for brokered mode."); } @Test diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java new file mode 100644 index 000000000..98b60e7c0 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java @@ -0,0 +1,155 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import static org.assertj.core.api.Assertions.assertThat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.model.AbstractJsonTest; +import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.TransactionType; + +import java.util.Objects; + +/** + * An abstract class that helps test various flavors of serialization and deserialization for implementations of {@link Transaction}. + * + * @param The type of Immutable this class will test. + * @param The type of Immutable Builder this class will test. + * @param The type of {@link Transaction} this class will test. + */ +public abstract class AbstractTransactionJsonTest extends AbstractJsonTest { + + private final Class interfaceClass; + private final Class immutableClass; + private final TransactionType expectedTransactionType; + + /** + * Required-args Constructor. + * + * @param interfaceClass A class of type {@link T} that for the Immutables intefarce. + * @param immutableClass A class of type {@link IM} that for the Immutables implementation. + * @param expectedTransactionType A {@link TransactionType} representing the expected transaction type. + */ + protected AbstractTransactionJsonTest( + final Class interfaceClass, + final Class immutableClass, + final TransactionType expectedTransactionType + ) { + this.interfaceClass = Objects.requireNonNull(interfaceClass); + this.immutableClass = Objects.requireNonNull(immutableClass); + this.expectedTransactionType = expectedTransactionType; + } + + /** + * Construct and return a builder for the Immutable object of type {@link B}. + * + * @return An instance of {@link B}. + */ + protected abstract B builder(); + + /** + * Construct and return a fully-populated transaction of type {@link T}. + * + * @return An instance of {@link T}. + */ + protected abstract T fullyPopulatedTransaction(); + + /** + * Construct and return a fully-populated transaction of the proper type that includes some unknown fields. + * + * @return An instance of {@link T}. + */ + protected abstract T fullyPopulatedTransactionWithUnknownFields(); + + /** + * Helper for populating unknown fields into a Transaction. + * + * @param + */ + interface UnknownFieldPutter { + B putUnknownFields(String key, Object value); + } + + /** + * Helper for building from an unknown builder. + * + * @param + */ + interface Builder { + T build(); + } + + /** + * Construct and return a minimally-populated transaction of type {@link T}. + * + * @return An instance of {@link T}. + */ + protected abstract T minimallyPopulatedTransaction(); + + @Test + void testTransactionType() { + assertThat(fullyPopulatedTransaction().transactionType()).isEqualTo(expectedTransactionType); + assertThat(fullyPopulatedTransactionWithUnknownFields().transactionType()).isEqualTo(expectedTransactionType); + assertThat(minimallyPopulatedTransaction().transactionType()).isEqualTo(expectedTransactionType); + } + + @Test + public void assertCanDeserializeAllTypesFullyPopulated() throws JsonProcessingException { + T expectedObject = fullyPopulatedTransaction(); + String serialized = objectMapper.writeValueAsString(expectedObject); + + Transaction deserializedTransaction = objectMapper.readValue(serialized, Transaction.class); + assertThat(deserializedTransaction).isEqualTo(expectedObject); + T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); + assertThat(deserializedInterface).isEqualTo(expectedObject); + IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + assertThat(deserializedImmutable).isEqualTo(expectedObject); + } + + @Test + public void assertCanDeserializeAllTypesFullyPopulatedWithUnknownFields() throws JsonProcessingException { + T expectedObject = fullyPopulatedTransactionWithUnknownFields(); + String serialized = objectMapper.writeValueAsString(expectedObject); + + Transaction deserializedTransaction = objectMapper.readValue(serialized, Transaction.class); + assertThat(deserializedTransaction).isEqualTo(expectedObject); + T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); + assertThat(deserializedInterface).isEqualTo(expectedObject); + IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + assertThat(deserializedImmutable).isEqualTo(expectedObject); + } + + @Test + public void assertCanDeserializeAllTypesWithMinimallyPopulated() throws JsonProcessingException { + T expectedObject = minimallyPopulatedTransaction(); + String serialized = objectMapper.writeValueAsString(expectedObject); + + Transaction deserializedTransaction = objectMapper.readValue(serialized, Transaction.class); + assertThat(deserializedTransaction).isEqualTo(expectedObject); + T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); + assertThat(deserializedInterface).isEqualTo(expectedObject); + IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + assertThat(deserializedImmutable).isEqualTo(expectedObject); + } + +} \ No newline at end of file diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java index 674bb6f2e..3425963d2 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,18 +25,32 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.AccountDelete; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableAccountDelete; import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class AccountDeleteJsonTests extends AbstractJsonTest { +public class AccountDeleteJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testJson() throws JsonProcessingException, JSONException { - AccountDelete accountDelete = AccountDelete.builder() + /** + * No-args Constructor + */ + protected AccountDeleteJsonTests() { + super(AccountDelete.class, ImmutableAccountDelete.class, TransactionType.ACCOUNT_DELETE); + } + + @Override + protected ImmutableAccountDelete.Builder builder() { + return AccountDelete.builder(); + } + + @Override + protected AccountDelete fullyPopulatedTransaction() { + return AccountDelete.builder() .account(Address.of("rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm")) .fee(XrpCurrencyAmount.ofDrops(5000000)) .sequence(UnsignedInteger.valueOf(2470665)) @@ -45,106 +59,147 @@ public void testJson() throws JsonProcessingException, JSONException { .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .flags(TransactionFlags.UNSET) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; - - assertCanSerializeAndDeserialize(accountDelete, json); + @Override + protected AccountDelete fullyPopulatedTransactionWithUnknownFields() { + return AccountDelete.builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - AccountDelete accountDelete = AccountDelete.builder() + @Override + protected AccountDelete minimallyPopulatedTransaction() { + return AccountDelete.builder() .account(Address.of("rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm")) .fee(XrpCurrencyAmount.ofDrops(5000000)) - .sequence(UnsignedInteger.valueOf(2470665)) .destination(Address.of("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe")) - .destinationTag(UnsignedInteger.valueOf(13)) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + public void testFullyPopulatedJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + this.assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + + @Test + public void testFullyPopulatedWithUnknownFieldsJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + this.assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + + @Test + public void testMinimallyPopulatedJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"Fee\": \"5000000\",\n" + + " \"Sequence\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + this.assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + + @Test + public void testJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + AccountDelete fullyPopulatedAccountDelete = AccountDelete.builder() + .from(fullyPopulatedTransactionWithUnknownFields()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": 0,\n" + - " \"Sequence\": 2470665,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(accountDelete, json); + assertCanSerializeAndDeserialize(fullyPopulatedAccountDelete, json); } @Test public void testJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - AccountDelete accountDelete = AccountDelete.builder() - .account(Address.of("rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm")) - .fee(XrpCurrencyAmount.ofDrops(5000000)) - .sequence(UnsignedInteger.valueOf(2470665)) - .destination(Address.of("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe")) - .destinationTag(UnsignedInteger.valueOf(13)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + + AccountDelete fullyPopulatedTransaction = AccountDelete.builder() + .from(fullyPopulatedTransactionWithUnknownFields()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": %s,\n" + - " \"Sequence\": 2470665,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = String.format( + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": %s,\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 2470665,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - assertCanSerializeAndDeserialize(accountDelete, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransaction, json); } @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - AccountDelete accountDelete = AccountDelete.builder() - .account(Address.of("rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm")) - .fee(XrpCurrencyAmount.ofDrops(5000000)) - .sequence(UnsignedInteger.valueOf(2470665)) - .destination(Address.of("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe")) - .destinationTag(UnsignedInteger.valueOf(13)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Flags\": 0,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(accountDelete, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java index 25f16a2b1..c98e6b158 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,26 +26,40 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.crypto.signing.Signature; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.AccountSetTransactionFlags; import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.transactions.AccountDelete; import org.xrpl.xrpl4j.model.transactions.AccountSet; import org.xrpl.xrpl4j.model.transactions.AccountSet.AccountSetFlag; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableAccountSet; import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class AccountSetJsonTests extends AbstractJsonTest { +import java.util.Optional; - @Test - public void fullyPopulatedAccountSet() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() +public class AccountSetJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected AccountSetJsonTests() { + super(AccountSet.class, ImmutableAccountSet.class, TransactionType.ACCOUNT_SET); + } + + @Override + protected ImmutableAccountSet.Builder builder() { + return ImmutableAccountSet.builder(); + } + + @Override + protected AccountSet fullyPopulatedTransaction() { + return AccountSet.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) .domain("6578616D706C652E636F6D") + .sequence(UnsignedInteger.valueOf(5)) .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) .messageKey("03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB") .transferRate(UnsignedInteger.valueOf(1000000001)) @@ -61,105 +75,124 @@ public void fullyPopulatedAccountSet() throws JSONException, JsonProcessingExcep .walletLocator("ABCD") .walletSize(UnsignedInteger.ONE) .build(); + } - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Flags\":2147483648,\n" + - " \"Domain\":\"6578616D706C652E636F6D\",\n" + - " \"SetFlag\":5,\n" + - " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"NetworkID\": 1024,\n" + - " \"WalletSize\": 1,\n" + - " \"WalletLocator\": \"ABCD\",\n" + - " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + - "}"; - - assertCanSerializeAndDeserialize(accountSet, json); + @Override + protected AccountSet fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void accountSetWithEmptyOptionalStringFields() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() + @Override + protected AccountSet minimallyPopulatedTransaction() { + return AccountSet.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) - .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) - .clearFlag(AccountSetFlag.DEFAULT_RIPPLE) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) - .flags(AccountSetTransactionFlags.of(TransactionFlags.FULLY_CANONICAL_SIG.getValue())) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Flags\":2147483648,\n" + - " \"SetFlag\":5,\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"NetworkID\": 1024\n" + + @Test + public void fullyPopulatedAccountSet() throws JSONException, JsonProcessingException { + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Flags\":2147483648,\n" + + " \"Domain\":\"6578616D706C652E636F6D\",\n" + + " \"SetFlag\":5,\n" + + " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"NetworkID\": 1024,\n" + + " \"WalletSize\": 1,\n" + + " \"WalletLocator\": \"ABCD\",\n" + + " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + "}"; - assertCanSerializeAndDeserialize(accountSet, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void minimallyPopulatedAccountSet() throws JSONException, JsonProcessingException { + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + + @Test + public void accountSetWithEmptyOptionalStringFields() throws JSONException, JsonProcessingException { + AccountSet fullyPopulatedAccountSet = AccountSet.builder().from(fullyPopulatedTransaction()) + .emailHash(Optional.empty()) + .domain(Optional.empty()) + .walletLocator(Optional.empty()) + .walletSize(Optional.empty()) + .messageKey(Optional.empty()) + .build(); + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Flags\":2147483648,\n" + + " \"SetFlag\":5,\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"NetworkID\": 1024\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedAccountSet, json); } @Test public void accountSetWithEmptyStringFields() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) + AccountSet accountSet = builder().from(fullyPopulatedTransaction()) .domain("") .messageKey("") .emailHash(Strings.repeat("0", 32)) .walletLocator(Strings.repeat("0", 64)) - .sequence(UnsignedInteger.valueOf(5)) - .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) - .clearFlag(AccountSetFlag.DEFAULT_RIPPLE) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(AccountSetTransactionFlags.of(TransactionFlags.FULLY_CANONICAL_SIG.getValue())) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .networkId(NetworkId.of(1024)) + .walletSize(Optional.empty()) .build(); - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Flags\":2147483648,\n" + - " \"Domain\":\"\",\n" + - " \"SetFlag\":5,\n" + - " \"MessageKey\":\"\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"WalletLocator\" : \"" + Strings.repeat("0", 64) + "\",\n" + - " \"EmailHash\" : \"" + Strings.repeat("0", 32) + "\",\n" + - " \"NetworkID\": 1024\n" + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Flags\":2147483648,\n" + + " \"Domain\":\"\",\n" + + " \"SetFlag\":5,\n" + + " \"MessageKey\":\"\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"WalletLocator\" : \"" + Strings.repeat("0", 64) + "\",\n" + + " \"EmailHash\" : \"" + Strings.repeat("0", 32) + "\",\n" + + " \"NetworkID\": 1024\n" + "}"; assertCanSerializeAndDeserialize(accountSet, json); @@ -167,39 +200,30 @@ public void accountSetWithEmptyStringFields() throws JSONException, JsonProcessi @Test public void testJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) - .domain("6578616D706C652E636F6D") - .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) - .messageKey("03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB") - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) - .clearFlag(AccountSetFlag.DEFAULT_RIPPLE) - .emailHash(Strings.repeat("0", 32)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + AccountSet accountSet = builder().from(fullyPopulatedTransaction()) .flags(AccountSetTransactionFlags.of(0)) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .emailHash(Strings.repeat("0", 32)) + .networkId(Optional.empty()) + .walletLocator(Optional.empty()) + .walletSize(Optional.empty()) .build(); - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Flags\":0,\n" + - " \"Domain\":\"6578616D706C652E636F6D\",\n" + - " \"SetFlag\":5,\n" + - " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"EmailHash\":\"" + Strings.repeat("0", 32) + "\"\n" + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Flags\":0,\n" + + " \"Domain\":\"6578616D706C652E636F6D\",\n" + + " \"SetFlag\":5,\n" + + " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"EmailHash\":\"" + Strings.repeat("0", 32) + "\"\n" + "}"; assertCanSerializeAndDeserialize(accountSet, json); @@ -207,37 +231,30 @@ public void testJsonWithUnsetFlags() throws JsonProcessingException, JSONExcepti @Test public void testJsonWithEmptyFlags() throws JsonProcessingException, JSONException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) - .domain("6578616D706C652E636F6D") - .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) - .messageKey("03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB") - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) - .clearFlag(AccountSetFlag.DEFAULT_RIPPLE) - .emailHash("f9879d71855b5ff21e4963273a886bfc") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + AccountSet accountSet = builder().from(fullyPopulatedTransaction()) + .clearFlag(Optional.empty()) + .setFlagRawValue(Optional.empty()) + .flags(AccountSetTransactionFlags.empty()) + .networkId(Optional.empty()) + .walletLocator(Optional.empty()) + .walletSize(Optional.empty()) .build(); - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Domain\":\"6578616D706C652E636F6D\",\n" + - " \"SetFlag\":5,\n" + - " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Domain\":\"6578616D706C652E636F6D\",\n" + + " \"SetFlag\":5,\n" + + " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + "}"; assertCanSerializeAndDeserialize(accountSet, json); @@ -245,37 +262,32 @@ public void testJsonWithEmptyFlags() throws JsonProcessingException, JSONExcepti @Test void testJsonWithZeroClearFlagAndSetFlag() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) - .domain("6578616D706C652E636F6D") + AccountSet accountSet = builder().from(fullyPopulatedTransaction()) .setFlag(AccountSetFlag.NONE) - .messageKey("03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB") - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) + .setFlagRawValue(Optional.empty()) .clearFlag(AccountSetFlag.NONE) - .emailHash("f9879d71855b5ff21e4963273a886bfc") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .clearFlagRawValue(Optional.empty()) + .flags(AccountSetTransactionFlags.empty()) + .networkId(Optional.empty()) + .walletLocator(Optional.empty()) + .walletSize(Optional.empty()) .build(); - String json = "{\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Domain\":\"6578616D706C652E636F6D\",\n" + - " \"SetFlag\":0,\n" + - " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + + String json = + "{\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Domain\":\"6578616D706C652E636F6D\",\n" + + " \"SetFlag\":0,\n" + + " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + "}"; assertCanSerializeAndDeserialize(accountSet, json); @@ -283,29 +295,22 @@ void testJsonWithZeroClearFlagAndSetFlag() throws JSONException, JsonProcessingE @Test void testJsonWithUnrecognizedClearAndSetFlag() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rhyg7sn3ZQj9aja9CBuLETFKdkG9Fte7ck")) - .fee(XrpCurrencyAmount.ofDrops(15)) - .sequence(UnsignedInteger.valueOf(40232131)) + AccountSet accountSet = builder().from(minimallyPopulatedTransaction()) + .setFlag(Optional.empty()) .setFlagRawValue(UnsignedInteger.valueOf(4294967295L)) + .clearFlag(Optional.empty()) .clearFlagRawValue(UnsignedInteger.valueOf(4294967295L)) - .signingPublicKey(PublicKey.fromBase16EncodedPublicKey( - "ED03FCED79BB3699089BC3F0F57BBD9F9ABA4772C20EC14BFAE908B4299344194A" - )) - .transactionSignature(Signature.fromBase16("8D0915449FB617234DD54E1BA79136B50C4439696BB4287F" + - "CA25717F3FD4875D5A1FEE6269B91D71D9306B48DECAAE1F1C91CAD1AAD0E0D683DC11E68212740E")) .build(); - String json = "{\n" + - " \"Account\": \"rhyg7sn3ZQj9aja9CBuLETFKdkG9Fte7ck\",\n" + - " \"Fee\": \"15\",\n" + - " \"Sequence\": 40232131,\n" + - " \"SetFlag\": 4294967295,\n" + - " \"ClearFlag\": 4294967295,\n" + - " \"SigningPubKey\": \"ED03FCED79BB3699089BC3F0F57BBD9F9ABA4772C20EC14BFAE908B4299344194A\",\n" + - " \"TransactionType\": \"AccountSet\",\n" + - " \"TxnSignature\": \"8D0915449FB617234DD54E1BA79136B50C4439696BB4287FCA25717F3FD4875D5A1FEE6269B" + - "91D71D9306B48DECAAE1F1C91CAD1AAD0E0D683DC11E68212740E\"" + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"SetFlag\": 4294967295,\n" + + " \"ClearFlag\": 4294967295,\n" + + " \"SigningPubKey\": \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"AccountSet\"\n" + "}"; assertCanSerializeAndDeserialize(accountSet, json); @@ -313,49 +318,28 @@ void testJsonWithUnrecognizedClearAndSetFlag() throws JSONException, JsonProcess @Test public void testJsonWithUnknownFields() throws JSONException, JsonProcessingException { - AccountSet accountSet = AccountSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(5)) - .domain("6578616D706C652E636F6D") - .setFlag(AccountSetFlag.ACCOUNT_TXN_ID) - .messageKey("03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB") - .transferRate(UnsignedInteger.valueOf(1000000001)) - .tickSize(UnsignedInteger.valueOf(15)) - .clearFlag(AccountSetFlag.DEFAULT_RIPPLE) - .emailHash("f9879d71855b5ff21e4963273a886bfc") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(AccountSetTransactionFlags.of(TransactionFlags.FULLY_CANONICAL_SIG.getValue())) - .mintAccount(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .networkId(NetworkId.of(1024)) - .walletLocator("ABCD") - .walletSize(UnsignedInteger.ONE) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\":\"AccountSet\",\n" + - " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\":\"12\",\n" + - " \"Sequence\":5,\n" + - " \"Flags\":2147483648,\n" + - " \"Domain\":\"6578616D706C652E636F6D\",\n" + - " \"SetFlag\":5,\n" + - " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + - " \"TransferRate\":1000000001,\n" + - " \"TickSize\":15,\n" + - " \"ClearFlag\":8,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"NetworkID\": 1024,\n" + - " \"WalletSize\": 1,\n" + - " \"WalletLocator\": \"ABCD\",\n" + - " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\":\"AccountSet\",\n" + + " \"Account\":\"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\":\"12\",\n" + + " \"Sequence\":5,\n" + + " \"Flags\":2147483648,\n" + + " \"Domain\":\"6578616D706C652E636F6D\",\n" + + " \"SetFlag\":5,\n" + + " \"MessageKey\":\"03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB\",\n" + + " \"TransferRate\":1000000001,\n" + + " \"TickSize\":15,\n" + + " \"ClearFlag\":8,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenMinter\" : \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"NetworkID\": 1024,\n" + + " \"WalletSize\": 1,\n" + + " \"WalletLocator\": \"ABCD\",\n" + + " \"EmailHash\":\"f9879d71855b5ff21e4963273a886bfc\"\n" + "}"; - assertCanSerializeAndDeserialize(accountSet, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java new file mode 100644 index 000000000..c64f89890 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java @@ -0,0 +1,185 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.CheckCancel; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableCheckCancel; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class CheckCancelJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected CheckCancelJsonTests() { + super(CheckCancel.class, ImmutableCheckCancel.class, TransactionType.CHECK_CANCEL); + } + + @Override + protected ImmutableCheckCancel.Builder builder() { + return ImmutableCheckCancel.builder(); + } + + @Override + protected CheckCancel fullyPopulatedTransaction() { + return CheckCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) + .sequence(UnsignedInteger.valueOf(12)) + .fee(XrpCurrencyAmount.ofDrops(12)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected CheckCancel fullyPopulatedTransactionWithUnknownFields() { + return CheckCancel.builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected CheckCancel minimallyPopulatedTransaction() { + return CheckCancel.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) + .sequence(UnsignedInteger.valueOf(5)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testFullyPopulatedCheckCancelJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"CheckCancel\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Flags\": 0,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + + @Test + public void testCheckCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + CheckCancel fullyPopulatedTransaction = CheckCancel.builder().from(fullyPopulatedTransactionWithUnknownFields()) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"CheckCancel\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Flags\": 0,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction, json); + } + + @Test + public void testCheckCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + CheckCancel fullyPopulatedTransaction = CheckCancel.builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"CheckCancel\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction, json); + } + + @Test + public void testCheckCancelJsonWithEmptyFlags() throws JsonProcessingException, JSONException { + CheckCancel fullyPopulatedTransaction = CheckCancel.builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.EMPTY) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"CheckCancel\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction, json); + } + + @Test + public void testCheckCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Flags\": 0,\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"CheckCancel\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java new file mode 100644 index 000000000..01e665d5c --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java @@ -0,0 +1,198 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.CheckCash; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableCheckCash; +import org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class CheckCashJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected CheckCashJsonTests() { + super(CheckCash.class, ImmutableCheckCash.class, TransactionType.CHECK_CASH); + } + + @Override + protected ImmutableCheckCash.Builder builder() { + return ImmutableCheckCash.builder(); + } + + @Override + protected CheckCash fullyPopulatedTransaction() { + return builder() + .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .amount(XrpCurrencyAmount.ofDrops(100)) + .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) + .sequence(UnsignedInteger.valueOf(1)) + .fee(XrpCurrencyAmount.ofDrops(12)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected CheckCash fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected CheckCash minimallyPopulatedTransaction() { + return builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) + .deliverMin(IssuedCurrencyAmount.builder() + .currency("USD") + .value("10") + .issuer(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo") + ).build()) + .fee(XrpCurrencyAmount.ofDrops(12)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testCheckCashJsonWithDeliverMin() throws JsonProcessingException, JSONException { + CheckCash checkCash = builder().from(minimallyPopulatedTransaction()) + .deliverMin(XrpCurrencyAmount.ofDrops(100)) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"DeliverMin\": \"100\",\n" + + " \"TransactionType\": \"CheckCash\",\n" + + " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 0,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCash, json); + } + + @Test + public void testCheckCashJsonWithAmount() throws JsonProcessingException, JSONException { + CheckCash checkCash = builder().from(fullyPopulatedTransactionWithUnknownFields()) + .amount(XrpCurrencyAmount.ofDrops(100)) + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"Amount\": \"100\",\n" + + " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + + " \"Flags\": 0,\n" + + " \"Fee\": \"12\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"CheckCash\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCash, json); + } + + @Test + public void testCheckCashJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + CheckCash checkCash = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"TransactionType\": \"CheckCash\",\n" + + " \"Amount\": \"100\",\n" + + " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCash, json); + } + + @Test + public void testCheckCashJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + CheckCash checkCash = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"TransactionType\": \"CheckCash\",\n" + + " \"Amount\": \"100\",\n" + + " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCash, json); + } + + @Test + public void testCheckCashJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Amount\": \"100\",\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"CheckCash\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java new file mode 100644 index 000000000..5333379c9 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java @@ -0,0 +1,221 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.CheckCreate; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableCheckCreate; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class CheckCreateJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected CheckCreateJsonTests() { + super(CheckCreate.class, ImmutableCheckCreate.class, TransactionType.CHECK_CREATE); + } + + @Override + protected ImmutableCheckCreate.Builder builder() { + return CheckCreate.builder(); + } + + @Override + protected CheckCreate fullyPopulatedTransaction() { + return builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .accountTransactionId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .destinationTag(UnsignedInteger.ONE) + .expiration(UnsignedInteger.valueOf(570113521)) + .fee(XrpCurrencyAmount.ofDrops(12)) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) + .networkId(NetworkId.of(1024)) + .sequence(UnsignedInteger.ONE) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Override + protected CheckCreate fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected CheckCreate minimallyPopulatedTransaction() { + return builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testCheckCreateJson() throws JsonProcessingException, JSONException { + CheckCreate checkCreate = CheckCreate.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.ONE) + .fee(XrpCurrencyAmount.ofDrops(12)) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .destinationTag(UnsignedInteger.ONE) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .expiration(UnsignedInteger.valueOf(570113521)) + .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + + String json = + "{\n" + + " \"TransactionType\": \"CheckCreate\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"SendMax\": \"100000000\",\n" + + " \"Expiration\": 570113521,\n" + + " \"InvoiceID\": \"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B\",\n" + + " \"DestinationTag\": 1,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCreate, json); + } + + @Test + public void testCheckCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + CheckCreate checkCreate = CheckCreate.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.ONE) + .fee(XrpCurrencyAmount.ofDrops(12)) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"TransactionType\": \"CheckCreate\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"SendMax\": \"100000000\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCreate, json); + } + + @Test + public void testCheckCreateJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + CheckCreate checkCreate = CheckCreate.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.ONE) + .fee(XrpCurrencyAmount.ofDrops(12)) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"TransactionType\": \"CheckCreate\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"SendMax\": \"100000000\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG + ",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCreate, json); + } + + @Test + public void testCheckCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { + CheckCreate checkCreate = CheckCreate.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.ONE) + .fee(XrpCurrencyAmount.ofDrops(12)) + .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .destinationTag(UnsignedInteger.ONE) + .sendMax(XrpCurrencyAmount.ofDrops(100000000)) + .expiration(UnsignedInteger.valueOf(570113521)) + .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"CheckCreate\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"SendMax\": \"100000000\",\n" + + " \"Expiration\": 570113521,\n" + + " \"InvoiceID\": \"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B\",\n" + + " \"DestinationTag\": 1,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(checkCreate, json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckJsonTests.java deleted file mode 100644 index 056979430..000000000 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckJsonTests.java +++ /dev/null @@ -1,437 +0,0 @@ -package org.xrpl.xrpl4j.model.transactions.json; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.common.primitives.UnsignedInteger; -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; -import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.transactions.Address; -import org.xrpl.xrpl4j.model.transactions.CheckCancel; -import org.xrpl.xrpl4j.model.transactions.CheckCash; -import org.xrpl.xrpl4j.model.transactions.CheckCreate; -import org.xrpl.xrpl4j.model.transactions.Hash256; -import org.xrpl.xrpl4j.model.transactions.NetworkId; -import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; - -public class CheckJsonTests extends AbstractJsonTest { - - @Test - public void testCheckCancelJson() throws JsonProcessingException, JSONException { - CheckCancel checkCancel = CheckCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) - .sequence(UnsignedInteger.valueOf(12)) - .fee(XrpCurrencyAmount.ofDrops(12)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey( "02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"CheckCancel\",\n" + - " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + - " \"Sequence\": 12,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCancel, json); - } - - @Test - public void testCheckCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - CheckCancel checkCancel = CheckCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) - .sequence(UnsignedInteger.valueOf(12)) - .fee(XrpCurrencyAmount.ofDrops(12)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey( "02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"CheckCancel\",\n" + - " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCancel, json); - } - - @Test - public void testCheckCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - CheckCancel checkCancel = CheckCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) - .sequence(UnsignedInteger.valueOf(12)) - .fee(XrpCurrencyAmount.ofDrops(12)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey( "02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"CheckCancel\",\n" + - " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(checkCancel, json); - } - - @Test - public void testCheckCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { - CheckCancel checkCancel = CheckCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .checkId(Hash256.of("49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0")) - .sequence(UnsignedInteger.valueOf(12)) - .fee(XrpCurrencyAmount.ofDrops(12)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey( "02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"CheckCancel\",\n" + - " \"CheckID\": \"49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0\",\n" + - " \"Sequence\": 12,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCancel, json); - } - - @Test - public void testCheckCashJsonWithDeliverMin() throws JsonProcessingException, JSONException { - CheckCash checkCash = CheckCash.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .deliverMin(XrpCurrencyAmount.ofDrops(100)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"CheckCash\",\n" + - " \"DeliverMin\": \"100\",\n" + - " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCash, json); - } - - @Test - public void testCheckCashJsonWithAmount() throws JsonProcessingException, JSONException { - CheckCash checkCash = CheckCash.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .amount(XrpCurrencyAmount.ofDrops(100)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .build(); - - String json = "{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"CheckCash\",\n" + - " \"Amount\": \"100\",\n" + - " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCash, json); - } - - @Test - public void testCheckCashJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - CheckCash checkCash = CheckCash.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .amount(XrpCurrencyAmount.ofDrops(100)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"CheckCash\",\n" + - " \"Amount\": \"100\",\n" + - " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCash, json); - } - - @Test - public void testCheckCashJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - CheckCash checkCash = CheckCash.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .amount(XrpCurrencyAmount.ofDrops(100)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"CheckCash\",\n" + - " \"Amount\": \"100\",\n" + - " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(checkCash, json); - } - - @Test - public void testCheckCashJsonWithUnknownFields() throws JsonProcessingException, JSONException { - CheckCash checkCash = CheckCash.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .checkId(Hash256.of("838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .deliverMin(XrpCurrencyAmount.ofDrops(100)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"CheckCash\",\n" + - " \"DeliverMin\": \"100\",\n" + - " \"CheckID\": \"838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCash, json); - } - - @Test - public void testCheckCreateJson() throws JsonProcessingException, JSONException { - CheckCreate checkCreate = CheckCreate.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .destinationTag(UnsignedInteger.ONE) - .sendMax(XrpCurrencyAmount.ofDrops(100000000)) - .expiration(UnsignedInteger.valueOf(570113521)) - .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"TransactionType\": \"CheckCreate\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"SendMax\": \"100000000\",\n" + - " \"Expiration\": 570113521,\n" + - " \"InvoiceID\": \"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B\",\n" + - " \"DestinationTag\": 1,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCreate, json); - } - - @Test - public void testMinimalCheckCreateJson() throws JsonProcessingException, JSONException { - CheckCreate checkCreate = CheckCreate.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sendMax(XrpCurrencyAmount.ofDrops(100000000)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .build(); - - String json = "{\n" + - " \"TransactionType\": \"CheckCreate\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"SendMax\": \"100000000\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCreate, json); - } - - @Test - public void testCheckCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - CheckCreate checkCreate = CheckCreate.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sendMax(XrpCurrencyAmount.ofDrops(100000000)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"TransactionType\": \"CheckCreate\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"SendMax\": \"100000000\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCreate, json); - } - - @Test - public void testCheckCreateJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - CheckCreate checkCreate = CheckCreate.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sendMax(XrpCurrencyAmount.ofDrops(100000000)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"TransactionType\": \"CheckCreate\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"SendMax\": \"100000000\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG); - - assertCanSerializeAndDeserialize(checkCreate, json); - } - - @Test - public void testCheckCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { - CheckCreate checkCreate = CheckCreate.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .destination(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .destinationTag(UnsignedInteger.ONE) - .sendMax(XrpCurrencyAmount.ofDrops(100000000)) - .expiration(UnsignedInteger.valueOf(570113521)) - .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"CheckCreate\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"Destination\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"SendMax\": \"100000000\",\n" + - " \"Expiration\": 570113521,\n" + - " \"InvoiceID\": \"6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B\",\n" + - " \"DestinationTag\": 1,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(checkCreate, json); - } -} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java index 85486ade3..7434d2cfa 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,60 +24,86 @@ import com.google.common.primitives.UnsignedInteger; import org.json.JSONException; import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; import org.xrpl.xrpl4j.model.transactions.Address; import org.xrpl.xrpl4j.model.transactions.EnableAmendment; import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableEnableAmendment; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; import java.util.Optional; -public class EnableAmendmentJsonTests extends AbstractJsonTest { +public class EnableAmendmentJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testJson() throws JsonProcessingException, JSONException { - EnableAmendment enableAmendment = EnableAmendment.builder() + /** + * No-args Constructor + */ + protected EnableAmendmentJsonTests() { + super(EnableAmendment.class, ImmutableEnableAmendment.class, TransactionType.ENABLE_AMENDMENT); + } + + + @Override + protected ImmutableEnableAmendment.Builder builder() { + return ImmutableEnableAmendment.builder(); + } + + @Override + protected EnableAmendment fullyPopulatedTransaction() { + return EnableAmendment.builder() .account(Address.of("rrrrrrrrrrrrrrrrrrrrrhoLvTp")) .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) .amendment(Hash256.of("42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE")) .ledgerSequence(Optional.of(LedgerIndex.of(UnsignedInteger.valueOf(67850752)))) .build(); + } - String json = "{" + - "\"Account\":\"rrrrrrrrrrrrrrrrrrrrrhoLvTp\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"EnableAmendment\"," + - "\"Amendment\":\"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE\"}"; - - assertCanSerializeAndDeserialize(enableAmendment, json); + @Override + protected EnableAmendment fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - EnableAmendment enableAmendment = EnableAmendment.builder() + @Override + protected EnableAmendment minimallyPopulatedTransaction() { + return EnableAmendment.builder() .account(Address.of("rrrrrrrrrrrrrrrrrrrrrhoLvTp")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(2470665)) .amendment(Hash256.of("42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE")) .ledgerSequence(Optional.of(LedgerIndex.of(UnsignedInteger.valueOf(67850752)))) - .putUnknownFields("Foo", "Bar") .build(); + } + + @Test + public void testJson() throws JsonProcessingException, JSONException { + String json = "{" + + "\"Account\":\"rrrrrrrrrrrrrrrrrrrrrhoLvTp\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"EnableAmendment\"," + + "\"Amendment\":\"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE\"}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + @Test + public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{" + - "\"Foo\" : \"Bar\",\n" + - "\"Account\":\"rrrrrrrrrrrrrrrrrrrrrhoLvTp\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"EnableAmendment\"," + - "\"Amendment\":\"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE\"}"; + "\"Foo\" : \"Bar\",\n" + + "\"Account\":\"rrrrrrrrrrrrrrrrrrrrrhoLvTp\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"EnableAmendment\"," + + "\"Amendment\":\"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE\"}"; - assertCanSerializeAndDeserialize(enableAmendment, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java new file mode 100644 index 000000000..1a6d40d0c --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java @@ -0,0 +1,136 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.EscrowCancel; +import org.xrpl.xrpl4j.model.transactions.ImmutableEscrowCancel; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class EscrowCancelJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected EscrowCancelJsonTests() { + super(EscrowCancel.class, ImmutableEscrowCancel.class, TransactionType.ESCROW_CANCEL); + } + + @Override + protected ImmutableEscrowCancel.Builder builder() { + return ImmutableEscrowCancel.builder(); + } + + @Override + protected EscrowCancel fullyPopulatedTransaction() { + return EscrowCancel.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected EscrowCancel fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected EscrowCancel minimallyPopulatedTransaction() { + return EscrowCancel.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testEscrowCancelJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCancel\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testEscrowCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCancel\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Sequence\": 1,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testEscrowCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + EscrowCancel transaction = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"EscrowCancel\"\n" + + "}"; + assertCanSerializeAndDeserialize(transaction, json); + } + + @Test + public void testEscrowCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCancel\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java new file mode 100644 index 000000000..c5ece7cdd --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java @@ -0,0 +1,270 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.io.BaseEncoding; +import com.google.common.primitives.UnsignedInteger; +import com.google.common.primitives.UnsignedLong; +import com.ripple.cryptoconditions.CryptoConditionReader; +import com.ripple.cryptoconditions.der.DerEncodingException; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.EscrowCreate; +import org.xrpl.xrpl4j.model.transactions.ImmutableEscrowCreate; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class EscrowCreateJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected EscrowCreateJsonTests() { + super(EscrowCreate.class, ImmutableEscrowCreate.class, TransactionType.ESCROW_CREATE); + } + + @Override + protected ImmutableEscrowCreate.Builder builder() { + return ImmutableEscrowCreate.builder(); + } + + @Override + protected EscrowCreate fullyPopulatedTransaction() { + try { + return EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .cancelAfter(UnsignedLong.valueOf(533257958)) + .finishAfter(UnsignedLong.valueOf(533171558)) + .condition(CryptoConditionReader.readCondition( + BaseEncoding.base16() + .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .sourceTag(UnsignedInteger.valueOf(11747)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } catch (DerEncodingException e) { + throw new RuntimeException(e); + } + } + + @Override + protected EscrowCreate fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected EscrowCreate minimallyPopulatedTransaction() { + return EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testEscrowCreateJson() throws JsonProcessingException, JSONException, DerEncodingException { + EscrowCreate escrowCreate = EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .cancelAfter(UnsignedLong.valueOf(533257958)) + .finishAfter(UnsignedLong.valueOf(533171558)) + .condition(CryptoConditionReader.readCondition( + BaseEncoding.base16() + .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .sourceTag(UnsignedInteger.valueOf(11747)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + + String json = "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowCreate, json); + } + + @Test + public void testEscrowCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException, DerEncodingException { + EscrowCreate escrowCreate = EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .cancelAfter(UnsignedLong.valueOf(533257958)) + .finishAfter(UnsignedLong.valueOf(533171558)) + .condition(CryptoConditionReader.readCondition( + BaseEncoding.base16() + .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .sourceTag(UnsignedInteger.valueOf(11747)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .build(); + + String json = "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowCreate, json); + } + + @Test + public void testEscrowCreateJsonWithNonZeroFlags() + throws JsonProcessingException, JSONException, DerEncodingException { + EscrowCreate escrowCreate = EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .cancelAfter(UnsignedLong.valueOf(533257958)) + .finishAfter(UnsignedLong.valueOf(533171558)) + .condition(CryptoConditionReader.readCondition( + BaseEncoding.base16() + .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .sourceTag(UnsignedInteger.valueOf(11747)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = String.format("{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": %s,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + + assertCanSerializeAndDeserialize(escrowCreate, json); + } + + @Test + public void testEscrowCreateJsonWithUnknownFields() + throws JsonProcessingException, JSONException, DerEncodingException { + EscrowCreate escrowCreate = EscrowCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .cancelAfter(UnsignedLong.valueOf(533257958)) + .finishAfter(UnsignedLong.valueOf(533171558)) + .condition(CryptoConditionReader.readCondition( + BaseEncoding.base16() + .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .sourceTag(UnsignedInteger.valueOf(11747)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowCreate, json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java new file mode 100644 index 000000000..91bffe59a --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java @@ -0,0 +1,289 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.io.BaseEncoding; +import com.google.common.primitives.UnsignedInteger; +import com.ripple.cryptoconditions.CryptoConditionReader; +import com.ripple.cryptoconditions.der.DerEncodingException; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.EscrowFinish; +import org.xrpl.xrpl4j.model.transactions.ImmutableEscrowFinish; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class EscrowFinishJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected EscrowFinishJsonTests() { + super(EscrowFinish.class, ImmutableEscrowFinish.class, TransactionType.ESCROW_FINISH); + } + + @Override + protected ImmutableEscrowFinish.Builder builder() { + return ImmutableEscrowFinish.builder(); + } + + @Override + protected EscrowFinish fullyPopulatedTransaction() { + try { + return EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( + "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } catch (DerEncodingException e) { + throw new RuntimeException(e); + } + } + + @Override + protected EscrowFinish fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected EscrowFinish minimallyPopulatedTransaction() { + return EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testEscrowFinishJson() throws JsonProcessingException, JSONException, DerEncodingException { + EscrowFinish escrowFinish = EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( + "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowFinish\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"Fulfillment\": \"A0028000\",\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"330\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowFinish, json); + } + + @Test + public void testEscrowFinishJsonWithUnsetFlags() throws JsonProcessingException, JSONException, DerEncodingException { + EscrowFinish escrowFinish = EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( + "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowFinish\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"Fulfillment\": \"A0028000\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"330\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowFinish, json); + } + + @Test + public void testEscrowFinishJsonWithNonZeroFlags() + throws JsonProcessingException, JSONException, DerEncodingException { + EscrowFinish escrowFinish = EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( + "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"Fee\": \"330\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"Fulfillment\": \"A0028000\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"EscrowFinish\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowFinish, json); + } + + @Test + void testEscrowFinishJsonWithMalformedCondition() throws JsonProcessingException { + String json = + "{\n" + + " \"Account\": \"rKWZ2fDqE5B9XorAcEQZD46H6HEdJQVNdb\",\n" + + " \"Condition\": \"A02580209423ED2EF4CACA8CA4AFC08D3F5EC60A545FD7A97E66E16EA0E2E2\",\n" + + " \"Fee\": \"563\",\n" + + " \"Fulfillment\": \"A02280203377850F1B3A4322F1562DF6F75D584596ABE5B9C76EEA8301F56CB942ACC69B\",\n" + + " \"LastLedgerSequence\": 40562057,\n" + + " \"OfferSequence\": 40403748,\n" + + " \"Owner\": \"r3iocgQwoGNCYyvvt8xuWv2XYXx7Z2gQqd\",\n" + + " \"Sequence\": 39899485,\n" + + " \"SigningPubKey\": \"ED09285829A011D520A1873A0E2F1014F5D6B66A6DDE6953FC02C8185EAFA6A1B0\",\n" + + " \"TransactionType\": \"EscrowFinish\",\n" + + " \"TxnSignature\": \"A3E64F6B8D1D7C4FBC9663FCD217F86C3529EC2E2F16442DD48D1B66EEE30EAC2CE960A76080F74BC749" + + "8CA7BBFB822BEE9E8F767114D7B54F7403A7CB672501\"\n" + + "}"; + + EscrowFinish escrowFinish = objectMapper.readValue(json, EscrowFinish.class); + assertThat(escrowFinish.condition()).isEmpty(); + assertThat(escrowFinish.conditionRawValue()).isNotEmpty().get() + .isEqualTo("A02580209423ED2EF4CACA8CA4AFC08D3F5EC60A545FD7A97E66E16EA0E2E2"); + } + + @Test + void testEscrowFinishJsonWithMalformedFulfillment() throws JsonProcessingException { + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowFinish\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"Fulfillment\": \"123\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"330\"\n" + + "}"; + + EscrowFinish escrowFinish = objectMapper.readValue(json, EscrowFinish.class); + assertThat(escrowFinish.fulfillment()).isEmpty(); + assertThat(escrowFinish.fulfillmentRawValue()).isNotEmpty().get() + .isEqualTo("123"); + } + + @Test + public void testEscrowFinishJsonWithUnknownFields() + throws JsonProcessingException, JSONException, DerEncodingException { + EscrowFinish escrowFinish = EscrowFinish.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(330)) + .sequence(UnsignedInteger.ONE) + .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .offerSequence(UnsignedInteger.valueOf(7)) + .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( + "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) + ) + .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowFinish\",\n" + + " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"OfferSequence\": 7,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"Fulfillment\": \"A0028000\",\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"330\"\n" + + "}"; + + assertCanSerializeAndDeserialize(escrowFinish, json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowJsonTests.java deleted file mode 100644 index c9b1b7aaa..000000000 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowJsonTests.java +++ /dev/null @@ -1,506 +0,0 @@ -package org.xrpl.xrpl4j.model.transactions.json; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.common.io.BaseEncoding; -import com.google.common.primitives.UnsignedInteger; -import com.google.common.primitives.UnsignedLong; -import com.ripple.cryptoconditions.CryptoConditionReader; -import com.ripple.cryptoconditions.der.DerEncodingException; -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; -import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.transactions.Address; -import org.xrpl.xrpl4j.model.transactions.EscrowCancel; -import org.xrpl.xrpl4j.model.transactions.EscrowCreate; -import org.xrpl.xrpl4j.model.transactions.EscrowFinish; -import org.xrpl.xrpl4j.model.transactions.NetworkId; -import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; - -public class EscrowJsonTests extends AbstractJsonTest { - - @Test - public void testEscrowCreateJson() throws JsonProcessingException, JSONException, DerEncodingException { - EscrowCreate escrowCreate = EscrowCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .cancelAfter(UnsignedLong.valueOf(533257958)) - .finishAfter(UnsignedLong.valueOf(533171558)) - .condition(CryptoConditionReader.readCondition( - BaseEncoding.base16() - .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .sourceTag(UnsignedInteger.valueOf(11747)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowCreate, json); - } - - @Test - public void testEscrowCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException, DerEncodingException { - EscrowCreate escrowCreate = EscrowCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .cancelAfter(UnsignedLong.valueOf(533257958)) - .finishAfter(UnsignedLong.valueOf(533171558)) - .condition(CryptoConditionReader.readCondition( - BaseEncoding.base16() - .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .sourceTag(UnsignedInteger.valueOf(11747)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowCreate, json); - } - - @Test - public void testEscrowCreateJsonWithNonZeroFlags() - throws JsonProcessingException, JSONException, DerEncodingException { - EscrowCreate escrowCreate = EscrowCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .cancelAfter(UnsignedLong.valueOf(533257958)) - .finishAfter(UnsignedLong.valueOf(533171558)) - .condition(CryptoConditionReader.readCondition( - BaseEncoding.base16() - .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .sourceTag(UnsignedInteger.valueOf(11747)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(escrowCreate, json); - } - - @Test - public void testEscrowCreateJsonWithUnknownFields() - throws JsonProcessingException, JSONException, DerEncodingException { - EscrowCreate escrowCreate = EscrowCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .cancelAfter(UnsignedLong.valueOf(533257958)) - .finishAfter(UnsignedLong.valueOf(533171558)) - .condition(CryptoConditionReader.readCondition( - BaseEncoding.base16() - .decode("A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .sourceTag(UnsignedInteger.valueOf(11747)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowCreate, json); - } - - @Test - public void testEscrowCancelJson() throws JsonProcessingException, JSONException { - EscrowCancel escrowCancel = EscrowCancel.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCancel\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - assertCanSerializeAndDeserialize(escrowCancel, json); - } - - @Test - public void testEscrowCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - EscrowCancel escrowCancel = EscrowCancel.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCancel\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; - assertCanSerializeAndDeserialize(escrowCancel, json); - } - - @Test - public void testEscrowCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - EscrowCancel escrowCancel = EscrowCancel.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCancel\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - assertCanSerializeAndDeserialize(escrowCancel, json); - } - - @Test - public void testEscrowCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { - EscrowCancel escrowCancel = EscrowCancel.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCancel\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; - assertCanSerializeAndDeserialize(escrowCancel, json); - } - - @Test - public void testEscrowFinishJson() throws JsonProcessingException, JSONException, DerEncodingException { - EscrowFinish escrowFinish = EscrowFinish.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(330)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( - "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"Fulfillment\": \"A0028000\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"330\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowFinish, json); - } - - @Test - public void testEscrowFinishJsonWithUnsetFlags() throws JsonProcessingException, JSONException, DerEncodingException { - EscrowFinish escrowFinish = EscrowFinish.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(330)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( - "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"Fulfillment\": \"A0028000\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"330\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowFinish, json); - } - - @Test - public void testEscrowFinishJsonWithNonZeroFlags() - throws JsonProcessingException, JSONException, DerEncodingException { - EscrowFinish escrowFinish = EscrowFinish.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(330)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( - "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"Fulfillment\": \"A0028000\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"330\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(escrowFinish, json); - } - - @Test - void testEscrowFinishJsonWithMalformedCondition() throws JsonProcessingException { - String json = "{\n" + - " \"Account\": \"rKWZ2fDqE5B9XorAcEQZD46H6HEdJQVNdb\",\n" + - " \"Condition\": \"A02580209423ED2EF4CACA8CA4AFC08D3F5EC60A545FD7A97E66E16EA0E2E2\",\n" + - " \"Fee\": \"563\",\n" + - " \"Fulfillment\": \"A02280203377850F1B3A4322F1562DF6F75D584596ABE5B9C76EEA8301F56CB942ACC69B\",\n" + - " \"LastLedgerSequence\": 40562057,\n" + - " \"OfferSequence\": 40403748,\n" + - " \"Owner\": \"r3iocgQwoGNCYyvvt8xuWv2XYXx7Z2gQqd\",\n" + - " \"Sequence\": 39899485,\n" + - " \"SigningPubKey\": \"ED09285829A011D520A1873A0E2F1014F5D6B66A6DDE6953FC02C8185EAFA6A1B0\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"TxnSignature\": \"A3E64F6B8D1D7C4FBC9663FCD217F86C3529EC2E2F16442DD48D1B66EEE30EAC2CE960A76080F74BC749" + - "8CA7BBFB822BEE9E8F767114D7B54F7403A7CB672501\"\n" + - "}"; - - EscrowFinish escrowFinish = objectMapper.readValue(json, EscrowFinish.class); - assertThat(escrowFinish.condition()).isEmpty(); - assertThat(escrowFinish.conditionRawValue()).isNotEmpty().get() - .isEqualTo("A02580209423ED2EF4CACA8CA4AFC08D3F5EC60A545FD7A97E66E16EA0E2E2"); - } - - @Test - void testEscrowFinishJsonWithMalformedFulfillment() throws JsonProcessingException { - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"Fulfillment\": \"123\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"330\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - EscrowFinish escrowFinish = objectMapper.readValue(json, EscrowFinish.class); - assertThat(escrowFinish.fulfillment()).isEmpty(); - assertThat(escrowFinish.fulfillmentRawValue()).isNotEmpty().get() - .isEqualTo("123"); - } - - @Test - public void testEscrowFinishJsonWithUnknownFields() - throws JsonProcessingException, JSONException, DerEncodingException { - EscrowFinish escrowFinish = EscrowFinish.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(330)) - .sequence(UnsignedInteger.ONE) - .owner(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .offerSequence(UnsignedInteger.valueOf(7)) - .condition(CryptoConditionReader.readCondition(BaseEncoding.base16().decode( - "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100")) - ) - .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowFinish\",\n" + - " \"Owner\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"OfferSequence\": 7,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"Fulfillment\": \"A0028000\",\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"330\"\n" + - "}"; - - assertCanSerializeAndDeserialize(escrowFinish, json); - } -} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java index d9216d18f..1259e2b22 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,21 +25,34 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenAcceptOffer; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.NfTokenAcceptOffer; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenAcceptOfferJsonTests extends AbstractJsonTest { +public class NfTokenAcceptOfferJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testMinimalNfTokenAcceptOfferJson() throws JsonProcessingException, JSONException { + /** + * No-args Constructor + */ + protected NfTokenAcceptOfferJsonTests() { + super(NfTokenAcceptOffer.class, ImmutableNfTokenAcceptOffer.class, TransactionType.NFTOKEN_ACCEPT_OFFER); + } + + @Override + protected ImmutableNfTokenAcceptOffer.Builder builder() { + return ImmutableNfTokenAcceptOffer.builder(); + } + @Override + protected NfTokenAcceptOffer fullyPopulatedTransaction() { Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenAcceptOffer nfTokenAcceptOffer = NfTokenAcceptOffer.builder() + return NfTokenAcceptOffer.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) .sequence(UnsignedInteger.valueOf(12)) @@ -51,89 +64,94 @@ public void testMinimalNfTokenAcceptOfferJson() throws JsonProcessingException, ) .networkId(NetworkId.of(1024)) .build(); - - String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + - "}"; - - assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); } - @Test - public void testNfTokenAcceptOfferJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + @Override + protected NfTokenAcceptOffer fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + @Override + protected NfTokenAcceptOffer minimallyPopulatedTransaction() { Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenAcceptOffer nfTokenAcceptOffer = NfTokenAcceptOffer.builder() + return NfTokenAcceptOffer.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) - .brokerFee(XrpCurrencyAmount.ofDrops(10)) .buyOffer(offer) - .sellOffer(offer) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + public void testMinimalNfTokenAcceptOfferJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testNfTokenAcceptOfferJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + NfTokenAcceptOffer transactionWithUnsetFlags = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": 0,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\",\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); + assertCanSerializeAndDeserialize(transactionWithUnsetFlags, json); } @Test public void testNfTokenAcceptOfferJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - - Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenAcceptOffer nfTokenAcceptOffer = NfTokenAcceptOffer.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) - .brokerFee(XrpCurrencyAmount.ofDrops(10)) - .buyOffer(offer) - .sellOffer(offer) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + NfTokenAcceptOffer transactionWithNonZeroFlags = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": %s,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + String json = + "{\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + + "}"; - assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); + assertCanSerializeAndDeserialize(transactionWithNonZeroFlags, json); } @Test public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingException, JSONException { - Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); NfTokenAcceptOffer nfTokenAcceptOffer = NfTokenAcceptOffer.builder() .fee(XrpCurrencyAmount.ofDrops(12)) @@ -145,13 +163,14 @@ public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingExcept ) .build(); - String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); @@ -159,36 +178,20 @@ public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingExcept @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - - Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenAcceptOffer nfTokenAcceptOffer = NfTokenAcceptOffer.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) - .brokerFee(XrpCurrencyAmount.ofDrops(10)) - .buyOffer(offer) - .sellOffer(offer) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } - } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java index 27bacd498..4b30cb7d6 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,22 +25,37 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenBurn; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.NfTokenBurn; import org.xrpl.xrpl4j.model.transactions.NfTokenId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenBurnJsonTests extends AbstractJsonTest { +public class NfTokenBurnJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected NfTokenBurnJsonTests() { + super(NfTokenBurn.class, ImmutableNfTokenBurn.class, TransactionType.NFTOKEN_BURN); + } - @Test - public void testMinimalNfTokenBurnJson() throws JsonProcessingException, JSONException { + @Override + protected ImmutableNfTokenBurn.Builder builder() { + return ImmutableNfTokenBurn.builder(); + } + + @Override + protected NfTokenBurn fullyPopulatedTransaction() { NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenBurn nfTokenBurn = NfTokenBurn.builder() + return NfTokenBurn.builder() .fee(XrpCurrencyAmount.ofDrops(12)) + .owner(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) .sequence(UnsignedInteger.valueOf(12)) .nfTokenId(id) @@ -49,101 +64,102 @@ public void testMinimalNfTokenBurnJson() throws JsonProcessingException, JSONExc ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"NFTokenBurn\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; - - assertCanSerializeAndDeserialize(nfTokenBurn, json); + @Override + protected NfTokenBurn fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testNfTokenBurnJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + @Override + protected NfTokenBurn minimallyPopulatedTransaction() { NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenBurn nfTokenBurn = NfTokenBurn.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) + return NfTokenBurn.builder() .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) + .fee(XrpCurrencyAmount.ofDrops(12)) .nfTokenId(id) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + public void testMinimalNfTokenBurnJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenBurn\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + + @Test + public void testNfTokenBurnJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + NfTokenBurn transactionWithUnsetFlags = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"TransactionType\": \"NFTokenBurn\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": 0,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenBurn\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Owner\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenBurn, json); + assertCanSerializeAndDeserialize(transactionWithUnsetFlags, json); } @Test public void testNfTokenBurnJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenBurn nfTokenBurn = NfTokenBurn.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) - .nfTokenId(id) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + NfTokenBurn transactionWithNonZeroFlags = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"TransactionType\": \"NFTokenBurn\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": %s,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(nfTokenBurn, json); + String json = + "{\n" + + " \"TransactionType\": \"NFTokenBurn\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"Owner\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + assertCanSerializeAndDeserialize(transactionWithNonZeroFlags, json); } @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - - NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenBurn nfTokenBurn = NfTokenBurn.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .sequence(UnsignedInteger.valueOf(12)) - .nfTokenId(id) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenBurn\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenBurn\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Owner\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenBurn, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java index d4f1a02d4..b538cfc56 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,25 +25,39 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenCancelOffer; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.NfTokenCancelOffer; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; import java.util.ArrayList; import java.util.List; -public class NfTokenCancelOfferJsonTests extends AbstractJsonTest { +public class NfTokenCancelOfferJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testMinimalNfTokenCancelOfferJson() throws JsonProcessingException, JSONException { + /** + * No-args Constructor + */ + protected NfTokenCancelOfferJsonTests() { + super(NfTokenCancelOffer.class, ImmutableNfTokenCancelOffer.class, TransactionType.NFTOKEN_CANCEL_OFFER); + } + + @Override + protected ImmutableNfTokenCancelOffer.Builder builder() { + return ImmutableNfTokenCancelOffer.builder(); + } + + @Override + protected NfTokenCancelOffer fullyPopulatedTransaction() { Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); List offers = new ArrayList<>(); offers.add(offer); - NfTokenCancelOffer nfTokenCancelOffer = NfTokenCancelOffer.builder() + return NfTokenCancelOffer.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(12)) @@ -53,114 +67,109 @@ public void testMinimalNfTokenCancelOfferJson() throws JsonProcessingException, ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; - - assertCanSerializeAndDeserialize(nfTokenCancelOffer, json); + @Override + protected NfTokenCancelOffer fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testNfTokenCancelOfferJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + @Override + protected NfTokenCancelOffer minimallyPopulatedTransaction() { Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); List offers = new ArrayList<>(); offers.add(offer); - NfTokenCancelOffer nfTokenCancelOffer = NfTokenCancelOffer.builder() + return NfTokenCancelOffer.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(12)) .tokenOffers(offers) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + public void testMinimalNfTokenCancelOfferJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + + @Test + public void testNfTokenCancelOfferJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + NfTokenCancelOffer transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": 0,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenCancelOffer, json); + assertCanSerializeAndDeserialize(transaction, json); } @Test public void testNfTokenCancelOfferJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - List offers = new ArrayList<>(); - offers.add(offer); - NfTokenCancelOffer nfTokenCancelOffer = NfTokenCancelOffer.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(12)) - .tokenOffers(offers) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + NfTokenCancelOffer transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": %s,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(nfTokenCancelOffer, json); + String json = + "{\n" + + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + + assertCanSerializeAndDeserialize(transaction, json); } @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - Hash256 offer = Hash256.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - List offers = new ArrayList<>(); - offers.add(offer); - NfTokenCancelOffer nfTokenCancelOffer = NfTokenCancelOffer.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(12)) - .tokenOffers(offers) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"Foo\": \"Bar\",\n" + + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenCancelOffer, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java index 832a7ff3c..54aa5da7e 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,21 +25,34 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.NfTokenCreateOfferFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenCreateOffer; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.NfTokenCreateOffer; import org.xrpl.xrpl4j.model.transactions.NfTokenId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenCreateOfferJsonTests extends AbstractJsonTest { +public class NfTokenCreateOfferJsonTests extends AbstractTransactionJsonTest { - @Test - public void testMinimalNfTokenCreateOfferJson() throws JsonProcessingException, JSONException { + /** + * No-args Constructor + */ + protected NfTokenCreateOfferJsonTests() { + super(NfTokenCreateOffer.class, ImmutableNfTokenCreateOffer.class, TransactionType.NFTOKEN_CREATE_OFFER); + } + + @Override + protected ImmutableNfTokenCreateOffer.Builder builder() { + return ImmutableNfTokenCreateOffer.builder(); + } + + @Override + protected NfTokenCreateOffer fullyPopulatedTransaction() { NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenCreateOffer nfTokenCreateOffer = NfTokenCreateOffer.builder() + return NfTokenCreateOffer.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .nfTokenId(id) @@ -50,54 +63,69 @@ public void testMinimalNfTokenCreateOfferJson() throws JsonProcessingException, ) .networkId(NetworkId.of(1024)) .build(); - - String json = "{\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Amount\": \"2000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; - - assertCanSerializeAndDeserialize(nfTokenCreateOffer, json); } - @Test - public void testJsonWithFlags() throws JsonProcessingException, JSONException { + @Override + protected NfTokenCreateOffer fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + @Override + protected NfTokenCreateOffer minimallyPopulatedTransaction() { NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); - NfTokenCreateOffer nfTokenCreateOffer = NfTokenCreateOffer.builder() + return NfTokenCreateOffer.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .nfTokenId(id) - .sequence(UnsignedInteger.valueOf(12)) .amount(XrpCurrencyAmount.ofDrops(2000L)) - .flags(NfTokenCreateOfferFlags.SELL_NFTOKEN) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) .build(); + } - String json = String.format("{\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Amount\": \"2000\",\n" + - " \"Flags\": %s,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}", NfTokenCreateOfferFlags.SELL_NFTOKEN); + @Test + public void testMinimalNfTokenCreateOfferJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"Amount\": \"2000\",\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; - assertCanSerializeAndDeserialize(nfTokenCreateOffer, json); + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); } @Test - public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { + public void testJsonWithFlags() throws JsonProcessingException, JSONException { + NfTokenCreateOffer transaction = builder().from(fullyPopulatedTransaction()) + .flags(NfTokenCreateOfferFlags.SELL_NFTOKEN) + .build(); + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Amount\": \"2000\",\n" + + " \"Flags\": " + NfTokenCreateOfferFlags.SELL_NFTOKEN + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; + assertCanSerializeAndDeserialize(transaction, json); + } + + @Test + public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65"); NfTokenCreateOffer nfTokenCreateOffer = NfTokenCreateOffer.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) @@ -112,16 +140,17 @@ public void testJsonWithUnknownFields() throws JsonProcessingException, JSONExce .putUnknownFields("Foo", "Bar") .build(); - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Amount\": \"2000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Amount\": \"2000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + "}"; assertCanSerializeAndDeserialize(nfTokenCreateOffer, json); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java index f52801b0a..46ce0a105 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,20 +26,34 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.NfTokenMintFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableNfTokenMint; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.NfTokenMint; import org.xrpl.xrpl4j.model.transactions.NfTokenUri; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.TransferFee; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenMintJsonTests extends AbstractJsonTest { +public class NfTokenMintJsonTests extends AbstractTransactionJsonTest { - @Test - public void testMinimalNfTokenMintJson() throws JsonProcessingException, JSONException { - NfTokenMint nfTokenMint = NfTokenMint.builder() + /** + * No-args Constructor + */ + protected NfTokenMintJsonTests() { + super(NfTokenMint.class, ImmutableNfTokenMint.class, TransactionType.NFTOKEN_MINT); + } + + + @Override + protected ImmutableNfTokenMint.Builder builder() { + return ImmutableNfTokenMint.builder(); + } + + @Override + protected NfTokenMint fullyPopulatedTransaction() { + return NfTokenMint.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) .tokenTaxon(UnsignedLong.valueOf(146999694L)) @@ -53,112 +67,101 @@ public void testMinimalNfTokenMintJson() throws JsonProcessingException, JSONExc ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + - "}"; - - assertCanSerializeAndDeserialize(nfTokenMint, json); + @Override + protected NfTokenMint fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testJsonWithoutFlags() throws JsonProcessingException, JSONException { - NfTokenMint nfTokenMint = NfTokenMint.builder() + @Override + protected NfTokenMint minimallyPopulatedTransaction() { + return NfTokenMint.builder() .fee(XrpCurrencyAmount.ofDrops(12)) .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) .tokenTaxon(UnsignedLong.valueOf(146999694L)) - .sequence(UnsignedInteger.valueOf(12)) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + + @Test + public void testMinimalNfTokenMintJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenMint, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @Test - public void testMinimalNfTokenMintWithUriJson() throws JsonProcessingException, JSONException { + public void testJsonWithoutFlags() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + + "}"; + + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + @Test + public void testMinimalNfTokenMintWithUriJson() throws JsonProcessingException, JSONException { String uri = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi"; - NfTokenMint nfTokenMint = NfTokenMint.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .tokenTaxon(UnsignedLong.valueOf(146999694L)) - .sequence(UnsignedInteger.valueOf(12)) - .transferFee(TransferFee.of(UnsignedInteger.valueOf(1000))) + NfTokenMint transaction = builder().from(fullyPopulatedTransaction()) .uri(NfTokenUri.ofPlainText(uri)) - .flags(NfTokenMintFlags.builder() - .tfTransferable(true) - .build()) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) .build(); - String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"URI\": \"697066733A2F2F62616679626569676479727A74357366703775646D3768753736756837" + + String json = + "{\n" + + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"URI\": \"697066733A2F2F62616679626569676479727A74357366703775646D3768753736756837" + "7932366E6634646675796C71616266336F636C67747179353566627A6469\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694,\n" + + " \"NetworkID\": 1024\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenMint, json); + assertCanSerializeAndDeserialize(transaction, json); } @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - NfTokenMint nfTokenMint = NfTokenMint.builder() - .fee(XrpCurrencyAmount.ofDrops(12)) - .account(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba")) - .tokenTaxon(UnsignedLong.valueOf(146999694L)) - .sequence(UnsignedInteger.valueOf(12)) - .transferFee(TransferFee.of(UnsignedInteger.valueOf(1000))) - .flags(NfTokenMintFlags.builder() - .tfTransferable(true) - .build()) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + "}"; - assertCanSerializeAndDeserialize(nfTokenMint, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java new file mode 100644 index 000000000..74226cfb8 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java @@ -0,0 +1,194 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableOfferCancel; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.OfferCancel; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class OfferCancelJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected OfferCancelJsonTests() { + super(OfferCancel.class, ImmutableOfferCancel.class, TransactionType.OFFER_CANCEL); + } + + + @Override + protected ImmutableOfferCancel.Builder builder() { + return ImmutableOfferCancel.builder(); + } + + @Override + protected OfferCancel fullyPopulatedTransaction() { + return OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.valueOf(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected OfferCancel fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected OfferCancel minimallyPopulatedTransaction() { + return OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testOfferCancelJson() throws JsonProcessingException, JSONException { + OfferCancel offerCancel = OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.valueOf(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"OfferCancel\",\n" + + " \"Sequence\": 12,\n" + + " \"OfferSequence\": 13,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"14\"\n" + + "}"; + + assertCanSerializeAndDeserialize(offerCancel, json); + } + + @Test + public void testOfferCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + OfferCancel offerCancel = OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.valueOf(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"OfferCancel\",\n" + + " \"Sequence\": 12,\n" + + " \"OfferSequence\": 13,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"14\"\n" + + "}"; + + assertCanSerializeAndDeserialize(offerCancel, json); + } + + @Test + public void testOfferCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + OfferCancel offerCancel = OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.valueOf(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"OfferCancel\",\n" + + " \"Sequence\": 12,\n" + + " \"OfferSequence\": 13,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"14\"\n" + + "}"; + + assertCanSerializeAndDeserialize(offerCancel, json); + } + + @Test + public void testOfferCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { + OfferCancel offerCancel = OfferCancel.builder() + .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) + .sequence(UnsignedInteger.valueOf(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .fee(XrpCurrencyAmount.ofDrops(14)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + + " \"TransactionType\": \"OfferCancel\",\n" + + " \"Sequence\": 12,\n" + + " \"OfferSequence\": 13,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"14\"\n" + + "}"; + + assertCanSerializeAndDeserialize(offerCancel, json); + } + +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java new file mode 100644 index 000000000..e4d545c6a --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java @@ -0,0 +1,177 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.OfferCreateFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableOfferCreate; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.OfferCreate; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class OfferCreateJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected OfferCreateJsonTests() { + super(OfferCreate.class, ImmutableOfferCreate.class, TransactionType.OFFER_CREATE); + } + + + @Override + protected ImmutableOfferCreate.Builder builder() { + return ImmutableOfferCreate.builder(); + } + + @Override + protected OfferCreate fullyPopulatedTransaction() { + return OfferCreate.builder() + .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .sequence(UnsignedInteger.ONE) + .fee(XrpCurrencyAmount.ofDrops(12)) + .offerSequence(UnsignedInteger.valueOf(13)) + .takerPays(XrpCurrencyAmount.ofDrops(14)) + .takerGets(XrpCurrencyAmount.ofDrops(15)) + .expiration(UnsignedInteger.valueOf(16)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected OfferCreate fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected OfferCreate minimallyPopulatedTransaction() { + return OfferCreate.builder() + .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .takerPays(XrpCurrencyAmount.ofDrops(14)) + .takerGets(XrpCurrencyAmount.ofDrops(15)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testOfferCreateJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"TransactionType\": \"OfferCreate\",\n" + + " \"Sequence\": 1,\n" + + " \"OfferSequence\": 13,\n" + + " \"TakerPays\": \"14\",\n" + + " \"TakerGets\": \"15\",\n" + + " \"Fee\": \"12\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Expiration\": 16\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testMinimallyPopulatedOfferCreateJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"TransactionType\": \"OfferCreate\",\n" + + " \"Sequence\": 1,\n" + + " \"OfferSequence\": 13,\n" + + " \"TakerPays\": \"14\",\n" + + " \"TakerGets\": \"15\",\n" + + " \"Fee\": \"12\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Expiration\": 16\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testOfferCreateJsonWithFlags() throws JsonProcessingException, JSONException { + OfferCreateFlags flags = OfferCreateFlags.builder() + .tfSell(true) + .tfImmediateOrCancel(true) + .tfPassive(true) + .tfImmediateOrCancel(true) + .build(); + OfferCreate transaction = builder().from(fullyPopulatedTransaction()) + .flags(flags) + .build(); + + String json = + "{\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": " + flags + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"OfferSequence\": 13,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TakerPays\": \"14\",\n" + + " \"TakerGets\": \"15\",\n" + + " \"TransactionType\": \"OfferCreate\",\n" + + " \"Expiration\": 16\n" + + "}"; + + assertCanSerializeAndDeserialize(transaction, json); + } + + @Test + public void testOfferCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + + " \"TransactionType\": \"OfferCreate\",\n" + + " \"Sequence\": 1,\n" + + " \"OfferSequence\": 13,\n" + + " \"TakerPays\": \"14\",\n" + + " \"TakerGets\": \"15\",\n" + + " \"Fee\": \"12\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Expiration\": 16\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferJsonTests.java deleted file mode 100644 index 0d3ef0c9d..000000000 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferJsonTests.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.xrpl.xrpl4j.model.transactions.json; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.common.primitives.UnsignedInteger; -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; -import org.xrpl.xrpl4j.model.flags.OfferCreateFlags; -import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.transactions.Address; -import org.xrpl.xrpl4j.model.transactions.NetworkId; -import org.xrpl.xrpl4j.model.transactions.OfferCancel; -import org.xrpl.xrpl4j.model.transactions.OfferCreate; -import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; - -public class OfferJsonTests extends AbstractJsonTest { - - @Test - public void testOfferCancelJson() throws JsonProcessingException, JSONException { - OfferCancel offerCancel = OfferCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.valueOf(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .fee(XrpCurrencyAmount.ofDrops(14)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"OfferCancel\",\n" + - " \"Sequence\": 12,\n" + - " \"OfferSequence\": 13,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"14\"\n" + - "}"; - - assertCanSerializeAndDeserialize(offerCancel, json); - } - - @Test - public void testOfferCancelJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - OfferCancel offerCancel = OfferCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.valueOf(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .fee(XrpCurrencyAmount.ofDrops(14)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"OfferCancel\",\n" + - " \"Sequence\": 12,\n" + - " \"OfferSequence\": 13,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"14\"\n" + - "}"; - - assertCanSerializeAndDeserialize(offerCancel, json); - } - - @Test - public void testOfferCancelJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - OfferCancel offerCancel = OfferCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.valueOf(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .fee(XrpCurrencyAmount.ofDrops(14)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"OfferCancel\",\n" + - " \"Sequence\": 12,\n" + - " \"OfferSequence\": 13,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"14\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(offerCancel, json); - } - - @Test - public void testOfferCancelJsonWithUnknownFields() throws JsonProcessingException, JSONException { - OfferCancel offerCancel = OfferCancel.builder() - .account(Address.of("rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo")) - .sequence(UnsignedInteger.valueOf(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .fee(XrpCurrencyAmount.ofDrops(14)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo\",\n" + - " \"TransactionType\": \"OfferCancel\",\n" + - " \"Sequence\": 12,\n" + - " \"OfferSequence\": 13,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"14\"\n" + - "}"; - - assertCanSerializeAndDeserialize(offerCancel, json); - } - - @Test - public void testOfferCreateJson() throws JsonProcessingException, JSONException { - OfferCreate offerCreate = OfferCreate.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .takerPays(XrpCurrencyAmount.ofDrops(14)) - .takerGets(XrpCurrencyAmount.ofDrops(15)) - .expiration(UnsignedInteger.valueOf(16)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"OfferCreate\",\n" + - " \"Sequence\": 1,\n" + - " \"OfferSequence\": 13,\n" + - " \"TakerPays\": \"14\",\n" + - " \"TakerGets\": \"15\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Expiration\": 16\n" + - "}"; - - assertCanSerializeAndDeserialize(offerCreate, json); - } - - @Test - public void testOfferCreateJsonWithFlags() throws JsonProcessingException, JSONException { - OfferCreate offerCreate = OfferCreate.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .takerPays(XrpCurrencyAmount.ofDrops(14)) - .takerGets(XrpCurrencyAmount.ofDrops(15)) - .expiration(UnsignedInteger.valueOf(16)) - .flags(OfferCreateFlags.builder().tfSell(true).build()) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"OfferCreate\",\n" + - " \"Sequence\": 1,\n" + - " \"OfferSequence\": 13,\n" + - " \"TakerPays\": \"14\",\n" + - " \"TakerGets\": \"15\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 16\n" + - "}", offerCreate.flags()); - - assertCanSerializeAndDeserialize(offerCreate, json); - } - - @Test - public void testOfferCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { - OfferCreate offerCreate = OfferCreate.builder() - .account(Address.of("rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy")) - .sequence(UnsignedInteger.ONE) - .fee(XrpCurrencyAmount.ofDrops(12)) - .offerSequence(UnsignedInteger.valueOf(13)) - .takerPays(XrpCurrencyAmount.ofDrops(14)) - .takerGets(XrpCurrencyAmount.ofDrops(15)) - .expiration(UnsignedInteger.valueOf(16)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy\",\n" + - " \"TransactionType\": \"OfferCreate\",\n" + - " \"Sequence\": 1,\n" + - " \"OfferSequence\": 13,\n" + - " \"TakerPays\": \"14\",\n" + - " \"TakerGets\": \"15\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Expiration\": 16\n" + - "}"; - - assertCanSerializeAndDeserialize(offerCreate, json); - } - -} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java new file mode 100644 index 000000000..0c8bdd1a9 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java @@ -0,0 +1,164 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.PaymentChannelClaimFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutablePaymentChannelClaim; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelClaim; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class PaymentChannelClaimJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected PaymentChannelClaimJsonTests() { + super(PaymentChannelClaim.class, ImmutablePaymentChannelClaim.class, TransactionType.PAYMENT_CHANNEL_CLAIM); + } + + @Override + protected ImmutablePaymentChannelClaim.Builder builder() { + return ImmutablePaymentChannelClaim.builder(); + } + + @Override + protected PaymentChannelClaim fullyPopulatedTransaction() { + return PaymentChannelClaim.builder() + .account(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .sequence(UnsignedInteger.ONE) + .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) + .balance(XrpCurrencyAmount.ofDrops(1000000)) + .amount(XrpCurrencyAmount.ofDrops(1000000)) + .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + + "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") + .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected PaymentChannelClaim fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected PaymentChannelClaim minimallyPopulatedTransaction() { + return PaymentChannelClaim.builder() + .account(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) + .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + + "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") + .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testPaymentChannelClaimJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelClaim\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + + "}"; + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testPaymentChannelClaimJsonWithFlags() throws JsonProcessingException, JSONException { + + PaymentChannelClaimFlags flags = PaymentChannelClaimFlags.builder() + .tfClose(true) + .tfRenew(true) + .build(); + PaymentChannelClaim transaction = builder().from(fullyPopulatedTransaction()) + .flags(flags) + .build(); + + String json = + "{\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 2147680256,\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"NetworkID\": 1024,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"Sequence\": 1,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"PaymentChannelClaim\"\n" + + "}"; + assertCanSerializeAndDeserialize(transaction, json); + } + + @Test + public void testPaymentChannelClaimJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelClaim\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + + "}"; + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java new file mode 100644 index 000000000..fd40690c9 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java @@ -0,0 +1,194 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import com.google.common.primitives.UnsignedLong; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutablePaymentChannelCreate; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelCreate; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class PaymentChannelCreateJsonTests extends AbstractTransactionJsonTest< + ImmutablePaymentChannelCreate, ImmutablePaymentChannelCreate.Builder, PaymentChannelCreate + > { + + /** + * No-args Constructor + */ + protected PaymentChannelCreateJsonTests() { + super(PaymentChannelCreate.class, ImmutablePaymentChannelCreate.class, TransactionType.PAYMENT_CHANNEL_CREATE); + } + + @Override + protected ImmutablePaymentChannelCreate.Builder builder() { + return ImmutablePaymentChannelCreate.builder(); + } + + @Override + protected PaymentChannelCreate fullyPopulatedTransaction() { + return PaymentChannelCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .sourceTag(UnsignedInteger.valueOf(11747)) + .fee(XrpCurrencyAmount.ofDrops(10)) + .sequence(UnsignedInteger.ONE) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .destinationTag(UnsignedInteger.valueOf(23480)) + .settleDelay(UnsignedInteger.valueOf(86400)) + .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") + .cancelAfter(UnsignedLong.valueOf(533171558)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected PaymentChannelCreate fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected PaymentChannelCreate minimallyPopulatedTransaction() { + return PaymentChannelCreate.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .amount(XrpCurrencyAmount.ofDrops(10000)) + .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) + .settleDelay(UnsignedInteger.valueOf(86400)) + .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testPaymentChannelCreateJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"SettleDelay\": 86400,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"CancelAfter\": 533171558,\n" + + " \"DestinationTag\": 23480,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SourceTag\": 11747\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testPaymentChannelCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + PaymentChannelCreate transaction = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Amount\": \"10000\",\n" + + " \"CancelAfter\": 533171558,\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"SettleDelay\": 86400,\n" + + " \"Sequence\": 1,\n" + + " \"SourceTag\": 11747,\n" + + " \"TransactionType\": \"PaymentChannelCreate\"\n" + + "}"; + + assertCanSerializeAndDeserialize(transaction, json); + } + + @Test + public void testPaymentChannelCreateJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + PaymentChannelCreate create = PaymentChannelCreate.builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Amount\": \"10000\",\n" + + " \"CancelAfter\": 533171558,\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"SettleDelay\": 86400,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SourceTag\": 11747,\n" + + " \"TransactionType\": \"PaymentChannelCreate\"\n" + + "}"; + + assertCanSerializeAndDeserialize(create, json); + } + + @Test + public void testPaymentChannelCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"SettleDelay\": 86400,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"CancelAfter\": 533171558,\n" + + " \"DestinationTag\": 23480,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SourceTag\": 11747\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); + } + +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java new file mode 100644 index 000000000..cf0ed4d62 --- /dev/null +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java @@ -0,0 +1,185 @@ +package org.xrpl.xrpl4j.model.transactions.json; + +/*- + * ========================LICENSE_START================================= + * xrpl4j :: model + * %% + * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * =========================LICENSE_END================================== + */ + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.google.common.primitives.UnsignedInteger; +import com.google.common.primitives.UnsignedLong; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.xrpl.xrpl4j.crypto.keys.PublicKey; +import org.xrpl.xrpl4j.model.flags.TransactionFlags; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.ImmutablePaymentChannelFund; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelFund; +import org.xrpl.xrpl4j.model.transactions.TransactionType; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; + +public class PaymentChannelFundJsonTests + extends AbstractTransactionJsonTest { + + /** + * No-args Constructor + */ + protected PaymentChannelFundJsonTests() { + super(PaymentChannelFund.class, ImmutablePaymentChannelFund.class, TransactionType.PAYMENT_CHANNEL_FUND); + } + + @Override + protected ImmutablePaymentChannelFund.Builder builder() { + return ImmutablePaymentChannelFund.builder(); + } + + @Override + protected PaymentChannelFund fullyPopulatedTransaction() { + return PaymentChannelFund.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .sequence(UnsignedInteger.ONE) + .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) + .amount(XrpCurrencyAmount.ofDrops(200000)) + .expiration(UnsignedLong.valueOf(543171558)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .build(); + } + + @Override + protected PaymentChannelFund fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected PaymentChannelFund minimallyPopulatedTransaction() { + return PaymentChannelFund.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .amount(XrpCurrencyAmount.ofDrops(200000)) + .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testPaymentChannelFundJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Amount\": \"200000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Expiration\": 543171558\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testPaymentChannelFundJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + PaymentChannelFund fund = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.UNSET) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Amount\": \"200000\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Expiration\": 543171558,\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fund, json); + } + + @Test + public void testPaymentChannelFundJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { + PaymentChannelFund fund = builder().from(fullyPopulatedTransaction()) + .flags(TransactionFlags.FULLY_CANONICAL_SIG) + .build(); + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Amount\": \"200000\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Expiration\": 543171558,\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"PaymentChannelFund\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fund, json); + } + + @Test + public void testPaymentChannelFundJsonWithUnknownFields() throws JsonProcessingException, JSONException { + PaymentChannelFund fund = PaymentChannelFund.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(10)) + .sequence(UnsignedInteger.ONE) + .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) + .amount(XrpCurrencyAmount.ofDrops(200000)) + .expiration(UnsignedLong.valueOf(543171558)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .networkId(NetworkId.of(1024)) + .putUnknownFields("Foo", "Bar") + .build(); + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Amount\": \"200000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Expiration\": 543171558\n" + + "}"; + + assertCanSerializeAndDeserialize(fund, json); + } +} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelJsonTests.java deleted file mode 100644 index 251e65df8..000000000 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelJsonTests.java +++ /dev/null @@ -1,424 +0,0 @@ -package org.xrpl.xrpl4j.model.transactions.json; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.common.primitives.UnsignedInteger; -import com.google.common.primitives.UnsignedLong; -import org.json.JSONException; -import org.junit.jupiter.api.Test; -import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; -import org.xrpl.xrpl4j.model.flags.PaymentChannelClaimFlags; -import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import org.xrpl.xrpl4j.model.transactions.Address; -import org.xrpl.xrpl4j.model.transactions.Hash256; -import org.xrpl.xrpl4j.model.transactions.NetworkId; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelClaim; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelCreate; -import org.xrpl.xrpl4j.model.transactions.PaymentChannelFund; -import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; - -public class PaymentChannelJsonTests extends AbstractJsonTest { - - @Test - public void testPaymentChannelCreateJson() throws JsonProcessingException, JSONException { - PaymentChannelCreate create = PaymentChannelCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .sourceTag(UnsignedInteger.valueOf(11747)) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .settleDelay(UnsignedInteger.valueOf(86400)) - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .cancelAfter(UnsignedLong.valueOf(533171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"SettleDelay\": 86400,\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + - " \"CancelAfter\": 533171558,\n" + - " \"DestinationTag\": 23480,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SourceTag\": 11747\n" + - "}"; - - assertCanSerializeAndDeserialize(create, json); - } - - @Test - public void testPaymentChannelCreateJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - PaymentChannelCreate create = PaymentChannelCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .sourceTag(UnsignedInteger.valueOf(11747)) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .settleDelay(UnsignedInteger.valueOf(86400)) - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .cancelAfter(UnsignedLong.valueOf(533171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"SettleDelay\": 86400,\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + - " \"CancelAfter\": 533171558,\n" + - " \"DestinationTag\": 23480,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SourceTag\": 11747\n" + - "}"; - - assertCanSerializeAndDeserialize(create, json); - } - - @Test - public void testPaymentChannelCreateJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - PaymentChannelCreate create = PaymentChannelCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .sourceTag(UnsignedInteger.valueOf(11747)) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .settleDelay(UnsignedInteger.valueOf(86400)) - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .cancelAfter(UnsignedLong.valueOf(533171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"SettleDelay\": 86400,\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + - " \"CancelAfter\": 533171558,\n" + - " \"DestinationTag\": 23480,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SourceTag\": 11747\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(create, json); - } - - @Test - public void testPaymentChannelCreateJsonWithUnknownFields() throws JsonProcessingException, JSONException { - PaymentChannelCreate create = PaymentChannelCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .sourceTag(UnsignedInteger.valueOf(11747)) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .amount(XrpCurrencyAmount.ofDrops(10000)) - .destination(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .destinationTag(UnsignedInteger.valueOf(23480)) - .settleDelay(UnsignedInteger.valueOf(86400)) - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .cancelAfter(UnsignedLong.valueOf(533171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"SettleDelay\": 86400,\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + - " \"CancelAfter\": 533171558,\n" + - " \"DestinationTag\": 23480,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SourceTag\": 11747\n" + - "}"; - - assertCanSerializeAndDeserialize(create, json); - } - - @Test - public void testPaymentChannelClaimJson() throws JsonProcessingException, JSONException { - PaymentChannelClaim claim = PaymentChannelClaim.builder() - .account(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .balance(XrpCurrencyAmount.ofDrops(1000000)) - .amount(XrpCurrencyAmount.ofDrops(1000000)) - .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + - "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelClaim\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + - "}"; - assertCanSerializeAndDeserialize(claim, json); - } - - @Test - public void testPaymentChannelClaimJsonWithFlags() throws JsonProcessingException, JSONException { - PaymentChannelClaim claim = PaymentChannelClaim.builder() - .account(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .flags(PaymentChannelClaimFlags.builder().tfClose(true).build()) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .balance(XrpCurrencyAmount.ofDrops(1000000)) - .amount(XrpCurrencyAmount.ofDrops(1000000)) - .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + - "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .build(); - - String json = "{\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 2147614720,\n" + - " \"TransactionType\": \"PaymentChannelClaim\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + - "}"; - assertCanSerializeAndDeserialize(claim, json); - } - - @Test - public void testPaymentChannelClaimJsonWithUnknownFields() throws JsonProcessingException, JSONException { - PaymentChannelClaim claim = PaymentChannelClaim.builder() - .account(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .balance(XrpCurrencyAmount.ofDrops(1000000)) - .amount(XrpCurrencyAmount.ofDrops(1000000)) - .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + - "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") - .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelClaim\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + - "}"; - assertCanSerializeAndDeserialize(claim, json); - } - - @Test - public void testPaymentChannelFundJson() throws JsonProcessingException, JSONException { - PaymentChannelFund fund = PaymentChannelFund.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .amount(XrpCurrencyAmount.ofDrops(200000)) - .expiration(UnsignedLong.valueOf(543171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}"; - - assertCanSerializeAndDeserialize(fund, json); - } - - @Test - public void testPaymentChannelFundJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - PaymentChannelFund fund = PaymentChannelFund.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .amount(XrpCurrencyAmount.ofDrops(200000)) - .expiration(UnsignedLong.valueOf(543171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.UNSET) - .build(); - - String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}"; - - assertCanSerializeAndDeserialize(fund, json); - } - - @Test - public void testPaymentChannelFundJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - PaymentChannelFund fund = PaymentChannelFund.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .amount(XrpCurrencyAmount.ofDrops(200000)) - .expiration(UnsignedLong.valueOf(543171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .build(); - - String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(fund, json); - } - - @Test - public void testPaymentChannelFundJsonWithUnknownFields() throws JsonProcessingException, JSONException { - PaymentChannelFund fund = PaymentChannelFund.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.ONE) - .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) - .amount(XrpCurrencyAmount.ofDrops(200000)) - .expiration(UnsignedLong.valueOf(543171558)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}"; - - assertCanSerializeAndDeserialize(fund, json); - } -} diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java index 16b2f7543..c6196864f 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,23 +26,36 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.PaymentFlags; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutablePayment; import org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.PathStep; import org.xrpl.xrpl4j.model.transactions.Payment; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -// FIXME: These tests should probably be replaced with a parameterized test that loads in payment json examples from -// a file. Will do this after merging with Neil's initial codec pass. -public class PaymentJsonTests extends AbstractJsonTest { +public class PaymentJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testJson() throws JsonProcessingException, JSONException { - Payment payment = Payment.builder() + /** + * No-args Constructor + */ + protected PaymentJsonTests() { + super(Payment.class, ImmutablePayment.class, TransactionType.PAYMENT); + } + + + @Override + protected ImmutablePayment.Builder builder() { + return ImmutablePayment.builder(); + } + + @Override + protected Payment fullyPopulatedTransaction() { + return Payment.builder() .account(Address.of("r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb")) .destination(Address.of("r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C")) .amount(XrpCurrencyAmount.ofDrops(25000000)) @@ -54,48 +67,70 @@ public void testJson() throws JsonProcessingException, JSONException { ) .networkId(NetworkId.of(1024)) .build(); - - String json = "{\n" + - " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + - " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + - " \"TransactionType\": \"Payment\",\n" + - " \"Amount\": \"25000000\",\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": 0,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Sequence\": 2\n" + - " }"; - - assertCanSerializeAndDeserialize(payment, json); } - @Test - public void testJsonWithFlags() throws JsonProcessingException, JSONException { + @Override + protected Payment fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } - Payment payment = Payment.builder() + @Override + protected Payment minimallyPopulatedTransaction() { + return Payment.builder() .account(Address.of("r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb")) .destination(Address.of("r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C")) .amount(XrpCurrencyAmount.ofDrops(25000000)) .fee(XrpCurrencyAmount.ofDrops(10)) - .sequence(UnsignedInteger.valueOf(2)) - .flags(PaymentFlags.of(TransactionFlags.FULLY_CANONICAL_SIG.getValue())) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) .build(); + } - String json = "{\n" + - " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + - " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + - " \"TransactionType\": \"Payment\",\n" + - " \"Amount\": \"25000000\",\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": 2147483648,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Sequence\": 2\n" + - " }"; + @Test + public void testJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + + " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + + " \"TransactionType\": \"Payment\",\n" + + " \"Amount\": \"25000000\",\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 2\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + @Test + public void testJsonWithFlags() throws JsonProcessingException, JSONException { + PaymentFlags flags = PaymentFlags.builder() + .tfPartialPayment(true) + .tfLimitQuality(true) + .tfNoDirectRipple(true) + .build(); + + Payment payment = builder().from(fullyPopulatedTransaction()) + .flags(flags) + .build(); + + String json = + "{\n" + + " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + + " \"Amount\": \"25000000\",\n" + + " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 2147942400,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 2,\n" + + " \"TransactionType\": \"Payment\"\n" + + "}"; assertCanSerializeAndDeserialize(payment, json); } @@ -131,62 +166,50 @@ public void testComplicatedJson() throws JsonProcessingException, JSONException ) .build(); - String json = "{\n" + - " \"Account\": \"rHXUjUtk5eiPFYpg27izxHeZ1t4x835Ecn\",\n" + - " \"Destination\": \"r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK\",\n" + - " \"TransactionType\": \"Payment\",\n" + - " \"Amount\": {\n" + - " \"currency\": \"CNY\",\n" + - " \"value\": \"5000\",\n" + - " \"issuer\": \"r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK\"\n" + - " },\n" + - " \"Fee\": \"12\",\n" + - " \"SendMax\": {\n" + - " \"currency\": \"CNY\",\n" + - " \"value\": \"5050\",\n" + - " \"issuer\": \"rHXUjUtk5eiPFYpg27izxHeZ1t4x835Ecn\"\n" + - " },\n" + - " \"Flags\": 2147483648,\n" + - " \"Sequence\": 6,\n" + - " \"Paths\": [[{\n" + - " \"account\": \"razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA\"\n" + - " }]],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"DestinationTag\": 736049272\n" + - " }"; + String json = + "{\n" + + " \"Account\": \"rHXUjUtk5eiPFYpg27izxHeZ1t4x835Ecn\",\n" + + " \"Destination\": \"r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK\",\n" + + " \"TransactionType\": \"Payment\",\n" + + " \"Amount\": {\n" + + " \"currency\": \"CNY\",\n" + + " \"value\": \"5000\",\n" + + " \"issuer\": \"r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK\"\n" + + " },\n" + + " \"Fee\": \"12\",\n" + + " \"SendMax\": {\n" + + " \"currency\": \"CNY\",\n" + + " \"value\": \"5050\",\n" + + " \"issuer\": \"rHXUjUtk5eiPFYpg27izxHeZ1t4x835Ecn\"\n" + + " },\n" + + " \"Flags\": 2147483648,\n" + + " \"Sequence\": 6,\n" + + " \"Paths\": [[{\n" + + " \"account\": \"razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA\"\n" + + " }]],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"DestinationTag\": 736049272\n" + + "}"; assertCanSerializeAndDeserialize(payment, json); } @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - Payment payment = Payment.builder() - .account(Address.of("r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb")) - .destination(Address.of("r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C")) - .amount(XrpCurrencyAmount.ofDrops(25000000)) - .fee(XrpCurrencyAmount.ofDrops(10)) - .flags(PaymentFlags.UNSET) - .sequence(UnsignedInteger.valueOf(2)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + - " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + - " \"TransactionType\": \"Payment\",\n" + - " \"Amount\": \"25000000\",\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": 0,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Sequence\": 2\n" + - " }"; - - assertCanSerializeAndDeserialize(payment, json); + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"r9TeThyi5xiuUUrFjtPKZiHcDxs7K9H6Rb\",\n" + + " \"Destination\": \"r4BPgS7DHebQiU31xWELvZawwSG2fSPJ7C\",\n" + + " \"TransactionType\": \"Payment\",\n" + + " \"Amount\": \"25000000\",\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 2\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java index 074f8984c..aa6860e0c 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,18 +25,33 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableSetRegularKey; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.SetRegularKey; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class SetRegularKeyJsonTest extends AbstractJsonTest { +public class SetRegularKeyJsonTest + extends AbstractTransactionJsonTest { - @Test - public void testSetRegularKeyJson() throws JsonProcessingException, JSONException { - SetRegularKey setRegularKey = SetRegularKey.builder() + /** + * No-args Constructor + */ + protected SetRegularKeyJsonTest() { + super(SetRegularKey.class, ImmutableSetRegularKey.class, TransactionType.SET_REGULAR_KEY); + } + + + @Override + protected ImmutableSetRegularKey.Builder builder() { + return ImmutableSetRegularKey.builder(); + } + + @Override + protected SetRegularKey fullyPopulatedTransaction() { + return SetRegularKey.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.ONE) @@ -46,70 +61,83 @@ public void testSetRegularKeyJson() throws JsonProcessingException, JSONExceptio ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SetRegularKey\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\"\n" + - "}"; - - assertCanSerializeAndDeserialize(setRegularKey, json); + @Override + protected SetRegularKey fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testSetRegularKeyJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - SetRegularKey setRegularKey = SetRegularKey.builder() + @Override + protected SetRegularKey minimallyPopulatedTransaction() { + return SetRegularKey.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + public void testSetRegularKeyJson() throws JsonProcessingException, JSONException { + + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SetRegularKey\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\"\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + public void testSetRegularKeyJsonWithUnsetFlags() throws JsonProcessingException, JSONException { + SetRegularKey transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SetRegularKey\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\"\n" + + String json = + "{\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\",\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"SetRegularKey\"\n" + "}"; - assertCanSerializeAndDeserialize(setRegularKey, json); + assertCanSerializeAndDeserialize(transaction, json); } @Test public void testSetRegularKeyJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - SetRegularKey setRegularKey = SetRegularKey.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + SetRegularKey transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SetRegularKey\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); - - assertCanSerializeAndDeserialize(setRegularKey, json); + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"TransactionType\": \"SetRegularKey\"\n" + + "}"; + + assertCanSerializeAndDeserialize(transaction, json); } @Test @@ -126,17 +154,18 @@ public void testJsonWithUnknownFields() throws JsonProcessingException, JSONExce .putUnknownFields("Foo", "Bar") .build(); - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SetRegularKey\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\"\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"NetworkID\": 1024,\n" + + " \"RegularKey\": \"rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD\",\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"SetRegularKey\"\n" + "}"; - assertCanSerializeAndDeserialize(setRegularKey, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java index c59eef731..42dd4f17f 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,20 +25,34 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.ledger.SignerEntry; import org.xrpl.xrpl4j.model.ledger.SignerEntryWrapper; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableSignerListSet; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.SignerListSet; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class SignerListSetJsonTests extends AbstractJsonTest { +public class SignerListSetJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testSignerListSetJson() throws JsonProcessingException, JSONException { - SignerListSet signerListSet = SignerListSet.builder() + /** + * No-args Constructor + */ + protected SignerListSetJsonTests() { + super(SignerListSet.class, ImmutableSignerListSet.class, TransactionType.SIGNER_LIST_SET); + } + + @Override + protected ImmutableSignerListSet.Builder builder() { + return ImmutableSignerListSet.builder(); + } + + @Override + protected SignerListSet fullyPopulatedTransaction() { + return SignerListSet.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.ONE) @@ -68,16 +82,39 @@ public void testSignerListSetJson() throws JsonProcessingException, JSONExceptio ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SignerListSet\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"SignerQuorum\": 3,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SignerEntries\": [\n" + + @Override + protected SignerListSet fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected SignerListSet minimallyPopulatedTransaction() { + return SignerListSet.builder() + .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) + .fee(XrpCurrencyAmount.ofDrops(12)) + .signerQuorum(UnsignedInteger.valueOf(3)) + .signingPublicKey( + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + ) + .build(); + } + + @Test + public void testSignerListSetJson() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SignerListSet\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"SignerQuorum\": 3,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SignerEntries\": [\n" + " {\n" + " \"SignerEntry\": {\n" + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + @@ -99,7 +136,7 @@ public void testSignerListSetJson() throws JsonProcessingException, JSONExceptio " ]\n" + "}"; - assertCanSerializeAndDeserialize(signerListSet, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @Test @@ -109,18 +146,21 @@ public void testSignerListSetForDeleteJson() throws JsonProcessingException, JSO .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.ONE) .signerQuorum(UnsignedInteger.ZERO) + .networkId(NetworkId.of(1024)) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) .build(); - String json = "{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SignerListSet\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SignerQuorum\": 0\n" + + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SignerListSet\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SignerQuorum\": 0\n" + "}"; assertCanSerializeAndDeserialize(signerListSet, json); @@ -128,83 +168,122 @@ public void testSignerListSetForDeleteJson() throws JsonProcessingException, JSO @Test public void testSignerListSetJsonWithUnsetFlags() throws JsonProcessingException, JSONException { - SignerListSet signerListSet = SignerListSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .signerQuorum(UnsignedInteger.ZERO) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + SignerListSet transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SignerListSet\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SignerQuorum\": 0\n" + + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SignerListSet\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SignerEntries\": [\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"SignerWeight\": 2\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"SignerQuorum\": 3\n" + "}"; - assertCanSerializeAndDeserialize(signerListSet, json); + assertCanSerializeAndDeserialize(transaction, json); } @Test public void testSignerListSetJsonWithNonZeroFlags() throws JsonProcessingException, JSONException { - SignerListSet signerListSet = SignerListSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .signerQuorum(UnsignedInteger.ZERO) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + + SignerListSet transaction = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SignerListSet\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SignerQuorum\": 0\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + String json = + "{\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SignerListSet\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SignerEntries\": [\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"SignerWeight\": 2\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"SignerQuorum\": 3\n" + + "}"; - assertCanSerializeAndDeserialize(signerListSet, json); + assertCanSerializeAndDeserialize(transaction, json); } @Test - public void testSignerListSetJsonWithNonZeroFlagstestJsonWithUnknownFields() - throws JsonProcessingException, JSONException { - SignerListSet signerListSet = SignerListSet.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .signerQuorum(UnsignedInteger.ZERO) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .flags(TransactionFlags.FULLY_CANONICAL_SIG) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = String.format("{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"SignerListSet\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"SignerQuorum\": 0\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + public void testSignerListSetJsonWithNonZeroFlagsWithUnknownFields() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"SignerListSet\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"SignerEntries\": [\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"SignerWeight\": 2\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " },\n" + + " {\n" + + " \"SignerEntry\": {\n" + + " \"Account\": \"raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n\",\n" + + " \"SignerWeight\": 1\n" + + " }\n" + + " }\n" + + " ],\n" + + " \"SignerQuorum\": 3\n" + + "}"; - assertCanSerializeAndDeserialize(signerListSet, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java index f7ea93204..4c38fd2bc 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,18 +25,33 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableTicketCreate; import org.xrpl.xrpl4j.model.transactions.NetworkId; import org.xrpl.xrpl4j.model.transactions.TicketCreate; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -class TicketCreateJsonTest extends AbstractJsonTest { +class TicketCreateJsonTest + extends AbstractTransactionJsonTest { - @Test - void testJson() throws JSONException, JsonProcessingException { - TicketCreate ticketCreate = TicketCreate.builder() + /** + * No-args Constructor + */ + protected TicketCreateJsonTest() { + super(TicketCreate.class, ImmutableTicketCreate.class, TransactionType.TICKET_CREATE); + } + + + @Override + protected ImmutableTicketCreate.Builder builder() { + return ImmutableTicketCreate.builder(); + } + + @Override + protected TicketCreate fullyPopulatedTransaction() { + return TicketCreate.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.ONE) @@ -46,41 +61,59 @@ void testJson() throws JSONException, JsonProcessingException { ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"TicketCreate\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 1,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TicketCount\": 200\n" + - "}"; - - assertCanSerializeAndDeserialize(ticketCreate, json); + @Override + protected TicketCreate fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - void testJsonWithUnsetFlags() throws JSONException, JsonProcessingException { - TicketCreate ticketCreate = TicketCreate.builder() + @Override + protected TicketCreate minimallyPopulatedTransaction() { + return TicketCreate.builder() .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) .ticketCount(UnsignedInteger.valueOf(200)) .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) + .build(); + } + + @Test + void testJson() throws JSONException, JsonProcessingException { + String json = + "{\n" + + " \"TransactionType\": \"TicketCreate\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 1,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TicketCount\": 200\n" + + "}"; + + assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); + } + + @Test + void testJsonWithUnsetFlags() throws JSONException, JsonProcessingException { + TicketCreate ticketCreate = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.UNSET) .build(); - String json = "{\n" + - " \"TransactionType\": \"TicketCreate\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TicketCount\": 200\n" + + String json = + "{\n" + + " \"TransactionType\": \"TicketCreate\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"TicketCount\": 200\n" + "}"; assertCanSerializeAndDeserialize(ticketCreate, json); @@ -88,55 +121,40 @@ void testJsonWithUnsetFlags() throws JSONException, JsonProcessingException { @Test void testJsonWithNonZeroFlags() throws JSONException, JsonProcessingException { - TicketCreate ticketCreate = TicketCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .ticketCount(UnsignedInteger.valueOf(200)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) + TicketCreate ticketCreate = builder().from(fullyPopulatedTransaction()) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - String json = String.format("{\n" + - " \"TransactionType\": \"TicketCreate\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TicketCount\": 200\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + String json = + "{\n" + + " \"TransactionType\": \"TicketCreate\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TicketCount\": 200\n" + + "}"; assertCanSerializeAndDeserialize(ticketCreate, json); } @Test void testJsonWithUnknownFields() throws JSONException, JsonProcessingException { - TicketCreate ticketCreate = TicketCreate.builder() - .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.ONE) - .ticketCount(UnsignedInteger.valueOf(200)) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"TicketCreate\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 1,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TicketCount\": 200\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"TicketCreate\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 1,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TicketCount\": 200\n" + "}"; - assertCanSerializeAndDeserialize(ticketCreate, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java index 09452f983..4e53de1b7 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,19 +25,33 @@ import org.json.JSONException; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.crypto.keys.PublicKey; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.flags.TrustSetFlags; import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.ImmutableTrustSet; import org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount; import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.TrustSet; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class TrustSetJsonTests extends AbstractJsonTest { +public class TrustSetJsonTests + extends AbstractTransactionJsonTest { - @Test - public void testMinimalTrustSetJson() throws JsonProcessingException, JSONException { - TrustSet trustSet = TrustSet.builder() + /** + * No-args Constructor + */ + protected TrustSetJsonTests() { + super(TrustSet.class, ImmutableTrustSet.class, TransactionType.TRUST_SET); + } + + @Override + protected ImmutableTrustSet.Builder builder() { + return ImmutableTrustSet.builder(); + } + + @Override + protected TrustSet fullyPopulatedTransaction() { + return TrustSet.builder() .account(Address.of("ra5nK24KXen9AHvsdFTKHSANinZseWnPcX")) .fee(XrpCurrencyAmount.ofDrops(12)) .flags(TrustSetFlags.builder() @@ -54,31 +68,20 @@ public void testMinimalTrustSetJson() throws JsonProcessingException, JSONExcept ) .networkId(NetworkId.of(1024)) .build(); + } - String json = "{\n" + - " \"TransactionType\": \"TrustSet\",\n" + - " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147745792,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"LimitAmount\": {\n" + - " \"currency\": \"USD\",\n" + - " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" + - " \"value\": \"100\"\n" + - " },\n" + - " \"NetworkID\": 1024,\n" + - " \"Sequence\": 12\n" + - "}"; - - assertCanSerializeAndDeserialize(trustSet, json); + @Override + protected TrustSet fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); } - @Test - public void testMinimalTrustSetJsonWithoutFlags() throws JsonProcessingException, JSONException { - TrustSet trustSet = TrustSet.builder() + @Override + protected TrustSet minimallyPopulatedTransaction() { + return TrustSet.builder() .account(Address.of("ra5nK24KXen9AHvsdFTKHSANinZseWnPcX")) .fee(XrpCurrencyAmount.ofDrops(12)) - .sequence(UnsignedInteger.valueOf(12)) .limitAmount(IssuedCurrencyAmount.builder() .currency("USD") .issuer(Address.of("rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc")) @@ -88,23 +91,54 @@ public void testMinimalTrustSetJsonWithoutFlags() throws JsonProcessingException PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") ) .build(); + } + + @Test + public void testMinimalTrustSetJson() throws JsonProcessingException, JSONException { + + TrustSet trustSet = builder().from(minimallyPopulatedTransaction()) + .flags(TrustSetFlags.builder() + .tfClearNoRipple() + .build()) + .build(); - String json = "{\n" + - " \"TransactionType\": \"TrustSet\",\n" + - " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + - " \"Fee\": \"12\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"LimitAmount\": {\n" + + String json = + "{\n" + + " \"TransactionType\": \"TrustSet\",\n" + + " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147745792,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"LimitAmount\": {\n" + " \"currency\": \"USD\",\n" + " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" + " \"value\": \"100\"\n" + " },\n" + - " \"Sequence\": 12\n" + + " \"Sequence\": 0\n" + "}"; assertCanSerializeAndDeserialize(trustSet, json); } + @Test + public void testMinimalTrustSetJsonWithoutFlags() throws JsonProcessingException, JSONException { + String json = + "{\n" + + " \"TransactionType\": \"TrustSet\",\n" + + " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + + " \"Fee\": \"12\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"LimitAmount\": {\n" + + " \"currency\": \"USD\",\n" + + " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" + + " \"value\": \"100\"\n" + + " },\n" + + " \"Sequence\": 0\n" + + "}"; + + assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); + } + @Test public void testTrustSetWithQualityJson() throws JsonProcessingException, JSONException { TrustSet trustSet = TrustSet.builder() @@ -126,20 +160,21 @@ public void testTrustSetWithQualityJson() throws JsonProcessingException, JSONEx ) .build(); - String json = "{\n" + - " \"TransactionType\": \"TrustSet\",\n" + - " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147745792,\n" + - " \"LimitAmount\": {\n" + + String json = + "{\n" + + " \"TransactionType\": \"TrustSet\",\n" + + " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147745792,\n" + + " \"LimitAmount\": {\n" + " \"currency\": \"USD\",\n" + " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" + " \"value\": \"100\"\n" + " },\n" + - " \"Sequence\": 12,\n" + - " \"QualityIn\": 100,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"QualityOut\": 100\n" + + " \"Sequence\": 12,\n" + + " \"QualityIn\": 100,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"QualityOut\": 100\n" + "}"; assertCanSerializeAndDeserialize(trustSet, json); @@ -147,41 +182,23 @@ public void testTrustSetWithQualityJson() throws JsonProcessingException, JSONEx @Test public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { - TrustSet trustSet = TrustSet.builder() - .account(Address.of("ra5nK24KXen9AHvsdFTKHSANinZseWnPcX")) - .fee(XrpCurrencyAmount.ofDrops(12)) - .flags(TrustSetFlags.builder() - .tfClearNoRipple() - .build()) - .sequence(UnsignedInteger.valueOf(12)) - .limitAmount(IssuedCurrencyAmount.builder() - .currency("USD") - .issuer(Address.of("rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc")) - .value("100") - .build()) - .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") - ) - .networkId(NetworkId.of(1024)) - .putUnknownFields("Foo", "Bar") - .build(); - - String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"TrustSet\",\n" + - " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147745792,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"LimitAmount\": {\n" + + String json = + "{\n" + + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"TrustSet\",\n" + + " \"Account\": \"ra5nK24KXen9AHvsdFTKHSANinZseWnPcX\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147745792,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"LimitAmount\": {\n" + " \"currency\": \"USD\",\n" + " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" + " \"value\": \"100\"\n" + " },\n" + - " \"NetworkID\": 1024,\n" + - " \"Sequence\": 12\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 12\n" + "}"; - assertCanSerializeAndDeserialize(trustSet, json); + assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java index 3ffb7f54c..7c9a55d54 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java @@ -25,23 +25,60 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.primitives.UnsignedInteger; -import com.google.common.primitives.UnsignedLong; -import org.assertj.core.api.Assertions; import org.json.JSONException; import org.junit.jupiter.api.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; -import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; import org.xrpl.xrpl4j.model.transactions.ImmutableUnlModify; import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -import java.util.Collections; -import java.util.Map; +public class UnlModifyJsonTests + extends AbstractTransactionJsonTest { -public class UnlModifyJsonTests extends AbstractJsonTest { + /** + * No-args Constructor + */ + protected UnlModifyJsonTests() { + super(UnlModify.class, ImmutableUnlModify.class, TransactionType.UNL_MODIFY); + } + + @Override + protected ImmutableUnlModify.Builder builder() { + return ImmutableUnlModify.builder(); + } + + @Override + protected UnlModify fullyPopulatedTransaction() { + return UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .build(); + } + + @Override + protected UnlModify fullyPopulatedTransactionWithUnknownFields() { + return builder().from(fullyPopulatedTransaction()) + .putUnknownFields("Foo", "Bar") + .build(); + } + + @Override + protected UnlModify minimallyPopulatedTransaction() { + return UnlModify.builder() + .fee(XrpCurrencyAmount.ofDrops(12)) + .sequence(UnsignedInteger.valueOf(2470665)) + .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) + .unlModifyValidator("EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539") + .unlModifyDisabling(UnsignedInteger.valueOf(1)) + .build(); + } @Test public void testJsonWithAccountZero() throws JsonProcessingException, JSONException { @@ -54,14 +91,14 @@ public void testJsonWithAccountZero() throws JsonProcessingException, JSONExcept .build(); String json = "{" + - "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; assertCanSerializeAndDeserialize(unlModify, json); } @@ -78,15 +115,15 @@ public void testJsonWithAccountZeroAndUnknownFields() throws JsonProcessingExcep .build(); String json = "{" + - "\"Foo\" : \"Bar\",\n" + - "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Foo\" : \"Bar\",\n" + + "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; assertCanSerializeAndDeserialize(unlModify, json); } @@ -103,32 +140,32 @@ public void testJsonWithEmptyAccount() throws JsonProcessingException, JSONExcep // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize - String expectedDeserializedJson = "{" + - "\"Account\":\"\"," + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; - - Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); + String jsonForDeserialization = "{" + + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); } @@ -145,34 +182,34 @@ public void testJsonWithEmptyAccountAndUnknownFields() throws JsonProcessingExce // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize - String expectedDeserializedJson = "{" + - "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! - "\"Account\":\"\"," + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; - - Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); + String jsonForDeserialization = "{" + + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); } @@ -186,27 +223,29 @@ public void testJsonWithMissingAccount() throws JsonProcessingException, JSONExc .unlModifyDisabling(UnsignedInteger.valueOf(1)) .build(); - String expectedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + // What we expect the ObjectMapper to Serialize (given the above object) + String expectedSerializedJson = "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; String serialized = objectMapper.writeValueAsString(unlModify); - JSONAssert.assertEquals(expectedJson, serialized, JSONCompareMode.STRICT); + JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); - String jsonForDeserialization = "{" + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + // What we provide the ObjectMapper to Deserialize + String jsonForDeserialization = "{" + // <-- The crux of the test (i.e., missing account) + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); @@ -215,6 +254,7 @@ public void testJsonWithMissingAccount() throws JsonProcessingException, JSONExc @Test public void testJsonWithMissingAccountAndUnknownFields() throws JsonProcessingException, JSONException { UnlModify unlModify = UnlModify.builder() + .putUnknownFields("Foo", "Bar") .fee(XrpCurrencyAmount.ofDrops(12)) .sequence(UnsignedInteger.valueOf(2470665)) .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(67850752))) @@ -224,86 +264,37 @@ public void testJsonWithMissingAccountAndUnknownFields() throws JsonProcessingEx // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Foo\" : \"Bar\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize - String expectedDeserializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; - - Transaction deserialized = objectMapper.readValue(expectedDeserializedJson, Transaction.class); - assertThat(deserialized).isEqualTo(unlModify); + String jsonForDeserialization = "{" + // <-- The crux of the test (i.e., missing account) + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; + + Transaction deserializedTransaction = objectMapper.readValue(jsonForDeserialization, Transaction.class); + assertThat(deserializedTransaction).isEqualTo(unlModify); + UnlModify deserializedInterface = objectMapper.readValue(jsonForDeserialization, UnlModify.class); + assertThat(deserializedInterface).isEqualTo(unlModify); + ImmutableUnlModify deserializedImmutable = objectMapper.readValue(jsonForDeserialization, ImmutableUnlModify.class); + assertThat(deserializedImmutable).isEqualTo(unlModify); } - - // Using Transcation - // Using Immutable - // Using UnlModify - -// @Test -// public void testDeserializeJson() throws JsonProcessingException { -// String json = "{" + -// "\"Account\":\"\"," + -// "\"Fee\":\"0\"," + -// "\"LedgerSequence\":94084608," + -// "\"Sequence\":0," + -// "\"SigningPubKey\":\"\"," + -// "\"TransactionType\":\"UNLModify\"," + -// "\"UNLModifyDisabling\":1," + -// "\"UNLModifyValidator\":\"ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818\"}"; -// UnlModify deserialized = objectMapper.readValue(json, UnlModify.class); -// -// UnlModify expectedUnlModify = UnlModify.builder() -// .fee(XrpCurrencyAmount.ofDrops(0)) -// .sequence(UnsignedInteger.ZERO) -// .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(94084608))) -// .unlModifyDisabling(UnsignedInteger.ONE) -// .unlModifyValidator("ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818") -// .build(); -// -// Assertions.assertThat(deserialized).isEqualTo(expectedUnlModify); -// } -// -// @Test -// public void testDeserializeJsonUsingImmutable() throws JsonProcessingException { -// String json = "{" + -// "\"Account\":\"\"," + -// "\"Fee\":\"0\"," + -// "\"LedgerSequence\":94084608," + -// "\"Sequence\":0," + -// "\"SigningPubKey\":\"\"," + -// "\"TransactionType\":\"UNLModify\"," + -// "\"UNLModifyDisabling\":1," + -// "\"UNLModifyValidator\":\"ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818\"}"; -// Transaction deserialized = objectMapper.readValue(json, Transaction.class); -// -// UnlModify expectedUnlModify = UnlModify.builder() -// .fee(XrpCurrencyAmount.ofDrops(0)) -// .sequence(UnsignedInteger.ZERO) -// .ledgerSequence(LedgerIndex.of(UnsignedInteger.valueOf(94084608))) -// .unlModifyDisabling(UnsignedInteger.ONE) -// .unlModifyValidator("ED63CF929BE85B266A66584B3FE2EB97FC248203F0271DC9C833563E60418E7818") -// .build(); -// -// Assertions.assertThat(deserialized).isEqualTo(expectedUnlModify); -// } - - } From f3241066066daaaa3e68de5c64085eb80c989d56 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 11:00:55 -0500 Subject: [PATCH 04/13] Formatting --- .../model/transactions/AccountDelete.java | 8 ++--- .../xrpl4j/model/transactions/AccountSet.java | 16 ++++----- .../xrpl4j/model/transactions/AmmBid.java | 14 ++++---- .../xrpl4j/model/transactions/AmmCreate.java | 10 +++--- .../xrpl4j/model/transactions/AmmDelete.java | 8 ++--- .../xrpl4j/model/transactions/AmmDeposit.java | 18 +++++----- .../xrpl4j/model/transactions/AmmVote.java | 10 +++--- .../model/transactions/AmmWithdraw.java | 16 ++++----- .../model/transactions/CheckCancel.java | 6 ++-- .../model/transactions/CurrencyAmount.java | 1 - .../model/transactions/DepositPreAuth.java | 7 ++-- .../xrpl4j/model/transactions/DidDelete.java | 2 -- .../transactions/IssuedCurrencyAmount.java | 1 - .../xrpl/xrpl4j/model/transactions/Memo.java | 7 ++-- .../model/transactions/MemoWrapper.java | 4 +-- .../xrpl4j/model/transactions/PathStep.java | 4 +-- .../xrpl4j/model/transactions/Payment.java | 20 +++++------ .../xrpl4j/model/transactions/PriceData.java | 1 - .../model/transactions/SignerWrapper.java | 5 ++- .../model/transactions/Transaction.java | 34 +++++++++---------- .../transactions/TransactionResultCodes.java | 4 +-- .../model/transactions/TransactionType.java | 1 - 22 files changed, 90 insertions(+), 107 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index 2891f9a56..94b85a03e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -37,7 +37,7 @@ @JsonSerialize(as = ImmutableAccountDelete.class) @JsonDeserialize(as = ImmutableAccountDelete.class) public interface AccountDelete extends Transaction { - + /** * Construct a builder for this class. * @@ -46,7 +46,7 @@ public interface AccountDelete extends Transaction { static ImmutableAccountDelete.Builder builder() { return ImmutableAccountDelete.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AccountDelete}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -61,7 +61,7 @@ static ImmutableAccountDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The {@link Address} of an account to receive any leftover XRP after deleting the sending account. Must be a funded * account in the ledger, and must not be the sending account. @@ -70,7 +70,7 @@ default TransactionFlags flags() { */ @JsonProperty("Destination") Address destination(); - + /** * Arbitrary destination tag that identifies a hosted recipient or other information for the recipient of the deleted * account's leftover XRP. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 119bb77e6..18a70a7d9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -130,7 +130,7 @@ default AccountSet normalizeClearFlag() { Preconditions.checkState( clearFlag().get().getValue() == clearFlagRawValue().get().longValue(), String.format("clearFlag and clearFlagRawValue should be equivalent, but clearFlag's underlying " + - "value was %s and clearFlagRawValue was %s", + "value was %s and clearFlagRawValue was %s", clearFlag().get().getValue(), clearFlagRawValue().get().longValue() ) @@ -223,7 +223,7 @@ default AccountSet normalizeSetFlag() { Preconditions.checkState( setFlag().get().getValue() == setFlagRawValue().get().longValue(), String.format("setFlag and setFlagRawValue should be equivalent, but setFlag's underlying " + - "value was %s and setFlagRawValue was %s", + "value was %s and setFlagRawValue was %s", setFlag().get().getValue(), setFlagRawValue().get().longValue() ) @@ -350,8 +350,8 @@ default void checkTransferRate() { transferRate() .ifPresent(rate -> Preconditions.checkArgument(rate.equals(UnsignedInteger.ZERO) || - (rate.compareTo(UnsignedInteger.valueOf(1000000000L)) >= 0 && - rate.compareTo(UnsignedInteger.valueOf(2000000000L)) <= 0), + (rate.compareTo(UnsignedInteger.valueOf(1000000000L)) >= 0 && + rate.compareTo(UnsignedInteger.valueOf(2000000000L)) <= 0), "transferRate must be between 1,000,000,000 and 2,000,000,000 or equal to 0." ) ); @@ -365,14 +365,14 @@ default void checkTickSize() { tickSize() .ifPresent(tickSize -> Preconditions.checkArgument(tickSize.equals(UnsignedInteger.ZERO) || - (tickSize.compareTo(UnsignedInteger.valueOf(3)) >= 0 && - tickSize.compareTo(UnsignedInteger.valueOf(15)) <= 0), + (tickSize.compareTo(UnsignedInteger.valueOf(3)) >= 0 && + tickSize.compareTo(UnsignedInteger.valueOf(15)) <= 0), "tickSize must be between 3 and 15 inclusive or be equal to 0." ) ); } - + /** * There are several options which can be either enabled or disabled for an account. Account options are represented * by different types of flags depending on the situation. @@ -491,9 +491,7 @@ enum AccountSetFlag { * annotation, otherwise Jackson treats the JSON integer value as an ordinal. * * @param value The int value of the flag. - * * @return The {@link AccountSetFlag} for the given integer value. - * * @see "https://github.com/FasterXML/jackson-databind/issues/1850" */ @JsonCreator diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index a9c33a12f..09d6b65cf 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -23,7 +23,7 @@ @JsonDeserialize(as = ImmutableAmmBid.class) @Beta public interface AmmBid extends Transaction { - + /** * Construct a {@code AmmBid} builder. * @@ -32,7 +32,7 @@ public interface AmmBid extends Transaction { static ImmutableAmmBid.Builder builder() { return ImmutableAmmBid.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmBid}, which only allows the {@code tfFullyCanonicalSig} flag, * which is deprecated. @@ -47,7 +47,7 @@ static ImmutableAmmBid.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -55,7 +55,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -63,7 +63,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * Pay at least this amount for the slot. Setting this value higher makes it harder for others to outbid you. If * omitted, pay the minimum necessary to win the bid. @@ -80,7 +80,7 @@ default TransactionFlags flags() { */ @JsonProperty("BidMin") Optional bidMin(); - + /** * Pay at most this amount for the slot. If the cost to win the bid is higher than this amount, the transaction fails. * If omitted, pay as much as necessary to win the bid. @@ -97,7 +97,7 @@ default TransactionFlags flags() { */ @JsonProperty("BidMax") Optional bidMax(); - + /** * A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the * address of the transaction sender diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index 6af69be68..9427719b4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -18,7 +18,7 @@ @JsonDeserialize(as = ImmutableAmmCreate.class) @Beta public interface AmmCreate extends Transaction { - + /** * Construct a {@code AmmCreate} builder. * @@ -27,7 +27,7 @@ public interface AmmCreate extends Transaction { static ImmutableAmmCreate.Builder builder() { return ImmutableAmmCreate.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmCreate}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -42,7 +42,7 @@ static ImmutableAmmCreate.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The first of the two assets to fund this AMM with. * @@ -50,7 +50,7 @@ default TransactionFlags flags() { */ @JsonProperty("Amount") CurrencyAmount amount(); - + /** * The second of the two assets to fund this AMM with. * @@ -58,7 +58,7 @@ default TransactionFlags flags() { */ @JsonProperty("Amount2") CurrencyAmount amount2(); - + /** * The fee to charge for trades against this AMM instance. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index ca53791d9..d58cbaf98 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -20,7 +20,7 @@ @JsonDeserialize(as = ImmutableAmmDelete.class) @Beta public interface AmmDelete extends Transaction { - + /** * Construct a {@code AmmDelete} builder. * @@ -29,7 +29,7 @@ public interface AmmDelete extends Transaction { static ImmutableAmmDelete.Builder builder() { return ImmutableAmmDelete.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmDelete}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -41,7 +41,7 @@ static ImmutableAmmDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -49,7 +49,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java index afd05f906..72bc376c0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java @@ -21,7 +21,7 @@ @JsonDeserialize(as = ImmutableAmmDeposit.class) @Beta public interface AmmDeposit extends Transaction { - + /** * Construct a {@code AmmDeposit} builder. * @@ -30,7 +30,7 @@ public interface AmmDeposit extends Transaction { static ImmutableAmmDeposit.Builder builder() { return ImmutableAmmDeposit.builder(); } - + /** * A {@link AmmDepositFlags} for this transaction. This field must be set manually. * @@ -38,7 +38,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Flags") AmmDepositFlags flags(); - + /** * The definition for one of the assets in the AMM's pool. * @@ -46,7 +46,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -54,7 +54,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or * XRP) in the AMM's pool. @@ -63,7 +63,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Amount") Optional amount(); - + /** * The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's * pool and cannot be the same asset as Amount. @@ -72,7 +72,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("Amount2") Optional amount2(); - + /** * The maximum effective price, in the deposit asset, to pay for each LP Token received. * @@ -80,7 +80,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("EPrice") Optional effectivePrice(); - + /** * How many of the AMM's LP Tokens to buy. * @@ -96,7 +96,7 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("LPTokenOut") Optional lpTokenOut(); - + /** * An optional {@link TradingFee} to set on the AMM instance. This field is only honored if the AMM's LP token balance * is zero, and can only be set if flags is {@link AmmDepositFlags#TWO_ASSET_IF_EMPTY}. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index 3d0188679..d0059c14c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -19,7 +19,7 @@ @JsonDeserialize(as = ImmutableAmmVote.class) @Beta public interface AmmVote extends Transaction { - + /** * Construct a {@code AmmVote} builder. * @@ -28,7 +28,7 @@ public interface AmmVote extends Transaction { static ImmutableAmmVote.Builder builder() { return ImmutableAmmVote.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link AmmVote}, which only allows the {@code tfFullyCanonicalSig} flag, * which is deprecated. @@ -43,7 +43,7 @@ static ImmutableAmmVote.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The definition for one of the assets in the AMM's pool. * @@ -51,7 +51,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -59,7 +59,7 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The proposed fee to vote for. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index 34308e4f7..6ab1075ec 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -21,7 +21,7 @@ @JsonDeserialize(as = ImmutableAmmWithdraw.class) @Beta public interface AmmWithdraw extends Transaction { - + /** * Construct a {@code AmmWithdraw} builder. * @@ -30,7 +30,7 @@ public interface AmmWithdraw extends Transaction { static ImmutableAmmWithdraw.Builder builder() { return ImmutableAmmWithdraw.builder(); } - + /** * A {@link AmmWithdrawFlags} for this transaction. * @@ -38,7 +38,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Flags") AmmWithdrawFlags flags(); - + /** * The definition for one of the assets in the AMM's pool. * @@ -46,7 +46,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Asset") Issue asset(); - + /** * The definition for the other asset in the AMM's pool. * @@ -54,7 +54,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Asset2") Issue asset2(); - + /** * The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or * XRP) in the AMM's pool. @@ -63,7 +63,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Amount") Optional amount(); - + /** * The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's * pool and cannot be the same asset as Amount. @@ -72,7 +72,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("Amount2") Optional amount2(); - + /** * The maximum effective price, in the deposit asset, to pay for each LP Token received. * @@ -80,7 +80,7 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("EPrice") Optional effectivePrice(); - + /** * How many of the AMM's LP Tokens to buy. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 2f3fdec1b..27a590303 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -35,7 +35,7 @@ @JsonSerialize(as = ImmutableCheckCancel.class) @JsonDeserialize(as = ImmutableCheckCancel.class) public interface CheckCancel extends Transaction { - + /** * Construct a builder for this class. * @@ -44,7 +44,7 @@ public interface CheckCancel extends Transaction { static ImmutableCheckCancel.Builder builder() { return ImmutableCheckCancel.builder(); } - + /** * Set of {@link TransactionFlags}s for this {@link CheckCancel}, which only allows the {@code tfFullyCanonicalSig} * flag, which is deprecated. @@ -59,7 +59,7 @@ static ImmutableCheckCancel.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } - + /** * The ID of the Check ledger object to cancel, as a 64-character hexadecimal string. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java index bb088f5ab..5e59abe89 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java @@ -76,7 +76,6 @@ default void handle( * @param issuedCurrencyAmountMapper A {@link Function} that is called if this instance is of type * {@link IssuedCurrencyAmount}. * @param The type of object to return after mapping. - * * @return A {@link R} that is constructed by the appropriate mapper function. */ default R map( diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index c163f798a..f71f852ad 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.base.Preconditions; import org.immutables.value.Value; -import org.immutables.value.Value.Derived; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import java.util.Optional; @@ -90,7 +89,7 @@ default TransactionFlags flags() { @Value.Check default void validateFieldPresence() { Preconditions.checkArgument((authorize().isPresent() || unauthorize().isPresent()) && - !(authorize().isPresent() && unauthorize().isPresent()), + !(authorize().isPresent() && unauthorize().isPresent()), "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index 965760d3f..d55b8fdc4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -8,8 +8,6 @@ import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; -import java.util.Optional; - /** * Object mapping for the {@code DIDDelete} transaction. * diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java index db01b1740..f109db9ea 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java @@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.immutables.value.Value; import org.immutables.value.Value.Auxiliary; -import org.immutables.value.Value.Default; import org.immutables.value.Value.Derived; /** diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java index bc7777934..0ed27bcd1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -51,7 +51,6 @@ public abstract class Memo { * Construct a {@link ImmutableMemo.Builder} by properly hex-encoding {@code plaintext}. * * @param plaintext A UTF-8 {@link String}. - * * @return A {@link ImmutableMemo.Builder}. */ public static ImmutableMemo.Builder withPlaintext(final String plaintext) { @@ -112,7 +111,6 @@ void check() { * Determines if an input string is hex-encoded. * * @param input A {@link String}. - * * @return {@code true} if every character in {@code input} is hex-encoded; {@code false} otherwise. */ private static boolean isHex(final String input) { @@ -130,7 +128,6 @@ private static boolean isHex(final String input) { * Determines if an input char is hex-encoded. * * @param input A {@link char}. - * * @return {@code true} if {@code input} is hex-encoded; {@code false} otherwise. */ private static boolean isHex(final char input) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java index aaa81c5f1..8f70ee773 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java index e8ac3feb1..0b1671682 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 77d28a6c6..19472912a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -40,7 +40,7 @@ @JsonSerialize(as = ImmutablePayment.class) @JsonDeserialize(as = ImmutablePayment.class) public interface Payment extends Transaction { - + /** * Construct a builder for this class. * @@ -49,7 +49,7 @@ public interface Payment extends Transaction { static ImmutablePayment.Builder builder() { return ImmutablePayment.builder(); } - + /** * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a * {@link PaymentFlags} object containing the {@link Long} representation of the set bits. @@ -63,7 +63,7 @@ static ImmutablePayment.Builder builder() { default PaymentFlags flags() { return PaymentFlags.empty(); } - + /** * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to this * amount instead. @@ -72,7 +72,7 @@ default PaymentFlags flags() { */ @JsonProperty("Amount") CurrencyAmount amount(); - + /** * The unique {@link Address} of the account receiving the payment. Maybe be empty for an AccountSet or other * transaction that is not a payment. @@ -81,7 +81,7 @@ default PaymentFlags flags() { */ @JsonProperty("Destination") Address destination(); - + /** * Arbitrary {@link UnsignedInteger} tag that identifies the reason for the payment to the destination, or a hosted * recipient to pay. @@ -90,7 +90,7 @@ default PaymentFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); - + /** * Arbitrary 256-bit hash representing a specific reason or identifier for this payment. * @@ -98,7 +98,7 @@ default PaymentFlags flags() { */ @JsonProperty("InvoiceID") Optional invoiceId(); - + /** * A {@link List} of {@link List}s of payment paths to be used for this transaction. Must be omitted for XRP-to-XRP * transactions. @@ -106,12 +106,11 @@ default PaymentFlags flags() { *

    This field is auto-fillable * * @return A {@link List} of {@link List}s of {@link PathStep}s. - * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @JsonProperty("Paths") List> paths(); - + /** * Highest amount of source currency this transaction is allowed to cost, including transfer fees, exchange rates, and * slippage. Does not include the XRP destroyed as a cost for submitting the transaction. @@ -119,13 +118,12 @@ default PaymentFlags flags() { *

    Must be supplied for cross-currency/cross-issue payments. Must be omitted for XRP-to-XRP payments. * * @return An {@link Optional} of type {@link CurrencyAmount}. - * * @see "https://xrpl.org/transfer-fees.html" * @see "https://en.wikipedia.org/wiki/Slippage_%28finance%29" */ @JsonProperty("SendMax") Optional sendMax(); - + /** * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the * {@link PaymentFlags#tfPartialPayment()}* flag is set. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PriceData.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PriceData.java index c14e04c61..18d85b7ce 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PriceData.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PriceData.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; import com.google.common.primitives.UnsignedInteger; -import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value.Immutable; import java.util.Optional; diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java index 0229f153a..870a0a7c6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -46,7 +46,6 @@ static ImmutableSignerWrapper.Builder builder() { * Construct a {@link SignerWrapper} wrapping the given {@link Signer}. * * @param signer A {@link Signer}. - * * @return A {@link SignerWrapper}. */ static SignerWrapper of(Signer signer) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java index 1856b2344..b93e44985 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java @@ -39,7 +39,7 @@ * Provides an abstract interface for all concrete XRPL transactions. */ public interface Transaction { - + /** * A bidirectional map of immutable transaction types to their corresponding {@link TransactionType}. * @@ -95,7 +95,7 @@ public interface Transaction { .put(ImmutableOracleDelete.class, TransactionType.ORACLE_DELETE) .put(ImmutableUnknownTransaction.class, TransactionType.UNKNOWN) .build(); - + /** * The unique {@link Address} of the account that initiated this transaction. * @@ -103,7 +103,7 @@ public interface Transaction { */ @JsonProperty("Account") Address account(); - + /** * The type of transaction. * @@ -123,7 +123,7 @@ public interface Transaction { default TransactionType transactionType() { return typeMap.get(this.getClass()); } - + /** * The {@link String} representation of an integer amount of XRP, in drops, to be destroyed as a cost for distributing * this Payment transaction to the network. @@ -131,12 +131,11 @@ default TransactionType transactionType() { *

    This field is auto-fillable * * @return An {@link XrpCurrencyAmount} representing the transaction cost. - * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @JsonProperty("Fee") XrpCurrencyAmount fee(); - + /** * The sequence number of the account submitting the {@link Transaction}. A {@link Transaction} is only valid if the * Sequence number is exactly 1 greater than the previous transaction from the same account. @@ -144,7 +143,6 @@ default TransactionType transactionType() { *

    This field is auto-fillable * * @return An {@link UnsignedInteger} representing the sequence of the transaction. - * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @Value.Default @@ -152,7 +150,7 @@ default TransactionType transactionType() { default UnsignedInteger sequence() { return UnsignedInteger.ZERO; } - + /** * The sequence number of the {@link org.xrpl.xrpl4j.model.ledger.TicketObject} to use in place of a * {@link #sequence()} number. If this is provided, {@link #sequence()} must be 0. Cannot be used with @@ -162,7 +160,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("TicketSequence") Optional ticketSequence(); - + /** * Hash value identifying another transaction. If provided, this {@link Transaction} is only valid if the sending * account's previously-sent transaction matches the provided hash. @@ -171,7 +169,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("AccountTxnID") Optional accountTransactionId(); - + /** * Highest ledger index this transaction can appear in. Specifying this field places a strict upper limit on how long * the transaction can wait to be validated or rejected. @@ -180,7 +178,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("LastLedgerSequence") Optional lastLedgerSequence(); - + /** * Additional arbitrary information used to identify this {@link Transaction}. * @@ -188,7 +186,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("Memos") List memos(); - + /** * Array of {@link SignerWrapper}s that represent a multi-signature which authorizes this {@link Transaction}. * @@ -196,7 +194,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("Signers") List signers(); - + /** * Arbitrary {@link UnsignedInteger} used to identify the reason for this {@link Transaction}, or a sender on whose * behalf this {@link Transaction} is made. @@ -205,7 +203,7 @@ default UnsignedInteger sequence() { */ @JsonProperty("SourceTag") Optional sourceTag(); - + /** * The {@link PublicKey} that corresponds to the private key used to sign this transaction. If an empty string, ie * {@link PublicKey#MULTI_SIGN_PUBLIC_KEY}, indicates a multi-signature is present in the @@ -220,7 +218,7 @@ default UnsignedInteger sequence() { default PublicKey signingPublicKey() { return PublicKey.MULTI_SIGN_PUBLIC_KEY; } - + /** * The signature that verifies this transaction as originating from the account it says it is from. * @@ -230,12 +228,12 @@ default PublicKey signingPublicKey() { */ @JsonProperty("TxnSignature") Optional transactionSignature(); - + @JsonProperty("NetworkID") Optional networkId(); - + @JsonAnyGetter @JsonInclude(Include.NON_ABSENT) Map unknownFields(); - + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java index 1df462bed..10705bd3e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java index 0beefb089..98befdc2b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java @@ -353,7 +353,6 @@ public enum TransactionType { * Gets an instance of {@link TransactionType} for the given string value. * * @param value The {@link String} value corresponding to a {@link TransactionType}. - * * @return The {@link TransactionType} with the corresponding value. */ public static TransactionType forValue(String value) { From ae3a8ed8d843b87624215f3d219720703a682ed6 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 11:02:25 -0500 Subject: [PATCH 05/13] Cleanup & Formatting --- .../model/jackson/modules/Xrpl4jModule.java | 35 +++++-------------- .../transactions/UnlModifyDeserializer.java | 6 ---- 2 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java index aca929515..bf9f89bbf 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java @@ -27,18 +27,16 @@ import org.xrpl.xrpl4j.model.client.serverinfo.ServerInfo; import org.xrpl.xrpl4j.model.flags.Flags; import org.xrpl.xrpl4j.model.transactions.CurrencyAmount; -import org.xrpl.xrpl4j.model.transactions.ImmutableUnlModify; import org.xrpl.xrpl4j.model.transactions.Transaction; -import org.xrpl.xrpl4j.model.transactions.UnlModify; import org.xrpl.xrpl4j.model.transactions.metadata.AffectedNode; /** * Jackson module for the xrpl4j-model project. */ public class Xrpl4jModule extends SimpleModule { - + private static final String NAME = "Xrpl4jModule"; - + /** * No-arg constructor. */ @@ -54,36 +52,21 @@ public Xrpl4jModule() { "xrpl4j" ) ); - + addDeserializer(CurrencyAmount.class, new CurrencyAmountDeserializer()); - + addSerializer(LedgerIndex.class, new LedgerIndexSerializer()); addDeserializer(LedgerIndex.class, new LedgerIndexDeserializer()); - - // TODO - // addSerializer(UnlModify.class, new UnlModifyTransactionSerializer()); + addDeserializer(Transaction.class, new TransactionDeserializer<>()); - + addDeserializer(ServerInfo.class, new ServerInfoDeserializer()); - + addSerializer(UnsignedByteArray.class, new UnsignedByteArraySerializer()); addDeserializer(UnsignedByteArray.class, new UnsignedByteArrayDeserializer()); - + addSerializer(Flags.class, new FlagsSerializer()); - + addDeserializer(AffectedNode.class, new AffectedNodeDeserializer()); - - - // // Add the custom serializer using a BeanSerializerModifier - // setSerializerModifier(new BeanSerializerModifier() { - // @Override - // public JsonSerializer modifySerializer(SerializationConfig config, BeanDescription beanDesc, - // JsonSerializer serializer) { - // if (Transaction.class.isAssignableFrom(beanDesc.getBeanClass())) { // Check if it's a Transaction - // return new TransactionSerializer(); - // } - // return serializer; // Return the original serializer if not a Transaction - // } - // }); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java deleted file mode 100644 index 349d885c4..000000000 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/transactions/UnlModifyDeserializer.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.xrpl.xrpl4j.model.jackson.modules.transactions; - -import org.xrpl.xrpl4j.model.jackson.modules.TransactionDeserializer; - -public class UnlModifyDeserializer extends TransactionDeserializer { -} From f1f2bd8e2d7be4370b99d0f24394fad9f32ed874 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 11:26:55 -0500 Subject: [PATCH 06/13] Misc Cleanup --- .../modules/TransactionDeserializer.java | 52 +++-------- .../UnlModifyTransactionSerializer.java | 92 ------------------- 2 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index b0b57823f..0d2e23bbc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -28,69 +28,39 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import org.xrpl.xrpl4j.model.transactions.Transaction; import org.xrpl.xrpl4j.model.transactions.TransactionType; -import org.xrpl.xrpl4j.model.transactions.UnknownTransaction; import org.xrpl.xrpl4j.model.transactions.UnlModify; import java.io.IOException; -import java.util.Objects; /** * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the * TransactionType JSON field. */ public class TransactionDeserializer extends StdDeserializer { - - private final Class clazz; - + /** * No-args constructor. */ protected TransactionDeserializer() { super(Transaction.class); - this.clazz = (Class) Transaction.class; } - - /** - * No-args constructor. - */ - protected TransactionDeserializer(final Class clazz) { - super(Transaction.class); - this.clazz = Objects.requireNonNull(clazz); - } - + @Override public T deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec(); ObjectNode objectNode = objectMapper.readTree(jsonParser); - + JsonNode node = objectNode.get("TransactionType"); TransactionType transactionType = TransactionType.forValue(node.asText()); + @SuppressWarnings("unchecked") Class transactionTypeClass = (Class) Transaction.typeMap.inverse().get(transactionType); - - // TODO: DELETE (no longer needed - // If the transaction is of type `UnknownTransaction`, the `TransactionType` property must _not_ be removed. Thi - // is so that the derived functions related to `TransactionType` in that class operate properly. However, for all - // _other_ transaction types, the `TransactionType` property _must_ be removed so that it doesn't errantly show up - // in the `unknownTransactionType` map. This approach works because every subclass of `Transaction` has a derived - // Java method that specifies the type (thus allowing us to ignore this fiele in the general case). -// if (!UnknownTransaction.class.isAssignableFrom(transactionTypeClass)) { -// objectNode.remove("TransactionType"); -// } - - // If the transaction is of type `UnlModify`, then remove the `Account` property. This is because the JSON returned - // by the rippled/clio API v1 has a bug where the account value is often an empty string. For this particular - // transaction type (i.e., `UnlModify`) the Java value for the account is always set to ACCOUNT_ZERO via a default - // method, so we remove this value from the JSON before deserialization because (1) it's not needed (the default - // method handles population in Java) and (2) if not removed, this field will end up in the `unknownFields` - // property, which is incorrect. -// if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { -// // if (objectNode.get("Account").isEmpty()) { -// if (objectNode.has("Account")) { -// //objectNode.remove("Account"); -// } -// } - - // TODO: Verify, and document if keeping. + + // Remove the `Account` property from any incoming UnlModify JSON about to be deserialized. This is because the JSON + // returned by the rippled/clio API v1 has a bug where the account value is an empty string. For this particular + // For `UnlModify` only, the Java value for the Account is always set to ACCOUNT_ZERO via a default + // method, so this value is removed from the JSON before deserialization because it's not needed (the default + // method handles population in Java) and if not removed, this field will end up in the `unknownFields` + // map of the ultimate Java object, which is incorrect. if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { objectNode.remove("Account"); } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java deleted file mode 100644 index 5d3fa09b0..000000000 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/UnlModifyTransactionSerializer.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.xrpl.xrpl4j.model.jackson.modules; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import org.xrpl.xrpl4j.model.transactions.Transaction; -import org.xrpl.xrpl4j.model.transactions.UnlModify; -import org.xrpl.xrpl4j.model.transactions.metadata.CreatedNode; - -import java.io.IOException; -import java.util.Map; - -// TOOD: Delete if unused. -/** - * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the - * TransactionType JSON field. - */ -public class UnlModifyTransactionSerializer extends StdSerializer { - - /** - * No-args constructor. - */ - protected UnlModifyTransactionSerializer() { - super(UnlModify.class); - } - - @Override - public void serialize(UnlModify value, JsonGenerator gen, SerializerProvider provider) throws IOException { - -// ObjectMapper codec = (ObjectMapper) jsonParser.getCodec(); -// JsonNode jsonNode = jsonParser.readValueAsTree(); -// Map.Entry nodeFieldAndValue = jsonNode.fields().next(); -// String affectedNodeType = nodeFieldAndValue.getKey(); - -// codec.getTypeFactory().constructParametricType(CreatedNode.class, ledgerObjectClass) - - -// ObjectMapper objectMapper = (ObjectMapper) gen.getCodec(); -// String json = objectMapper.writeValueAsString(value); - -// provider.defaultSerializeValue() - - -// if (UnlModify.class.isAssignableFrom(value.getClass())) { -// gen.writeStartObject(); - -// if (gen.getCurrentValue() == null -// gen.getCurrentValue().toString().length() == 1 -// ) { - // 1. Delegate to Jackson for the existing fields: -// provider.defaultSerializeValue(value, gen); // Delegate to Jackson -// } - -// ObjectMapperFactory.create().writeValue(gen, value); - - // Serialize the existing fields (delegate to Jackson's default if possible) -// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields - - // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show - // up during serialization. -// gen.writeFieldName("Account"); -// gen.writeString(value.account().value()); - -// gen.writeEndObject(); -// } else { -// Rely on Jackson's automatic serialization -// gen.writeObject(value); -// } - } -} From ac0a71ac7697eaa65097e2b1b6b2a2d7ade44899 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 11:57:53 -0500 Subject: [PATCH 07/13] Remove unnecessary formatting --- .../modules/TransactionSerializer.java | 77 ------- .../xrpl4j/model/transactions/AccountSet.java | 14 +- .../xrpl4j/model/transactions/AmmBid.java | 1 + .../xrpl4j/model/transactions/AmmCreate.java | 1 + .../xrpl4j/model/transactions/AmmDelete.java | 1 + .../xrpl4j/model/transactions/AmmVote.java | 2 + .../model/transactions/AmmWithdraw.java | 1 + .../model/transactions/CheckCancel.java | 11 +- .../xrpl4j/model/transactions/CheckCash.java | 34 ++- .../model/transactions/CheckCreate.java | 1 + .../xrpl4j/model/transactions/Clawback.java | 2 + .../model/transactions/CurrencyAmount.java | 1 + .../model/transactions/DepositPreAuth.java | 2 +- .../xrpl4j/model/transactions/DidDelete.java | 1 + .../xrpl4j/model/transactions/DidSet.java | 2 + .../model/transactions/EnableAmendment.java | 7 +- .../model/transactions/EscrowCancel.java | 1 + .../model/transactions/EscrowFinish.java | 11 +- .../xrpl/xrpl4j/model/transactions/Memo.java | 3 + .../transactions/NfTokenAcceptOffer.java | 1 + .../transactions/NfTokenCreateOffer.java | 2 +- .../model/transactions/OfferCancel.java | 1 + .../model/transactions/OfferCreate.java | 2 + .../model/transactions/OracleDelete.java | 1 + .../xrpl4j/model/transactions/Payment.java | 15 +- .../transactions/PaymentChannelClaim.java | 30 +-- .../transactions/PaymentChannelCreate.java | 1 + .../model/transactions/SetRegularKey.java | 1 + .../model/transactions/SignerListSet.java | 1 + .../model/transactions/SignerWrapper.java | 1 + .../model/transactions/TransactionType.java | 1 + .../xrpl4j/model/transactions/TrustSet.java | 1 + .../transactions/UnknownTransaction.java | 4 +- .../xrpl4j/model/transactions/Wrappers.java | 211 +++++++++--------- .../XChainAccountCreateCommit.java | 1 + .../XChainAddAccountCreateAttestation.java | 1 + .../XChainAddClaimAttestation.java | 1 + .../model/transactions/XChainClaim.java | 1 + .../model/transactions/XChainCommit.java | 1 + .../transactions/XChainCreateBridge.java | 1 + .../transactions/XChainCreateClaimId.java | 1 + .../transactions/XChainModifyBridge.java | 4 +- 42 files changed, 212 insertions(+), 245 deletions(-) delete mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java deleted file mode 100644 index 6cfb7cf54..000000000 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionSerializer.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.xrpl.xrpl4j.model.jackson.modules; - -/*- - * ========================LICENSE_START================================= - * xrpl4j :: model - * %% - * Copyright (C) 2020 - 2022 XRPL Foundation and its contributors - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * =========================LICENSE_END================================== - */ - -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import org.xrpl.xrpl4j.model.jackson.ObjectMapperFactory; -import org.xrpl.xrpl4j.model.transactions.Transaction; -import org.xrpl.xrpl4j.model.transactions.TransactionType; -import org.xrpl.xrpl4j.model.transactions.UnknownTransaction; -import org.xrpl.xrpl4j.model.transactions.UnlModify; - -import java.io.IOException; - -/** - * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the - * TransactionType JSON field. - */ -public class TransactionSerializer extends StdSerializer { - - /** - * No-args constructor. - */ - protected TransactionSerializer() { - super(Transaction.class); - } - - @Override - public void serialize(Transaction value, JsonGenerator gen, SerializerProvider provider) throws IOException { - - if (UnlModify.class.isAssignableFrom(value.getClass())) { - gen.writeStartObject(); - - // 1. Delegate to Jackson for the existing fields: - provider.defaultSerializeValue(value, gen); // Delegate to Jackson - -// ObjectMapperFactory.create().writeValue(gen, value); - - // Serialize the existing fields (delegate to Jackson's default if possible) -// gen.writeObject((UnlModify) value); // This will handle the standard Transaction fields - - // Add the extra "Account" field here because by marking it @Derived in the Immutable, this field does not show - // up during serialization. - gen.writeFieldName("Account"); - gen.writeString(value.account().value()); - - gen.writeEndObject(); - } else { - // Rely on Jackson's automatic serialization - gen.writeObject(value); - } - } -} diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 18a70a7d9..8814086c5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -130,7 +130,7 @@ default AccountSet normalizeClearFlag() { Preconditions.checkState( clearFlag().get().getValue() == clearFlagRawValue().get().longValue(), String.format("clearFlag and clearFlagRawValue should be equivalent, but clearFlag's underlying " + - "value was %s and clearFlagRawValue was %s", + "value was %s and clearFlagRawValue was %s", clearFlag().get().getValue(), clearFlagRawValue().get().longValue() ) @@ -223,7 +223,7 @@ default AccountSet normalizeSetFlag() { Preconditions.checkState( setFlag().get().getValue() == setFlagRawValue().get().longValue(), String.format("setFlag and setFlagRawValue should be equivalent, but setFlag's underlying " + - "value was %s and setFlagRawValue was %s", + "value was %s and setFlagRawValue was %s", setFlag().get().getValue(), setFlagRawValue().get().longValue() ) @@ -350,8 +350,8 @@ default void checkTransferRate() { transferRate() .ifPresent(rate -> Preconditions.checkArgument(rate.equals(UnsignedInteger.ZERO) || - (rate.compareTo(UnsignedInteger.valueOf(1000000000L)) >= 0 && - rate.compareTo(UnsignedInteger.valueOf(2000000000L)) <= 0), + (rate.compareTo(UnsignedInteger.valueOf(1000000000L)) >= 0 && + rate.compareTo(UnsignedInteger.valueOf(2000000000L)) <= 0), "transferRate must be between 1,000,000,000 and 2,000,000,000 or equal to 0." ) ); @@ -365,8 +365,8 @@ default void checkTickSize() { tickSize() .ifPresent(tickSize -> Preconditions.checkArgument(tickSize.equals(UnsignedInteger.ZERO) || - (tickSize.compareTo(UnsignedInteger.valueOf(3)) >= 0 && - tickSize.compareTo(UnsignedInteger.valueOf(15)) <= 0), + (tickSize.compareTo(UnsignedInteger.valueOf(3)) >= 0 && + tickSize.compareTo(UnsignedInteger.valueOf(15)) <= 0), "tickSize must be between 3 and 15 inclusive or be equal to 0." ) ); @@ -491,7 +491,9 @@ enum AccountSetFlag { * annotation, otherwise Jackson treats the JSON integer value as an ordinal. * * @param value The int value of the flag. + * * @return The {@link AccountSetFlag} for the given integer value. + * * @see "https://github.com/FasterXML/jackson-databind/issues/1850" */ @JsonCreator diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index 09d6b65cf..b52da0635 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -106,4 +106,5 @@ default TransactionFlags flags() { */ @JsonProperty("AuthAccounts") List authAccounts(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index 9427719b4..63838a3c6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -66,4 +66,5 @@ default TransactionFlags flags() { */ @JsonProperty("TradingFee") TradingFee tradingFee(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index d58cbaf98..6af820fb3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -57,4 +57,5 @@ default TransactionFlags flags() { */ @JsonProperty("Asset2") Issue asset2(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index d0059c14c..9742cfefb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -67,4 +67,6 @@ default TransactionFlags flags() { */ @JsonProperty("TradingFee") TradingFee tradingFee(); + + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index 6ab1075ec..c4208824d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -96,4 +96,5 @@ static ImmutableAmmWithdraw.Builder builder() { */ @JsonProperty("LPTokenIn") Optional lpTokensIn(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 27a590303..592a70f38 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -27,9 +27,9 @@ import org.xrpl.xrpl4j.model.flags.TransactionFlags; /** - * Cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of - * the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can - * cancel it. + * Cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the + * destination of the check can cancel a Check at any time using this transaction type. + * If the Check has expired, any address can cancel it. */ @Value.Immutable @JsonSerialize(as = ImmutableCheckCancel.class) @@ -46,8 +46,8 @@ static ImmutableCheckCancel.Builder builder() { } /** - * Set of {@link TransactionFlags}s for this {@link CheckCancel}, which only allows the {@code tfFullyCanonicalSig} - * flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link CheckCancel}, which only allows the + * {@code tfFullyCanonicalSig} flag, which is deprecated. * *

    The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -67,4 +67,5 @@ default TransactionFlags flags() { */ @JsonProperty("CheckID") Hash256 checkId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index 08df11d80..46da4c6c6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -31,13 +31,13 @@ /** * The {@link CheckCash} transaction attempts to redeem a Check object in the ledger to receive up to the amount - * authorized by the corresponding {@link CheckCreate} transaction. Only the Destination address of a Check can cash it - * with a CheckCash transaction. Cashing a check this way is similar to executing a {@link Payment} initiated by the - * destination. + * authorized by the corresponding {@link CheckCreate} transaction. Only the Destination address of a Check can cash + * it with a CheckCash transaction. Cashing a check this way is similar to executing a {@link Payment} initiated by + * the destination. * *

    Since the funds for a check are not guaranteed, redeeming a Check can fail because the sender does not have a - * high enough balance or because there is not enough liquidity to deliver the funds. If this happens, the Check remains - * in the ledger and the destination can try to cash it again later, or for a different amount. + * high enough balance or because there is not enough liquidity to deliver the funds. If this happens, the Check + * remains in the ledger and the destination can try to cash it again later, or for a different amount. */ @Value.Immutable @JsonSerialize(as = ImmutableCheckCash.class) @@ -54,8 +54,8 @@ static ImmutableCheckCash.Builder builder() { } /** - * Set of {@link TransactionFlags}s for this {@link CheckCash}, which only allows the {@code tfFullyCanonicalSig} - * flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link CheckCash}, which only allows the + * {@code tfFullyCanonicalSig} flag, which is deprecated. * *

    The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -77,9 +77,9 @@ default TransactionFlags flags() { Hash256 checkId(); /** - * Redeem the Check for exactly this amount, if possible. The currency must match that of the - * {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} transaction. You must provide either - * this field or {@link CheckCash#deliverMin()}. + * Redeem the Check for exactly this amount, if possible. + * The currency must match that of the {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} + * transaction. You must provide either this field or {@link CheckCash#deliverMin()}. * * @return An {@link Optional} of type {@link CurrencyAmount} containing the check amount. */ @@ -87,9 +87,9 @@ default TransactionFlags flags() { Optional amount(); /** - * Redeem the Check for at least this amount and for as much as possible. The currency must match that of the - * {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} transaction. You must provide either - * this field or {@link CheckCash#amount()}. + * Redeem the Check for at least this amount and for as much as possible. + * The currency must match that of the {@link CheckCreate#sendMax()}SendMax of the corresponding {@link CheckCreate} + * transaction. You must provide either this field or {@link CheckCash#amount()}. * * @return An {@link Optional} of type {@link CurrencyAmount} containing the minimum delivery amount for this check. */ @@ -101,10 +101,8 @@ default TransactionFlags flags() { */ @Value.Check default void validateOnlyOneAmountSet() { - Preconditions.checkArgument( - (amount().isPresent() || deliverMin().isPresent()) && - !(amount().isPresent() && deliverMin().isPresent()), - "The CheckCash transaction must include either amount or deliverMin, but not both." - ); + Preconditions.checkArgument((amount().isPresent() || deliverMin().isPresent()) && + !(amount().isPresent() && deliverMin().isPresent()), + "The CheckCash transaction must include either amount or deliverMin, but not both."); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index 7d32b1aa9..46c5cca7f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -104,4 +104,5 @@ default TransactionFlags flags() { */ @JsonProperty("InvoiceID") Optional invoiceId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java index 04b68c4df..8c5c3bdcf 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java @@ -50,4 +50,6 @@ default TransactionFlags flags() { */ @JsonProperty("Amount") IssuedCurrencyAmount amount(); + + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java index 5e59abe89..bb088f5ab 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CurrencyAmount.java @@ -76,6 +76,7 @@ default void handle( * @param issuedCurrencyAmountMapper A {@link Function} that is called if this instance is of type * {@link IssuedCurrencyAmount}. * @param The type of object to return after mapping. + * * @return A {@link R} that is constructed by the appropriate mapper function. */ default R map( diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index f71f852ad..588d5e9ef 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -89,7 +89,7 @@ default TransactionFlags flags() { @Value.Check default void validateFieldPresence() { Preconditions.checkArgument((authorize().isPresent() || unauthorize().isPresent()) && - !(authorize().isPresent() && unauthorize().isPresent()), + !(authorize().isPresent() && unauthorize().isPresent()), "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index d55b8fdc4..94bd4d7c4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -43,4 +43,5 @@ static ImmutableDidDelete.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java index bf0f00795..95559bfe8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java @@ -70,4 +70,6 @@ default TransactionFlags flags() { */ @JsonProperty("Data") Optional data(); + + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index 97b2c5970..c15b1d622 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -29,7 +29,8 @@ import java.util.Optional; /** - * An {@link EnableAmendment} pseudo-transaction marks a change in status of an amendment. to the XRP Ledger protocol + * An {@link EnableAmendment} pseudo-transaction marks a change in status of an amendment. + * to the XRP Ledger protocol * * @see "https://xrpl.org/enableamendment.html" */ @@ -56,8 +57,8 @@ static ImmutableEnableAmendment.Builder builder() { Hash256 amendment(); /** - * The ledger index where this pseudo-transaction appears. This distinguishes the pseudo-transaction from other - * occurrences of the same change. + * The ledger index where this pseudo-transaction appears. This distinguishes the + * pseudo-transaction from other occurrences of the same change. * * @return A {@link LedgerIndex} to indicates where the tx appears. */ diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index 13095f5c3..10eedf483 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -75,4 +75,5 @@ default TransactionFlags flags() { */ @JsonProperty("OfferSequence") UnsignedInteger offerSequence(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index 1bb90c175..0de23cfbc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -72,7 +72,9 @@ static ImmutableEscrowFinish.Builder builder() { * @param currentLedgerBaseFeeDrops The number of drops that the ledger demands at present. * @param fulfillment The {@link Fulfillment} that is being presented to the ledger for computation * purposes. + * * @return An {@link XrpCurrencyAmount} representing the computed fee. + * * @see "https://xrpl.org/escrowfinish.html" */ static XrpCurrencyAmount computeFee( @@ -249,7 +251,7 @@ default EscrowFinish normalizeCondition() { // condition is equivalent to the raw value when re-written. if (!Arrays.equals(CryptoConditionWriter.writeCondition(condition), conditionRawValueBytes)) { logger.warn("EscrowFinish Condition was malformed: mismatch between raw value and parsed condition. " + - "conditionRawValue() will contain the condition value, but condition() will be empty."); + "conditionRawValue() will contain the condition value, but condition() will be empty."); return this; } @@ -259,7 +261,7 @@ default EscrowFinish normalizeCondition() { } catch (DerEncodingException | IllegalArgumentException e) { logger.warn( "EscrowFinish Condition was malformed. conditionRawValue() will contain the condition value, but " + - "condition() will be empty: {}", + "condition() will be empty: {}", e.getMessage(), e ); @@ -331,7 +333,7 @@ default EscrowFinish normalizeFulfillment() { // fulfillment is equivalent to the raw value when re-written. if (!Arrays.equals(CryptoConditionWriter.writeFulfillment(fulfillment), fulfillmentRawValueBytes)) { logger.warn("EscrowFinish Fulfillment was malformed: mismatch between raw value and parsed fulfillment. " + - "fulfillmentRawValue() will contain the fulfillment value, but fulfillment() will be empty."); + "fulfillmentRawValue() will contain the fulfillment value, but fulfillment() will be empty."); return this; } @@ -341,7 +343,7 @@ default EscrowFinish normalizeFulfillment() { } catch (DerEncodingException | IllegalArgumentException e) { logger.warn( "EscrowFinish Fulfillment was malformed. fulfillmentRawValue() will contain the fulfillment value, " + - "but fulfillment() will be empty: {}", + "but fulfillment() will be empty: {}", e.getMessage(), e ); @@ -355,4 +357,5 @@ default EscrowFinish normalizeFulfillment() { throw new RuntimeException(e); } } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java index 0ed27bcd1..1f14c23ca 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java @@ -51,6 +51,7 @@ public abstract class Memo { * Construct a {@link ImmutableMemo.Builder} by properly hex-encoding {@code plaintext}. * * @param plaintext A UTF-8 {@link String}. + * * @return A {@link ImmutableMemo.Builder}. */ public static ImmutableMemo.Builder withPlaintext(final String plaintext) { @@ -111,6 +112,7 @@ void check() { * Determines if an input string is hex-encoded. * * @param input A {@link String}. + * * @return {@code true} if every character in {@code input} is hex-encoded; {@code false} otherwise. */ private static boolean isHex(final String input) { @@ -128,6 +130,7 @@ private static boolean isHex(final String input) { * Determines if an input char is hex-encoded. * * @param input A {@link char}. + * * @return {@code true} if {@code input} is hex-encoded; {@code false} otherwise. */ private static boolean isHex(final char input) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index 0ba8b113a..4cec97fd6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -136,4 +136,5 @@ default void brokerFeeNotPresentInDirectModeAndAtleastOneOfferPresent() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index 6049e67f0..365938cf1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -88,7 +88,7 @@ static ImmutableNfTokenCreateOffer.Builder builder() { *

    If the offer is to buy a token, this field must be present * and it must be different than Account (since an offer to * buy a token one already holds is meaningless). - *

    + * * If the offer is to sell a token, this field must not be * present, as the owner is, implicitly, the same as Account * (since an offer to sell a token one doesn't already hold diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index f819f0327..09abd807b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -71,4 +71,5 @@ default TransactionFlags flags() { */ @JsonProperty("OfferSequence") Optional offerSequence(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index ed6c2387b..112dc5c81 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -93,4 +93,6 @@ default OfferCreateFlags flags() { */ @JsonProperty("Expiration") Optional expiration(); + + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java index f27eaf6a1..b8e81ea7c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java @@ -49,4 +49,5 @@ default TransactionFlags flags() { */ @JsonProperty("OracleDocumentID") OracleDocumentId oracleDocumentId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 19472912a..ae0e7eafe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -51,8 +51,8 @@ static ImmutablePayment.Builder builder() { } /** - * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a - * {@link PaymentFlags} object containing the {@link Long} representation of the set bits. + * Set of {@link PaymentFlags}s for this {@link Payment}, which have been properly combined to yield a {@link + * PaymentFlags} object containing the {@link Long} representation of the set bits. * *

    The value of the flags can either be set manually, or constructed using {@link PaymentFlags.Builder}. * @@ -65,8 +65,8 @@ default PaymentFlags flags() { } /** - * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to this - * amount instead. + * The amount of currency to deliver. If the {@link PaymentFlags#tfPartialPayment()} flag is set, deliver up to + * this amount instead. * * @return A {@link CurrencyAmount} representing the amount of a specified currency to deliver. */ @@ -125,11 +125,12 @@ default PaymentFlags flags() { Optional sendMax(); /** - * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the - * {@link PaymentFlags#tfPartialPayment()}* flag is set. + * Minimum amount of destination currency this {@link Payment} should deliver. Only valid if this the {@link + * PaymentFlags#tfPartialPayment()}* flag is set. * * @return An {@link Optional} of type {@link CurrencyAmount}. */ @JsonProperty("DeliverMin") Optional deliverMin(); -} \ No newline at end of file + +} diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index 8f0170def..828e023df 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -29,8 +29,8 @@ import java.util.Optional; /** - * Claim XRP from a payment channel, adjust the payment channel's expiration, or both. This transaction can be used - * differently depending on the transaction sender's role in the specified channel: + * Claim XRP from a payment channel, adjust the payment channel's expiration, or both. This transaction can be + * used differently depending on the transaction sender's role in the specified channel: * *

    The source address of a channel can: *

      @@ -90,9 +90,9 @@ default PaymentChannelClaimFlags flags() { Hash256 channel(); /** - * Total amount of XRP, in drops, delivered by this channel after processing this claim. Required to deliver XRP. Must - * be more than the total amount delivered by the channel so far, but not greater than the {@link #amount()} of the - * signed claim. Must be provided except when closing the channel. + * Total amount of XRP, in drops, delivered by this channel after processing this claim. Required to deliver XRP. + * Must be more than the total amount delivered by the channel so far, but not greater than the {@link #amount()} + * of the signed claim. Must be provided except when closing the channel. * * @return An {@link Optional} of type {@link XrpCurrencyAmount} representing the payment channel balance. */ @@ -100,9 +100,9 @@ default PaymentChannelClaimFlags flags() { Optional balance(); /** - * The amount of XRP, in drops, authorized by the {@link #signature()}. This must match the amount in the signed - * message. This is the cumulative amount of XRP that can be dispensed by the channel, including XRP previously - * redeemed. + * The amount of XRP, in drops, authorized by the {@link #signature()}. This must match the amount in + * the signed message. This is the cumulative amount of XRP that can be dispensed by the channel, + * including XRP previously redeemed. * * @return An {@link Optional} of type {@link XrpCurrencyAmount} representing the payment channel amount. */ @@ -110,8 +110,8 @@ default PaymentChannelClaimFlags flags() { Optional amount(); /** - * The signature of this claim, in hexadecimal form. The signed message contains the channel ID and the amount of the - * claim. Required unless the sender of the transaction is the source address of the channel. + * The signature of this claim, in hexadecimal form. The signed message contains the channel ID and the amount + * of the claim. Required unless the sender of the transaction is the source address of the channel. * * @return An {@link Optional} of type {@link String} containing the payment channel signature. */ @@ -119,13 +119,15 @@ default PaymentChannelClaimFlags flags() { Optional signature(); /** - * The public key used for the {@link #signature()}, as hexadecimal. This must match the PublicKey stored in the - * ledger for the channel. Required unless the sender of the transaction is the source address of the channel and the - * {@link #signature()} field is omitted. (The transaction includes the public key so that rippled can check the - * validity of the signature before trying to apply the transaction to the ledger.) + * The public key used for the {@link #signature()}, as hexadecimal. This must match the PublicKey stored + * in the ledger for the channel. Required unless the sender of the transaction is the source + * address of the channel and the {@link #signature()} field is omitted. + * (The transaction includes the public key so that rippled can check the validity of the signature + * before trying to apply the transaction to the ledger.) * * @return An {@link Optional} of type {@link String} containing the public key used to sign this payment channel. */ @JsonProperty("PublicKey") Optional publicKey(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index df3a163fe..8dfdb4dc4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -117,4 +117,5 @@ default TransactionFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index 82b31f35c..3ce34f732 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -72,4 +72,5 @@ default TransactionFlags flags() { */ @JsonProperty("RegularKey") Optional
      regularKey(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 1aee6acaa..9128e2f7f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -82,4 +82,5 @@ default TransactionFlags flags() { */ @JsonProperty("SignerEntries") List signerEntries(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java index 870a0a7c6..b99aadba7 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java @@ -46,6 +46,7 @@ static ImmutableSignerWrapper.Builder builder() { * Construct a {@link SignerWrapper} wrapping the given {@link Signer}. * * @param signer A {@link Signer}. + * * @return A {@link SignerWrapper}. */ static SignerWrapper of(Signer signer) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java index 98befdc2b..0beefb089 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java @@ -353,6 +353,7 @@ public enum TransactionType { * Gets an instance of {@link TransactionType} for the given string value. * * @param value The {@link String} value corresponding to a {@link TransactionType}. + * * @return The {@link TransactionType} with the corresponding value. */ public static TransactionType forValue(String value) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index 70227d3eb..d3033086f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -85,4 +85,5 @@ default TrustSetFlags flags() { */ @JsonProperty("QualityOut") Optional qualityOut(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java index 9e49b9051..7a54f0122 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java @@ -44,10 +44,11 @@ static ImmutableUnknownTransaction.Builder builder() { * * @return {@link TransactionType#UNKNOWN}. */ + @Override @JsonIgnore @Value.Derived default TransactionType transactionType() { - return TransactionType.UNKNOWN; + return Transaction.super.transactionType(); } /** @@ -60,4 +61,5 @@ default TransactionType transactionType() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java index 365b3fe7c..9e6731f70 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java @@ -20,6 +20,7 @@ * =========================LICENSE_END================================== */ +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonRawValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -83,7 +84,7 @@ */ @SuppressWarnings("TypeName") public class Wrappers { - + /** * A wrapped {@link String} representing an address on the XRPL. */ @@ -92,26 +93,24 @@ public class Wrappers { @JsonSerialize(as = Address.class, using = AddressSerializer.class) @JsonDeserialize(as = Address.class, using = AddressDeserializer.class) abstract static class _Address extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a {@link Address}'s value's length is equal to 34 characters and starts with `r`. */ @Value.Check public void validateAddress() { Preconditions.checkArgument(this.value().startsWith("r"), "Invalid Address: Bad Prefix"); - Preconditions.checkArgument( - this.value().length() >= 25 && this.value().length() <= 35, - "Classic Addresses must be (25,35) characters long inclusive." - ); + Preconditions.checkArgument(this.value().length() >= 25 && this.value().length() <= 35, + "Classic Addresses must be (25,35) characters long inclusive."); } - + } - + /** * A wrapped {@link String} representing an X-Address on the XRPL. */ @@ -120,14 +119,14 @@ public void validateAddress() { @JsonSerialize(as = XAddress.class) @JsonDeserialize(as = XAddress.class) abstract static class _XAddress extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing the Hex representation of a 256-bit Hash. */ @@ -136,12 +135,12 @@ public String toString() { @JsonSerialize(as = Hash256.class, using = Hash256Serializer.class) @JsonDeserialize(as = Hash256.class, using = Hash256Deserializer.class) abstract static class _Hash256 extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a {@link Hash256}'s value's length is equal to 64 characters. */ @@ -149,7 +148,7 @@ public String toString() { public void validateLength() { Preconditions.checkArgument(this.value().length() == 64, "Hash256 Strings must be 64 characters long."); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof Hash256) { @@ -160,13 +159,13 @@ public boolean equals(Object obj) { } return false; } - + @Override public int hashCode() { return value().toUpperCase(Locale.ENGLISH).hashCode(); } } - + /** * A {@link CurrencyAmount} for the XRP currency (non-issued). {@link XrpCurrencyAmount}s are a {@link String} * representation of an unsigned integer representing the amount in XRP drops. @@ -176,10 +175,10 @@ public int hashCode() { @JsonSerialize(as = XrpCurrencyAmount.class, using = XrpCurrencyAmountSerializer.class) @JsonDeserialize(as = XrpCurrencyAmount.class, using = XrpCurrencyAmountDeserializer.class) abstract static class _XrpCurrencyAmount extends Wrapper implements Serializable, CurrencyAmount { - + static final BigDecimal SMALLEST_XRP = new BigDecimal("0.000001"); static final DecimalFormat FORMATTER = new DecimalFormat("###,###"); - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. Because XRP is capped to 100B units (1e17 * drops), this value will never overflow Java's signed long number. @@ -198,7 +197,7 @@ public static XrpCurrencyAmount ofDrops(final long drops) { return ofDrops(UnsignedLong.valueOf(drops), false); } } - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. * @@ -208,11 +207,11 @@ public static XrpCurrencyAmount ofDrops(final long drops) { */ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops) { Objects.requireNonNull(drops); - + // Note: ofDrops() throws an exception if too big. return _XrpCurrencyAmount.ofDrops(drops, false); } - + /** * Constructs an {@link XrpCurrencyAmount} using a number of drops. * @@ -223,13 +222,13 @@ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops) { */ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops, final boolean isNegative) { Objects.requireNonNull(drops); - + return XrpCurrencyAmount.builder() .value(drops) .isNegative(isNegative) .build(); } - + /** * Constructs an {@link XrpCurrencyAmount} using decimal amount of XRP. * @@ -239,11 +238,11 @@ public static XrpCurrencyAmount ofDrops(final UnsignedLong drops, final boolean */ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { Objects.requireNonNull(amount); - + if (FluentCompareTo.is(amount).equalTo(BigDecimal.ZERO)) { return ofDrops(UnsignedLong.ZERO); } - + final BigDecimal absAmount = amount.abs(); // Whether positive or negative, ensure the amount is not too small and not too big. Preconditions.checkArgument( @@ -254,7 +253,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { FluentCompareTo.is(absAmount).lessThanOrEqualTo(MAX_XRP_BD), String.format("Amount must be less-than-or-equal-to %s", MAX_XRP_BD) ); - + if (amount.signum() == 0) { // zero return ofDrops(UnsignedLong.ZERO); // <-- Should never happen per the first check above, but just in case. } else { // positive or negative @@ -262,7 +261,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { return ofDrops(UnsignedLong.valueOf(absAmount.scaleByPowerOfTen(6).toBigIntegerExact()), isNegative); } } - + /** * Indicates whether this amount is positive or negative. * @@ -284,7 +283,7 @@ public static XrpCurrencyAmount ofXrp(final BigDecimal amount) { public boolean isNegative() { return false; } - + /** * Convert this XRP amount into a decimal representing a value denominated in whole XRP units. For example, a value * of `1.0` represents 1 unit of XRP; a value of `0.5` represents a half of an XRP unit. @@ -300,7 +299,7 @@ public BigDecimal toXrp() { return amount; } } - + /** * Adds another {@link XrpCurrencyAmount} to this amount. * @@ -312,10 +311,10 @@ public XrpCurrencyAmount plus(XrpCurrencyAmount other) { // Convert each value to a long (positive or negative works) long result = (this.value().longValue() * (this.isNegative() ? -1 : 1)) + - (other.value().longValue() * (other.isNegative() ? -1 : 1)); + (other.value().longValue() * (other.isNegative() ? -1 : 1)); return XrpCurrencyAmount.ofDrops(result); } - + /** * Subtract another {@link XrpCurrencyAmount} from this amount. * @@ -327,10 +326,10 @@ public XrpCurrencyAmount minus(XrpCurrencyAmount other) { // Convert each value to a long (positive or negative works) long result = (this.value().longValue() * (this.isNegative() ? -1 : 1)) - - (other.value().longValue() * (other.isNegative() ? -1 : 1)); + (other.value().longValue() * (other.isNegative() ? -1 : 1)); return XrpCurrencyAmount.ofDrops(result); } - + /** * Multiplies this amount by another {@link XrpCurrencyAmount}. * @@ -344,12 +343,12 @@ public XrpCurrencyAmount times(XrpCurrencyAmount other) { this.isNegative() || other.isNegative() ); } - + @Override public String toString() { return String.format("%s%s", isNegative() ? "-" : "", this.value().toString()); } - + /** * Validates that this {@link XrpCurrencyAmount} does not exceed the maximum number of drops. */ @@ -362,23 +361,23 @@ protected void check() { ) ); } - + } - + @Value.Immutable @Wrapped @JsonSerialize(as = Marker.class, using = MarkerSerializer.class) @JsonDeserialize(as = Marker.class, using = MarkerDeserializer.class) abstract static class _Marker extends Wrapper implements Serializable { - + @Override @JsonRawValue public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing the NFT Id. */ @@ -387,12 +386,12 @@ public String toString() { @JsonSerialize(as = NfTokenId.class, using = NfTokenIdSerializer.class) @JsonDeserialize(as = NfTokenId.class, using = NfTokenIdDeserializer.class) abstract static class _NfTokenId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + /** * Validates that a NfTokenId value's length is equal to 64 characters. */ @@ -400,7 +399,7 @@ public String toString() { public void validateLength() { Preconditions.checkArgument(this.value().length() == 64, "TokenId must be 64 characters long."); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof NfTokenId) { @@ -412,7 +411,7 @@ public boolean equals(Object obj) { return false; } } - + /** * A wrapped {@link String} containing the Uri. */ @@ -421,7 +420,7 @@ public boolean equals(Object obj) { @JsonSerialize(as = NfTokenUri.class, using = NfTokenUriSerializer.class) @JsonDeserialize(as = NfTokenUri.class) abstract static class _NfTokenUri extends Wrapper implements Serializable { - + /** * Constructs an {@link NfTokenUri} using a String value. * @@ -432,7 +431,7 @@ abstract static class _NfTokenUri extends Wrapper implements Serializabl public static NfTokenUri ofPlainText(String plaintext) { return NfTokenUri.of(BaseEncoding.base16().encode(plaintext.getBytes(StandardCharsets.UTF_8))); } - + @Override public boolean equals(Object obj) { if (obj != null && obj instanceof NfTokenUri) { @@ -444,7 +443,7 @@ public boolean equals(Object obj) { return false; } } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the TransferFee. * @@ -457,7 +456,12 @@ public boolean equals(Object obj) { @JsonSerialize(as = TransferFee.class, using = TransferFeeSerializer.class) @JsonDeserialize(as = TransferFee.class, using = TransferFeeDeserializer.class) abstract static class _TransferFee extends Wrapper implements Serializable { - + + @Override + public String toString() { + return this.value().toString(); + } + /** * Construct {@link TransferFee} as a percentage value. * @@ -476,12 +480,8 @@ public static TransferFee ofPercent(BigDecimal percent) { ); return TransferFee.of(UnsignedInteger.valueOf(percent.scaleByPowerOfTen(3).toBigIntegerExact())); } - - @Override - public String toString() { - return this.value().toString(); - } - + + /** * Validates that a NfTokenId value's length is equal to 64 characters. */ @@ -489,13 +489,12 @@ public String toString() { public void validateBounds() { Preconditions.checkArgument( FluentCompareTo.is(value()).lessThanOrEqualTo(UnsignedInteger.valueOf(50000)) && - FluentCompareTo.is(value()).greaterThanEqualTo(UnsignedInteger.valueOf(0)), - "TransferFee should be in the range 0 to 50000." - ); + FluentCompareTo.is(value()).greaterThanEqualTo(UnsignedInteger.valueOf(0)), + "TransferFee should be in the range 0 to 50000."); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing a Network ID. */ @@ -504,7 +503,12 @@ public void validateBounds() { @JsonSerialize(as = NetworkId.class, using = NetworkIdSerializer.class) @JsonDeserialize(as = NetworkId.class, using = NetworkIdDeserializer.class) abstract static class _NetworkId extends Wrapper implements Serializable { - + + @Override + public String toString() { + return this.value().toString(); + } + /** * Construct a {@link NetworkId} from a {@code long}. The supplied value must be less than or equal to * 4,294,967,295, the largest unsigned 32-bit integer. @@ -516,13 +520,8 @@ abstract static class _NetworkId extends Wrapper implements Ser public static NetworkId of(long networkId) { return NetworkId.of(UnsignedInteger.valueOf(networkId)); } - - @Override - public String toString() { - return this.value().toString(); - } } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the TransferFee. * @@ -535,7 +534,12 @@ public String toString() { @JsonDeserialize(as = TradingFee.class, using = TradingFeeDeserializer.class) @Beta abstract static class _TradingFee extends Wrapper implements Serializable { - + + @Override + public String toString() { + return this.value().toString(); + } + /** * Construct {@link TradingFee} as a percentage value. * @@ -550,12 +554,7 @@ public static TradingFee ofPercent(BigDecimal percent) { ); return TradingFee.of(UnsignedInteger.valueOf(percent.scaleByPowerOfTen(3).toBigIntegerExact())); } - - @Override - public String toString() { - return this.value().toString(); - } - + /** * Get the {@link TradingFee} as a {@link BigDecimal}. * @@ -564,9 +563,9 @@ public String toString() { public BigDecimal bigDecimalValue() { return BigDecimal.valueOf(value().longValue(), 3); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedInteger} containing the VoteWeight. * @@ -579,12 +578,12 @@ public BigDecimal bigDecimalValue() { @JsonDeserialize(as = VoteWeight.class, using = VoteWeightDeserializer.class) @Beta abstract static class _VoteWeight extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + /** * Get the {@link VoteWeight} as a {@link BigDecimal}. * @@ -593,9 +592,9 @@ public String toString() { public BigDecimal bigDecimalValue() { return BigDecimal.valueOf(value().longValue(), 3); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedLong} containing an XChainClaimID. * @@ -608,14 +607,14 @@ public BigDecimal bigDecimalValue() { @JsonDeserialize(as = XChainClaimId.class, using = XChainClaimIdDeserializer.class) @Beta abstract static class _XChainClaimId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link com.google.common.primitives.UnsignedLong} representing a counter for XLS-38 sidechains. This * wrapper mostly exists to ensure we serialize fields of this type as a hex String in JSON, as these fields are @@ -630,14 +629,14 @@ public String toString() { @JsonDeserialize(as = XChainCount.class, using = XChainCountDeserializer.class) @Beta abstract static class _XChainCount extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link String} containing a DID Document. * @@ -650,14 +649,14 @@ public String toString() { @JsonDeserialize(as = DidDocument.class, using = DidDocumentDeserializer.class) @Beta abstract static class _DidDocument extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing a DID URI. * @@ -670,14 +669,14 @@ public String toString() { @JsonDeserialize(as = DidUri.class, using = DidUriDeserializer.class) @Beta abstract static class _DidUri extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing DID Data. * @@ -690,14 +689,14 @@ public String toString() { @JsonDeserialize(as = DidData.class, using = DidDataDeserializer.class) @Beta abstract static class _DidData extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link UnsignedInteger} containing an Oracle document ID. * @@ -710,14 +709,14 @@ public String toString() { @JsonDeserialize(as = OracleDocumentId.class, using = OracleDocumentIdDeserializer.class) @Beta abstract static class _OracleDocumentId extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } - + /** * A wrapped {@link String} containing an Oracle provider. * @@ -730,14 +729,14 @@ public String toString() { @JsonDeserialize(as = OracleProvider.class, using = OracleProviderDeserializer.class) @Beta abstract static class _OracleProvider extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing an Oracle URI. * @@ -750,14 +749,14 @@ public String toString() { @JsonDeserialize(as = OracleUri.class, using = OracleUriDeserializer.class) @Beta abstract static class _OracleUri extends Wrapper implements Serializable { - + @Override public String toString() { return this.value(); } - + } - + /** * A wrapped {@link String} containing an Oracle asset price. * @@ -770,11 +769,11 @@ public String toString() { @JsonDeserialize(as = AssetPrice.class, using = AssetPriceDeserializer.class) @Beta abstract static class _AssetPrice extends Wrapper implements Serializable { - + @Override public String toString() { return this.value().toString(); } - + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java index b6c1b740c..9272ea579 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java @@ -77,4 +77,5 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java index 6da308668..cf7be3c94 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java @@ -141,4 +141,5 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java index df3ac3f0b..68c46c7b4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java @@ -134,4 +134,5 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java index ce389521f..8aa1d2519 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainClaim.java @@ -89,4 +89,5 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java index 805dc3b40..2f53a74eb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCommit.java @@ -81,4 +81,5 @@ default TransactionFlags flags() { @JsonProperty("XChainClaimID") @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java index dd9b83cce..744331b14 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java @@ -68,4 +68,5 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java index babfe2d50..1e4525b36 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimId.java @@ -66,4 +66,5 @@ default TransactionFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java index 90b8b4fb5..b51324115 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java @@ -35,8 +35,7 @@ static ImmutableXChainModifyBridge.Builder builder() { * Set of {@link XChainModifyBridgeFlags}s for this {@link XChainModifyBridge}, which have been properly combined to * yield a {@link XChainModifyBridgeFlags} object containing the {@link Long} representation of the set bits. * - *

      The value of the flags can either be set manually, or constructed using - * {@link XChainModifyBridgeFlags.Builder}. + *

      The value of the flags can either be set manually, or constructed using {@link XChainModifyBridgeFlags.Builder}. * * @return The {@link XChainModifyBridgeFlags} for this transaction. */ @@ -71,4 +70,5 @@ default XChainModifyBridgeFlags flags() { @JsonProperty("XChainBridge") @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + } From 5cee741292a088d4f8cdd547c3267a6fa5f3b5a5 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 12:07:44 -0500 Subject: [PATCH 08/13] Unwind formatting --- .../xrpl/xrpl4j/model/transactions/AccountDelete.java | 9 +++++---- .../org/xrpl/xrpl4j/model/transactions/CheckCash.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/CheckCreate.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/DepositPreAuth.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/EnableAmendment.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/EscrowCancel.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/EscrowCreate.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/EscrowFinish.java | 4 ++-- .../xrpl4j/model/transactions/IssuedCurrencyAmount.java | 4 ++-- .../java/org/xrpl/xrpl4j/model/transactions/Memo.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/MemoWrapper.java | 4 ++-- .../xrpl4j/model/transactions/NfTokenAcceptOffer.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java | 4 ++-- .../xrpl4j/model/transactions/NfTokenCancelOffer.java | 4 ++-- .../xrpl4j/model/transactions/NfTokenCreateOffer.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/NfTokenMint.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/OfferCancel.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/OfferCreate.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/PathStep.java | 4 ++-- .../java/org/xrpl/xrpl4j/model/transactions/Payment.java | 4 ++-- .../xrpl4j/model/transactions/PaymentChannelClaim.java | 4 ++-- .../xrpl4j/model/transactions/PaymentChannelCreate.java | 4 ++-- .../xrpl4j/model/transactions/PaymentChannelFund.java | 4 ++-- .../java/org/xrpl/xrpl4j/model/transactions/SetFee.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/SetRegularKey.java | 4 ++-- .../java/org/xrpl/xrpl4j/model/transactions/Signer.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/SignerListSet.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/SignerWrapper.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/TicketCreate.java | 4 ++-- .../xrpl4j/model/transactions/TransactionMetadata.java | 4 ++-- .../model/transactions/TransactionResultCodes.java | 4 ++-- .../xrpl/xrpl4j/model/transactions/TransactionType.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/TrustSet.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/UnlModify.java | 4 ++-- .../org/xrpl/xrpl4j/model/transactions/Wrappers.java | 4 ++-- 35 files changed, 73 insertions(+), 72 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index 94b85a03e..c670b1361 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -48,8 +48,8 @@ static ImmutableAccountDelete.Builder builder() { } /** - * Set of {@link TransactionFlags}s for this {@link AccountDelete}, which only allows the {@code tfFullyCanonicalSig} - * flag, which is deprecated. + * Set of {@link TransactionFlags}s for this {@link AccountDelete}, which only allows the + * {@code tfFullyCanonicalSig} flag, which is deprecated. * *

      The value of the flags cannot be set manually, but exists for JSON serialization/deserialization only and for * proper signature computation in rippled. @@ -79,4 +79,5 @@ default TransactionFlags flags() { */ @JsonProperty("DestinationTag") Optional destinationTag(); + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index 46da4c6c6..8dedc75af 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index 46c5cca7f..b753c3dbb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index 588d5e9ef..5119201ca 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index c15b1d622..d5eb98a2a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index 10eedf483..dedfdc65e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java index 21366fb2e..7d2001b8a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index 0de23cfbc..5e02d0a0a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java index f109db9ea..f5e03998e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/IssuedCurrencyAmount.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java index 1f14c23ca..bc7777934 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Memo.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java index 8f70ee773..aaa81c5f1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/MemoWrapper.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index 4cec97fd6..c0176c5a9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java index 61179153b..4761de95f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java index b0c32f607..6c559df54 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index 365938cf1..fc4989319 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java index a4a828ac6..446cbaae2 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index 09abd807b..45f2e0823 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index 112dc5c81..c7ef5b191 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java index 0b1671682..e8ac3feb1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PathStep.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index ae0e7eafe..8e6b554ae 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index 828e023df..944a2fefd 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index 8dfdb4dc4..2e0397b8c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java index b7c3478e2..a27ad9737 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index 8b7ee2412..dff2d54bf 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index 3ce34f732..6f245654f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java index d8b42694e..d3f6c2f09 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 9128e2f7f..0144163ac 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java index b99aadba7..0229f153a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerWrapper.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java index 720adba0d..a05d081a5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java index d815a6f09..b3ffce22d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java index 10705bd3e..1df462bed 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionResultCodes.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java index 0beefb089..fd528ee59 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index d3033086f..aa85c0c44 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index 1196f8ac1..462ffe815 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java index 9e6731f70..508e0eacb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Wrappers.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. From 0f92cdd9998d7aa22d899f77836291b10726a94b Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 12:24:42 -0500 Subject: [PATCH 09/13] Formatting --- .../model/transactions/CheckCancel.java | 4 +- .../xrpl4j/model/transactions/SetFee.java | 4 +- .../xrpl4j/model/transactions/Signer.java | 4 +- .../model/transactions/SignerListSet.java | 4 +- .../transactions/TransactionMetadata.java | 4 +- .../model/transactions/TransactionType.java | 5 +- .../binary/BinarySerializationTests.java | 532 ++++++++++-------- 7 files changed, 305 insertions(+), 252 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 592a70f38..8ee66aff3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index dff2d54bf..8b7ee2412 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java index d3f6c2f09..d8b42694e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Signer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 0144163ac..9128e2f7f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java index b3ffce22d..d815a6f09 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionMetadata.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java index fd528ee59..98befdc2b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -353,7 +353,6 @@ public enum TransactionType { * Gets an instance of {@link TransactionType} for the given string value. * * @param value The {@link String} value corresponding to a {@link TransactionType}. - * * @return The {@link TransactionType} with the corresponding value. */ public static TransactionType forValue(String value) { diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java index 9ac1cc849..3f83305f4 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/codec/binary/BinarySerializationTests.java @@ -20,6 +20,9 @@ * =========================LICENSE_END================================== */ +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Strings; @@ -48,18 +51,69 @@ import org.xrpl.xrpl4j.model.ledger.RippleStateObject; import org.xrpl.xrpl4j.model.ledger.SignerEntry; import org.xrpl.xrpl4j.model.ledger.SignerEntryWrapper; -import org.xrpl.xrpl4j.model.transactions.*; +import org.xrpl.xrpl4j.model.transactions.AccountDelete; +import org.xrpl.xrpl4j.model.transactions.AccountSet; +import org.xrpl.xrpl4j.model.transactions.Address; +import org.xrpl.xrpl4j.model.transactions.AmmBid; +import org.xrpl.xrpl4j.model.transactions.AmmCreate; +import org.xrpl.xrpl4j.model.transactions.AmmDelete; +import org.xrpl.xrpl4j.model.transactions.AmmDeposit; +import org.xrpl.xrpl4j.model.transactions.AmmVote; +import org.xrpl.xrpl4j.model.transactions.AmmWithdraw; +import org.xrpl.xrpl4j.model.transactions.AssetPrice; +import org.xrpl.xrpl4j.model.transactions.CheckCancel; +import org.xrpl.xrpl4j.model.transactions.CheckCash; +import org.xrpl.xrpl4j.model.transactions.CheckCreate; +import org.xrpl.xrpl4j.model.transactions.CurrencyAmount; +import org.xrpl.xrpl4j.model.transactions.DepositPreAuth; +import org.xrpl.xrpl4j.model.transactions.DidData; +import org.xrpl.xrpl4j.model.transactions.DidDelete; +import org.xrpl.xrpl4j.model.transactions.DidDocument; +import org.xrpl.xrpl4j.model.transactions.DidSet; +import org.xrpl.xrpl4j.model.transactions.DidUri; +import org.xrpl.xrpl4j.model.transactions.EscrowCancel; +import org.xrpl.xrpl4j.model.transactions.EscrowCreate; +import org.xrpl.xrpl4j.model.transactions.EscrowFinish; +import org.xrpl.xrpl4j.model.transactions.Hash256; +import org.xrpl.xrpl4j.model.transactions.IssuedCurrencyAmount; +import org.xrpl.xrpl4j.model.transactions.NetworkId; +import org.xrpl.xrpl4j.model.transactions.OfferCancel; +import org.xrpl.xrpl4j.model.transactions.OfferCreate; +import org.xrpl.xrpl4j.model.transactions.OracleDelete; +import org.xrpl.xrpl4j.model.transactions.OracleDocumentId; +import org.xrpl.xrpl4j.model.transactions.OracleProvider; +import org.xrpl.xrpl4j.model.transactions.OracleSet; +import org.xrpl.xrpl4j.model.transactions.Payment; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelClaim; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelCreate; +import org.xrpl.xrpl4j.model.transactions.PaymentChannelFund; +import org.xrpl.xrpl4j.model.transactions.PriceData; +import org.xrpl.xrpl4j.model.transactions.PriceDataWrapper; +import org.xrpl.xrpl4j.model.transactions.SetRegularKey; +import org.xrpl.xrpl4j.model.transactions.SignerListSet; +import org.xrpl.xrpl4j.model.transactions.TradingFee; +import org.xrpl.xrpl4j.model.transactions.Transaction; +import org.xrpl.xrpl4j.model.transactions.TrustSet; +import org.xrpl.xrpl4j.model.transactions.XChainAccountCreateCommit; +import org.xrpl.xrpl4j.model.transactions.XChainAddAccountCreateAttestation; +import org.xrpl.xrpl4j.model.transactions.XChainAddClaimAttestation; +import org.xrpl.xrpl4j.model.transactions.XChainBridge; +import org.xrpl.xrpl4j.model.transactions.XChainClaim; +import org.xrpl.xrpl4j.model.transactions.XChainClaimId; +import org.xrpl.xrpl4j.model.transactions.XChainCommit; +import org.xrpl.xrpl4j.model.transactions.XChainCount; +import org.xrpl.xrpl4j.model.transactions.XChainCreateBridge; +import org.xrpl.xrpl4j.model.transactions.XChainCreateClaimId; +import org.xrpl.xrpl4j.model.transactions.XChainModifyBridge; +import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; import java.math.BigDecimal; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - public class BinarySerializationTests { - + ObjectMapper objectMapper = ObjectMapperFactory.create(); XrplBinaryCodec binaryCodec = XrplBinaryCodec.getInstance(); - + private static IssuedCurrencyAmount currencyAmount(int amount) { return IssuedCurrencyAmount.builder() .currency("WCG") @@ -67,7 +121,7 @@ private static IssuedCurrencyAmount currencyAmount(int amount) { .value(amount + "") .build(); } - + @Test public void serializeAccountSetTransactionWithNetworkId() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -76,12 +130,12 @@ public void serializeAccountSetTransactionWithNetworkId() throws JsonProcessingE .sequence(UnsignedInteger.valueOf(10598)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000321FFFFFFFF240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA03" + "8E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithPresentOptionalStringFields() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -94,14 +148,14 @@ public void serializeAccountSetTransactionWithPresentOptionalStringFields() thro .emailHash("F9879D71855B5FF21E4963273A886BFC") .walletLocator("F9879D71855B5FF21E4963273A886BFCF9879D71855B5FF21E4963273A886BFC") .build(); - + String expectedBinary = "12000321FFFFFFFF240000296641F9879D71855B5FF21E4963273A886BFC57F98" + "79D71855B5FF21E4963273A886BFCF9879D71855B5FF21E4963273A886BFC68400000000000000A722103AB" + "40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB73007702ABCD81140F3D0C7D2" + "CFAB2EC8295451F0B3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithEmptyStrings() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -112,12 +166,12 @@ public void serializeAccountSetTransactionWithEmptyStrings() throws JsonProcessi .domain("") .messageKey("") .build(); - + String expectedBinary = "12000321FFFFFFFF240000296668400000000000000A72007300" + "770081140F3D0C7D2CFAB2EC8295451F0B3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithEmptyFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -125,12 +179,12 @@ public void serializeAccountSetTransactionWithEmptyFlags() throws JsonProcessing .fee(XrpCurrencyAmount.ofDrops(10)) .sequence(UnsignedInteger.valueOf(10598)) .build(); - + String expectedBinary = "120003240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA03" + "8E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithZeroFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -139,12 +193,12 @@ public void serializeAccountSetTransactionWithZeroFlags() throws JsonProcessingE .sequence(UnsignedInteger.valueOf(10598)) .flags(AccountSetTransactionFlags.of(0L)) .build(); - + String expectedBinary = "1200032200000000240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B" + "3CA038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountSetTransactionWithNonZeroFlags() throws JsonProcessingException { AccountSet accountSet = AccountSet.builder() @@ -153,12 +207,12 @@ public void serializeAccountSetTransactionWithNonZeroFlags() throws JsonProcessi .sequence(UnsignedInteger.valueOf(10598)) .flags(AccountSetTransactionFlags.builder().tfDisallowXrp().build()) .build(); - + String expectedBinary = "1200032280100000240000296668400000000000000A730081140F3D0C7D2CFAB2EC8295451F0B3CA" + "038E8E9CDCD"; assertSerializesAndDeserializes(accountSet, expectedBinary); } - + @Test public void serializeAccountDelete() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -169,12 +223,12 @@ public void serializeAccountDelete() throws JsonProcessingException { .destinationTag(UnsignedInteger.valueOf(13)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001521FFFFFFFF240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeAccountDeleteWithZeroFlags() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -185,12 +239,12 @@ public void serializeAccountDeleteWithZeroFlags() throws JsonProcessingException .destinationTag(UnsignedInteger.valueOf(13)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200152200000000240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeAccountDeleteWithNonZeroFlags() throws JsonProcessingException { AccountDelete accountDelete = AccountDelete.builder() @@ -201,12 +255,12 @@ public void serializeAccountDeleteWithNonZeroFlags() throws JsonProcessingExcept .destinationTag(UnsignedInteger.valueOf(13)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200152280000000240025B3092E0000000D6840000000004C4B40730081140596915CFDEEE" + "3A695B3EFD6BDA9AC788A368B7B8314F667B0CA50CC7709A220B0561B85E53A48461FA8"; assertSerializesAndDeserializes(accountDelete, expectedBinary); } - + @Test public void serializeCheckCancel() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -216,12 +270,12 @@ public void serializeCheckCancel() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(12)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001221FFFFFFFF240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCancelWithZeroFlags() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -231,12 +285,12 @@ public void serializeCheckCancelWithZeroFlags() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(12)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200122200000000240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCancelWithNonZeroFlags() throws JsonProcessingException { CheckCancel checkCancel = CheckCancel.builder() @@ -246,12 +300,12 @@ public void serializeCheckCancelWithNonZeroFlags() throws JsonProcessingExceptio .fee(XrpCurrencyAmount.ofDrops(12)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200122280000000240000000C501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97" + "F67E9977FB068400000000000000C730081147990EC5D1D8DF69E070A968D4B186986FDF06ED0"; assertSerializesAndDeserializes(checkCancel, expectedBinary); } - + @Test public void serializeCheckCashWithZeroFlags() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -262,12 +316,12 @@ public void serializeCheckCashWithZeroFlags() throws JsonProcessingException { .amount(XrpCurrencyAmount.ofDrops(100)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120011220000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithNonZeroFlags() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -278,12 +332,12 @@ public void serializeCheckCashWithNonZeroFlags() throws JsonProcessingException .amount(XrpCurrencyAmount.ofDrops(100)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithXrpAmount() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -294,12 +348,12 @@ public void serializeCheckCashWithXrpAmount() throws JsonProcessingException { .amount(XrpCurrencyAmount.ofDrops(100)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001121FFFFFFFF24000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4" + "056FCBD657F5733461400000000000006468400000000000000C7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithXrpDeliverMin() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -309,12 +363,12 @@ public void serializeCheckCashWithXrpDeliverMin() throws JsonProcessingException .fee(XrpCurrencyAmount.ofDrops(12)) .deliverMin(XrpCurrencyAmount.ofDrops(100)) .build(); - + String expectedBinary = "12001124000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056" + "FCBD657F5733468400000000000000C6A40000000000000647300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test public void serializeCheckCashWithIssuedCurrencyDeliverMin() throws JsonProcessingException { CheckCash checkCash = CheckCash.builder() @@ -328,13 +382,13 @@ public void serializeCheckCashWithIssuedCurrencyDeliverMin() throws JsonProcessi .value("100") .build()) .build(); - + String expectedBinary = "12001124000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A40" + "56FCBD657F5733468400000000000000C6AD5038D7EA4C68000000000000000000000000000555344000000000049FF0C73CA" + "6AF9733DA805F76CA2C37776B7C46B7300811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCash, expectedBinary); } - + @Test void serializeCheckCreate() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -348,13 +402,13 @@ void serializeCheckCreate() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001021FFFFFFFF24000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeCheckCreateWithZeroFlags() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -368,13 +422,13 @@ void serializeCheckCreateWithZeroFlags() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120010220000000024000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeCheckCreateWithNonZeroFlags() throws JsonProcessingException { CheckCreate checkCreate = CheckCreate.builder() @@ -388,13 +442,13 @@ void serializeCheckCreateWithNonZeroFlags() throws JsonProcessingException { .invoiceId(Hash256.of("6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B")) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120010228000000024000000012A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C" + "15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E100730081147990EC5D1D8DF69E070A96" + "8D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeDepositPreAuth() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -404,12 +458,12 @@ void serializeDepositPreAuth() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001321FFFFFFFF240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeDepositPreAuthWithZeroFlags() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -419,12 +473,12 @@ void serializeDepositPreAuthWithZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200132200000000240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeDepositPreAuthWithNonZeroFlags() throws JsonProcessingException { DepositPreAuth preAuth = DepositPreAuth.builder() @@ -434,12 +488,12 @@ void serializeDepositPreAuthWithNonZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(65)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200132280000000240000004168400000000000000A730081148A928D14A643F388AC0D26B" + "AF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"; assertSerializesAndDeserializes(preAuth, expectedBinary); } - + @Test void serializeEscrowCreate() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -456,13 +510,13 @@ void serializeEscrowCreate() throws JsonProcessingException, DerEncodingExceptio ) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000121FFFFFFFF24000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCreateWithZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -479,13 +533,13 @@ void serializeEscrowCreateWithZeroFlags() throws JsonProcessingException, DerEnc ) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "120001220000000024000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCreateWithNonZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowCreate checkCreate = EscrowCreate.builder() @@ -502,13 +556,13 @@ void serializeEscrowCreateWithNonZeroFlags() throws JsonProcessingException, Der ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "120001228000000024000000012E00005BB82024258D09812025258D0980614000000000000064684" + "00000000000000C7300701127A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100" + "8114EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA8314B5F762798A53D543A014CAF8B297CFF8F2F937E8"; assertSerializesAndDeserializes(checkCreate, expectedBinary); } - + @Test void serializeEscrowCancel() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -519,12 +573,12 @@ void serializeEscrowCancel() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000421FFFFFFFF240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowCancelWithZeroFlags() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -535,12 +589,12 @@ void serializeEscrowCancelWithZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200042200000000240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowCancelWithNonZeroFlags() throws JsonProcessingException { EscrowCancel escrowCancel = EscrowCancel.builder() @@ -551,12 +605,12 @@ void serializeEscrowCancelWithNonZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(25)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200042280000000240000000120190000001968400000000000000C73008114EE5F7CF61504C7" + "CF7E0C22562EB19CC7ACB0FCBA8214EE5F7CF61504C7CF7E0C22562EB19CC7ACB0FCBA"; assertSerializesAndDeserializes(escrowCancel, expectedBinary); } - + @Test void serializeEscrowFinish() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -571,13 +625,13 @@ void serializeEscrowFinish() throws JsonProcessingException, DerEncodingExceptio .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000221FFFFFFFF240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeEscrowFinishWithZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -592,13 +646,13 @@ void serializeEscrowFinishWithZeroFlags() throws JsonProcessingException, DerEnc .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200022200000000240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeEscrowFinishWithNonZeroFlags() throws JsonProcessingException, DerEncodingException { EscrowFinish escrowFinish = EscrowFinish.builder() @@ -613,23 +667,23 @@ void serializeEscrowFinishWithNonZeroFlags() throws JsonProcessingException, Der .fulfillment(CryptoConditionReader.readFulfillment(BaseEncoding.base16().decode("A0028000"))) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200022280000000240000000320190000001968400000000000014A7300701004A0028000701127A02" + "58020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B8558101008114E151CA3207BAB5B91D2F0E4D35" + "ECDFD4551C69A18214E151CA3207BAB5B91D2F0E4D35ECDFD4551C69A1"; assertSerializesAndDeserializes(escrowFinish, expectedBinary); } - + @Test void serializeXrpPaymentWithEmptyFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -640,22 +694,22 @@ void serializeXrpPaymentWithEmptyFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000021FFFFFFFF230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeXrpPaymentWithZeroFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -666,22 +720,22 @@ void serializeXrpPaymentWithZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .flags(PaymentFlags.UNSET) .build(); - + String expectedBinary = "1200002200000000230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeXrpPaymentWithNonZeroFlags() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Payment payment = Payment.builder() .account(source) .destination(destination) @@ -692,32 +746,32 @@ void serializeXrpPaymentWithNonZeroFlags() throws JsonProcessingException { .sequence(UnsignedInteger.valueOf(56565656)) .flags(PaymentFlags.builder().tfPartialPayment(true).build()) .build(); - + String expectedBinary = "1200002280020000230000000124035F1F982E0000000261400000000000303968" + "400000000000031573008114EE39E6D05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializeIssuedCurrencyPayment() throws JsonProcessingException { Address source = Address.builder() .value("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK") .build(); - + Address destination = Address.builder() .value("rrrrrrrrrrrrrrrrrrrrBZbvji") .build(); - + Address issuer = Address.builder() .value("rDgZZ3wyprx4ZqrGQUkquE9Fs2Xs8XBcdw") .build(); - + CurrencyAmount amount = IssuedCurrencyAmount.builder() .currency("USD") .issuer(issuer) .value("1234567890123456") .build(); - + Payment payment = Payment.builder() .flags(PaymentFlags.builder() .tfPartialPayment(true) @@ -730,13 +784,13 @@ void serializeIssuedCurrencyPayment() throws JsonProcessingException { .fee(XrpCurrencyAmount.ofDrops(789)) .sequence(UnsignedInteger.valueOf(1)) .build(); - + String expectedBinary = "1200002280020000230000000124000000012E0000000261D84462D53C8ABAC000000000000000" + "000000000055534400000000008B1CE810C13D6F337DAC85863B3D70265A24DF4468400000000000031573008114EE39E6D" + "05CFD6A90DAB700A1D70149ECEE29DFEC83140000000000000000000000000000000000000001"; assertSerializesAndDeserializes(payment, expectedBinary); } - + @Test void serializePaymentChannelCreateWithEmptyFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -752,13 +806,13 @@ void serializePaymentChannelCreateWithEmptyFlags() throws JsonProcessingExceptio .cancelAfter(UnsignedLong.valueOf(533171558)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000D21FFFFFFFF230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelCreateWithZeroFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -774,13 +828,13 @@ void serializePaymentChannelCreateWithZeroFlags() throws JsonProcessingException .cancelAfter(UnsignedLong.valueOf(533171558)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000D2200000000230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelCreateWithNonZeroFlags() throws JsonProcessingException { PaymentChannelCreate create = PaymentChannelCreate.builder() @@ -796,13 +850,13 @@ void serializePaymentChannelCreateWithNonZeroFlags() throws JsonProcessingExcept .cancelAfter(UnsignedLong.valueOf(533171558)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000D2280000000230000000124000000012E0000000220241FC78D66202700000001614000" + "000000002710684000000000000064712132D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0" + "F0A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA983144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; assertSerializesAndDeserializes(create, expectedBinary); } - + @Test void serializePaymentChannelClaimWithEmptyFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -817,16 +871,16 @@ void serializePaymentChannelClaimWithEmptyFlags() throws JsonProcessingException .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000F21FFFFFFFF24000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelClaimWithZeroFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -841,16 +895,16 @@ void serializePaymentChannelClaimWithZeroFlags() throws JsonProcessingException .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .flags(PaymentChannelClaimFlags.of(0)) .build(); - + String expectedBinary = "12000F220000000024000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelClaimWithNonZeroFlags() throws JsonProcessingException { PaymentChannelClaim claim = PaymentChannelClaim.builder() @@ -865,16 +919,16 @@ void serializePaymentChannelClaimWithNonZeroFlags() throws JsonProcessingExcepti "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .build(); - + String expectedBinary = "12000F228002000024000000015016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749D" + "CDD3B9E5992CA61986140000000000F42406240000000000F424068400000000000000A712132D2471DB72B27E3310F355B" + "B33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A7300764630440220718D264EF05CAED7C781FF6DE298DCAC68D002562" + "C9BF3A07C1E721B420C0DAB02203A5A4779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B81142042" + "88D2E47F8EF6C99BCC457966320D12409711"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializePaymentChannelFund() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -886,13 +940,13 @@ void serializePaymentChannelFund() throws JsonProcessingException { .expiration(UnsignedLong.valueOf(543171558)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedJson = "12000E21FFFFFFFF24000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializePaymentChannelFundWithZeroFlags() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -904,13 +958,13 @@ void serializePaymentChannelFundWithZeroFlags() throws JsonProcessingException { .expiration(UnsignedLong.valueOf(543171558)) .flags(TransactionFlags.UNSET) .build(); - + String expectedJson = "12000E220000000024000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializePaymentChannelFundWithNonZeroFlags() throws JsonProcessingException { PaymentChannelFund fund = PaymentChannelFund.builder() @@ -922,13 +976,13 @@ void serializePaymentChannelFundWithNonZeroFlags() throws JsonProcessingExceptio .expiration(UnsignedLong.valueOf(543171558)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedJson = "12000E228000000024000000012A206023E65016C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC7" + "49DCDD3B9E5992CA6198614000000000030D4068400000000000000A730081144B4E9C06F24296074F7BC48F92A97916C6DC5EA9"; - + assertSerializesAndDeserializes(fund, expectedJson); } - + @Test void serializeTrustSetWithEmptyFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -942,13 +996,13 @@ void serializeTrustSetWithEmptyFlags() throws JsonProcessingException { .build()) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12001421FFFFFFFF240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithZeroFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -962,13 +1016,13 @@ void serializeTrustSetWithZeroFlags() throws JsonProcessingException { .value("10000000") .build()) .build(); - + String expectedBinary = "1200142200000000240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithNonZeroFlags() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -984,13 +1038,13 @@ void serializeTrustSetWithNonZeroFlags() throws JsonProcessingException { .value("10000000") .build()) .build(); - + String expectedBinary = "1200142280020000240000002C63D6438D7EA4C68000000000000000000000000000574347000000" + "0000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000000C73008114BE6C30732AE33CF2AF3344CE8172A6B9" + "300183E3"; assertSerializesAndDeserializes(trustSet, expectedBinary); } - + @Test void serializeTrustSetWithMaxValue() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1006,26 +1060,26 @@ void serializeTrustSetWithMaxValue() throws JsonProcessingException { PublicKey.fromBase16EncodedPublicKey("EDD299D60BCE7980F6082945B5597FFFD35223F1950673BFA4D4AED6FDE5097156") ) .build(); - + String expectedBinary = "120014240000000563EC6386F26FC0FFFF7872706C346A436F696E00000000000000000000" + "6AF21A4FCA7AF4F62AA88E72CA923CDAE72FBC1668400000000000000A7321EDD299D60BCE7980F6082945B5597FFFD35223F19506" + "73BFA4D4AED6FDE5097156811473C6A5937EB779F5CF33600DB0ADB8556A497318"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, objectMapper.getTypeFactory().constructType(TrustSet.class) ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.toPlainString()).isEqualTo(originalValue.toPlainString()); } - + @Test void serializeTrustSetWithMaxValueMinusOnePowerOfTen() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1041,26 +1095,26 @@ void serializeTrustSetWithMaxValueMinusOnePowerOfTen() throws JsonProcessingExce PublicKey.fromBase16EncodedPublicKey("ED930B5CBBBCA68DE43CC928E4F3860151E1E5F10D52478B38512651363F4DE8D0") ) .build(); - + String expectedBinary = "120014240000000563EC2386F26FC0FFFF7872706C346A436F696E00000000000000000000" + "7F65AB9FC20D6D3140698670A12869D6A7D9EE9568400000000000000A7321ED930B5CBBBCA68DE43CC928E4F3860151E1E5F10D52" + "478B38512651363F4DE8D08114EBC899C616EE2D4765C3CBBEB51E6131F701537C"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, objectMapper.getTypeFactory().constructType(TrustSet.class) ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.toPlainString()).isEqualTo(originalValue.toPlainString()); } - + @Test void serializeTrustSetWithMaxValuePlusOnePowerOfTenThrows() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1076,13 +1130,13 @@ void serializeTrustSetWithMaxValuePlusOnePowerOfTenThrows() throws JsonProcessin .value(new BigDecimal(IssuedCurrencyAmount.MAX_VALUE).scaleByPowerOfTen(1).toEngineeringString()) .build()) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeTrustSetWithMaxValuePlusOneThrows() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1098,13 +1152,13 @@ void serializeTrustSetWithMaxValuePlusOneThrows() throws JsonProcessingException .value(new BigDecimal(IssuedCurrencyAmount.MAX_VALUE).add(BigDecimal.ONE).toEngineeringString()) .build()) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessageEndingWith("has more than 16 digits"); } - + @Test void serializeTrustSetWithMinPositiveValue() throws JsonProcessingException { TrustSet trustSet = TrustSet.builder() @@ -1120,26 +1174,26 @@ void serializeTrustSetWithMinPositiveValue() throws JsonProcessingException { PublicKey.fromBase16EncodedPublicKey("ED55D61E72F14EC798ABC10BC96381573717658B46F58E416EC0C74A467835AB4D") ) .build(); - + String expectedBinary = "120014240000000563C0438D7EA4C680007872706C346A436F696E00000000000" + "00000000002B8C37A261B75FC294AC84B40D249456715277D68400000000000000A7321ED55D61E72F14EC798ABC10BC9" + "6381573717658B46F58E416EC0C74A467835AB4D8114D8C033D20D216FD8939778C229F8BD9CF9585EAC"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, TrustSet.class ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.setScale(96).toString()).isEqualTo(originalValue.toString()); } - + @Test void serializeTrustSetWithMinPositiveValuePlusOne() throws JsonProcessingException { BigDecimal value = new BigDecimal(IssuedCurrencyAmount.MIN_POSITIVE_VALUE) @@ -1157,26 +1211,26 @@ void serializeTrustSetWithMinPositiveValuePlusOne() throws JsonProcessingExcepti PublicKey.fromBase16EncodedPublicKey("ED098659726D4B0CDCD35E37135766FF2038579291351CC08DE70C32851D049A83") ) .build(); - + String expectedBinary = "120014240000000563C043E871B540C0007872706C346A436F696E000000000000000" + "00000ED7C3F2940D37A688A1D3F9AB883A8E3AB4D5FE168400000000000000A7321ED098659726D4B0CDCD35E37135766FF20" + "38579291351CC08DE70C32851D049A838114FC675B42929326571785885ECD4E61FA82F4AAAC"; String transactionJson = objectMapper.writeValueAsString(trustSet); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); TrustSet deserialized = objectMapper.readValue( decodedBinary, TrustSet.class ); - + assertThat(deserialized).usingRecursiveComparison().ignoringFields("limitAmount").isEqualTo(trustSet); BigDecimal deserializedValue = new BigDecimal(deserialized.limitAmount().value()); BigDecimal originalValue = new BigDecimal(trustSet.limitAmount().value()); assertThat(deserializedValue.setScale(96).toString()).isEqualTo(originalValue.setScale(96).toString()); } - + @Test void serializeTrustSetWithMinPositiveValueMinusOneThrows() throws JsonProcessingException { BigDecimal value = new BigDecimal(IssuedCurrencyAmount.MIN_POSITIVE_VALUE) @@ -1194,13 +1248,13 @@ void serializeTrustSetWithMinPositiveValueMinusOneThrows() throws JsonProcessing PublicKey.fromBase16EncodedPublicKey("ED098659726D4B0CDCD35E37135766FF2038579291351CC08DE70C32851D049A83") ) .build(); - + String transactionJson = objectMapper.writeValueAsString(trustSet); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingException { RippleStateObject rippleStateObject = RippleStateObject.builder() @@ -1230,7 +1284,7 @@ void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingExcept .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "1100722200200000250000000155000000000000000000000000000000000000000000000000000000000" + "000000062AC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E366" + "EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC6386F26" + @@ -1239,7 +1293,7 @@ void serializeRippleStateObjectWithMinBalanceValue() throws JsonProcessingExcept String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MIN_VALUE).subtract( @@ -1274,7 +1328,7 @@ void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessin .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "11007222002000002500000001550000000000000000000000000000000000000000000000000000000" + "00000000062AC632BFF5F46BFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183" + "E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC6" + @@ -1283,7 +1337,7 @@ void serializeRippleStateObjectWithMinBalanceValuePlusOne() throws JsonProcessin String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMinBalanceValueMinusOneThrows() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MIN_VALUE).subtract(new BigDecimal("1e80")) @@ -1317,14 +1371,14 @@ void serializeRippleStateObjectWithMinBalanceValueMinusOneThrows() throws JsonPr .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String transactionJson = objectMapper.writeValueAsString(rippleStateObject); assertThatThrownBy( () -> binaryCodec.encode(transactionJson) ).isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingException { RippleStateObject rippleStateObject = RippleStateObject.builder() @@ -1354,7 +1408,7 @@ void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingExcep .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "110072220020000025000000015500000000000000000000000000000000000000000000000000" + "000000000000006280438D7EA4C680000000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172" + "A6B9300183E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6" + @@ -1364,7 +1418,7 @@ void serializeRippleStateObjectWithMaxNegativeValue() throws JsonProcessingExcep String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MAX_NEGATIVE_VALUE) @@ -1396,7 +1450,7 @@ void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcess .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String expectedBinary = "11007222002000002500000001550000000000000000000000000000000000000000000000000000000" + "000000000628043E871B540C0000000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183" + "E366EC6386F26FC0FFFF0000000000000000000000005553440000000000BE6C30732AE33CF2AF3344CE8172A6B9300183E367AC" + @@ -1405,7 +1459,7 @@ void serializeRippleStateObjectWithMaxNegativeValueMinusOne() throws JsonProcess String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); } - + @Test void serializeRippleStateObjectWithMaxNegativeValuePlusOneThrows() throws JsonProcessingException { String value = new BigDecimal(IssuedCurrencyAmount.MAX_NEGATIVE_VALUE) @@ -1437,13 +1491,13 @@ void serializeRippleStateObjectWithMaxNegativeValuePlusOneThrows() throws JsonPr .previousTransactionLedgerSequence(UnsignedInteger.ONE) .index(Hash256.of(Strings.repeat("0", 64))) .build(); - + String transactionJson = objectMapper.writeValueAsString(rippleStateObject); assertThatThrownBy(() -> binaryCodec.encode(transactionJson)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("exponent out of range"); } - + @Test public void serializeOfferCreateWithEmptyFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1456,14 +1510,14 @@ public void serializeOfferCreateWithEmptyFlags() throws JsonProcessingException .expiration(UnsignedInteger.valueOf(456)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000721FFFFFFFF2400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCreateWithZeroFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1476,14 +1530,14 @@ public void serializeOfferCreateWithZeroFlags() throws JsonProcessingException { .flags(OfferCreateFlags.of(0)) .expiration(UnsignedInteger.valueOf(456)) .build(); - + String expectedBinary = "12000722000000002400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCreateWithNonZeroFlags() throws JsonProcessingException { OfferCreate offerCreate = OfferCreate.builder() @@ -1496,14 +1550,14 @@ public void serializeOfferCreateWithNonZeroFlags() throws JsonProcessingExceptio .flags(OfferCreateFlags.builder().tfSell(true).build()) .expiration(UnsignedInteger.valueOf(456)) .build(); - + String expectedBinary = "12000722800800002400AB41302A000001C820190000007B64D5071AFD498D0000000000000000000" + "0000000005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE465D5038D7EA4C6800000000000000000000000" + "00005743470000000000832297BEF589D59F9C03A84F920F8D9128CC1CE468400000000000012C73008114832297BEF589D59F9" + "C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancel() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1513,12 +1567,12 @@ public void serializeOfferCancel() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(123)) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000821FFFFFFFF2400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancelWithZeroFlags() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1528,12 +1582,12 @@ public void serializeOfferCancelWithZeroFlags() throws JsonProcessingException { .offerSequence(UnsignedInteger.valueOf(123)) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000822000000002400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeOfferCancelWithNonZeroFlags() throws JsonProcessingException { OfferCancel offerCreate = OfferCancel.builder() @@ -1543,12 +1597,12 @@ public void serializeOfferCancelWithNonZeroFlags() throws JsonProcessingExceptio .offerSequence(UnsignedInteger.valueOf(123)) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000822800000002400AB413020190000007B68400000000000012C73008114832297BEF589" + "D59F9C03A84F920F8D9128CC1CE4"; assertSerializesAndDeserializes(offerCreate, expectedBinary); } - + @Test public void serializeSetRegularKey() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1558,13 +1612,13 @@ public void serializeSetRegularKey() throws JsonProcessingException { .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000521FFFFFFFF240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test public void serializeSetRegularKeyWithZeroFlags() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1574,13 +1628,13 @@ public void serializeSetRegularKeyWithZeroFlags() throws JsonProcessingException .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "1200052200000000240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test public void serializeSetRegularKeyWithNonZeroFlags() throws JsonProcessingException { SetRegularKey setRegularKey = SetRegularKey.builder() @@ -1590,13 +1644,13 @@ public void serializeSetRegularKeyWithNonZeroFlags() throws JsonProcessingExcept .regularKey(Address.of("rAR8rR8sUkBoCZFawhkWzY4Y5YoyuznwD")) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "1200052280000000240000000168400000000000000C730081144B4E9C06F24296074F7BC48F92" + "A97916C6DC5EA988140A4B24D606281E6E5A78D9F80E039F5E66FA5AC5"; - + assertSerializesAndDeserializes(setRegularKey, expectedBinary); } - + @Test void serializeSignerListSet() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1626,14 +1680,14 @@ void serializeSignerListSet() throws JsonProcessingException { ) .networkId(NetworkId.of(UnsignedInteger.MAX_VALUE)) .build(); - + String expectedBinary = "12000C21FFFFFFFF240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeSignerListSetWithZeroFlags() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1663,14 +1717,14 @@ void serializeSignerListSetWithZeroFlags() throws JsonProcessingException { ) .flags(TransactionFlags.UNSET) .build(); - + String expectedBinary = "12000C2200000000240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeSignerListSetWithNonZeroFlags() throws JsonProcessingException { SignerListSet signerListSet = SignerListSet.builder() @@ -1700,14 +1754,14 @@ void serializeSignerListSetWithNonZeroFlags() throws JsonProcessingException { ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String expectedBinary = "12000C2280000000240000000120230000000368400000000000000C730081144B4E9C06F24296074" + "F7BC48F92A97916C6DC5EA9F4EB1300028114204288D2E47F8EF6C99BCC457966320D12409711E1EB13000181147908A7F0EDD4" + "8EA896C3580A399F0EE78611C8E3E1EB13000181143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1"; - + assertSerializesAndDeserializes(signerListSet, expectedBinary); } - + @Test void serializeXChainAccountCreateCommitTest() throws JsonProcessingException { XChainAccountCreateCommit commit = XChainAccountCreateCommit.builder() @@ -1738,17 +1792,17 @@ void serializeXChainAccountCreateCommitTest() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "12002C228000000024000000016140000000000F424068400000000000000A601D4000000000002" + "71073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402202984DDE7F0B566F0" + "81F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B" + "8123CD2C9F5CF188114B5F762798A53D543A014CAF8B297CFF8F2F937E88314AF80285F637EE4AF3C20378F9DFB12511ACB8D" + "27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E" + "785DC231A1058A05E56E3F09CF4E60000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C"; - + assertSerializesAndDeserializes(commit, expectedBinary); } - + @Test void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException { XChainAddAccountCreateAttestation attestation = XChainAddAccountCreateAttestation.builder() @@ -1787,7 +1841,7 @@ void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException "2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F4205800") ) .build(); - + String expectedBinary = "12002E2400000005201B0000000D3015FFFFFFFFFFFFFFFF61400000000098968068400000000000001" + "4601D40000000000000647121ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC27321EDF54108BA" + "2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1744003E74AEF1F585F156786429D2FC87A89E5C6B5A56D68B" + @@ -1797,10 +1851,10 @@ void serializeXChainAddAccountCreateAttestation() throws JsonProcessingException "9A79DEA67CB5D585111FEF0A29203FA0408014145E7A3E3D7200A794FA801C66CE3775B6416EE4128015145E7A3E3D7200A794FA8" + "01C66CE3775B6416EE4120010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000" + "000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(attestation, expectedBinary); } - + @Test void serializeXChainAddClaimAttestation() throws JsonProcessingException { XChainAddClaimAttestation attestation = XChainAddClaimAttestation.builder() @@ -1838,7 +1892,7 @@ void serializeXChainAddClaimAttestation() throws JsonProcessingException { "741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF04") ) .build(); - + String expectedBinary = "12002D2400000009201B000000133014FFFFFFFFFFFFFFFF614000000000989680684000000000000014" + "7121ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E11367321ED0406B134786FE0751717226657F7BF" + "8AFE96442C05D28ACEC66FB64852BA604C7440D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8" + @@ -1848,10 +1902,10 @@ void serializeXChainAddClaimAttestation() throws JsonProcessingException { "203FA0408014141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598015141F30A4D728AB98B0950EC3B9815E6C8D43A7D559001013" + "0101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543" + "A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(attestation, expectedBinary); } - + @Test void serializeXChainClaim() throws JsonProcessingException { XChainClaim claim = XChainClaim.builder() @@ -1878,17 +1932,17 @@ void serializeXChainClaim() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "12002B228000000024000000013014FFFFFFFFFFFFFFFF61400000000000271068400000000000000A" + "73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220445F7469FDA401787D9EE8" + "A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72C" + "ED142E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88314550FC62003E785DC231A1058A05E56E3F09CF4E6011914AF80" + "285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05" + "E56E3F09CF4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(claim, expectedBinary); } - + @Test void serializeXChainCommit() throws JsonProcessingException { XChainCommit commit = XChainCommit.builder() @@ -1914,17 +1968,17 @@ void serializeXChainCommit() throws JsonProcessingException { "B13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE") ) .build(); - + String expectedBinary = "12002A228000000024000000013014FFFFFFFFFFFFFFFF6140000000000027106840000000000000" + "0A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074453043021F177323F0D93612C82A" + "4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06E" + "E9B12BBFFE8114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D2700" + "0000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000" + "000000000000000000"; - + assertSerializesAndDeserializes(commit, expectedBinary); } - + @Test void serializeXChainCreateBridge() throws JsonProcessingException { XChainCreateBridge createBridge = XChainCreateBridge.builder() @@ -1950,17 +2004,17 @@ void serializeXChainCreateBridge() throws JsonProcessingException { ) .flags(TransactionFlags.UNSET) .build(); - + String binary = "1200302200000000240000000168400000000000000A601D40000000000003E8601E40000000000027" + "1073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220101BCA4B5B5A" + "37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980F" + "F86FE4269E369F6FC7A270918114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C2037" + "8F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09C" + "F4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(createBridge, binary); } - + @Test void serializeXChainCreateClaimId() throws JsonProcessingException { XChainCreateClaimId claimId = XChainCreateClaimId.builder() @@ -1986,17 +2040,17 @@ void serializeXChainCreateClaimId() throws JsonProcessingException { "15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD") ) .build(); - + String binary = "1200292280000000240000000168400000000000000A601D400000000000271073210330E7FC9D56BB25D68" + "93BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868" + "DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD8114B5F7627" + "98A53D543A014CAF8B297CFF8F2F937E8801214AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF" + "3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F0" + "9CF4E60000000000000000000000000000000000000000"; - + assertSerializesAndDeserializes(claimId, binary); } - + @Test void serializeXChainModifyBridge() throws JsonProcessingException { XChainModifyBridge transaction = XChainModifyBridge.builder() @@ -2022,17 +2076,17 @@ void serializeXChainModifyBridge() throws JsonProcessingException { "4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E5") ) .build(); - + String binary = "12002F2200000000240000000168400000000000000A601D40000000000003E8601E40000000000027107" + "3210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100D2CABC1B0E0635A8E" + "E2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D" + "30B8750BA4805E58114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511AC" + "B8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000" + "000000000000000000000000000"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidSet() throws JsonProcessingException { DidSet transaction = DidSet.builder() @@ -2051,15 +2105,15 @@ void serializeDidSet() throws JsonProcessingException { .data(DidData.of("617474657374")) .uri(DidUri.of("6469645F6578616D706C65")) .build(); - + String binary = "1200312280000000240000000368400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F227" + "958D5C0C111CC7CF947FC5A933477440AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD77299932566" + "7A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C08750B6469645F6578616D706C65701A03646F6370" + "1B06617474657374811401476926B590BA3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidSetWithEmptyValues() throws JsonProcessingException { DidSet transaction = DidSet.builder() @@ -2078,15 +2132,15 @@ void serializeDidSetWithEmptyValues() throws JsonProcessingException { .data(DidData.of("")) .uri(DidUri.of("")) .build(); - + String binary = "1200312280000000240000000368400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F2" + "27958D5C0C111CC7CF947FC5A933477440AACD31A04CAE14670FC483A1382F393AA96B49C84479B58067F049FBD7729993" + "25667A6AA2520A63756EE84F3657298815019DD56A1AECE796B08535C4009C087500701A00701B00811401476926B590BA" + "3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeDidDelete() throws JsonProcessingException { DidDelete transaction = DidDelete.builder() @@ -2102,14 +2156,14 @@ void serializeDidDelete() throws JsonProcessingException { ) .flags(TransactionFlags.FULLY_CANONICAL_SIG) .build(); - + String binary = "1200322280000000240000000468400000000000000A7321ED9861C4CB029C0DA737B823D7D3459A70F22" + "7958D5C0C111CC7CF947FC5A93347744071E28B12465A1B47162C22E121DF61089DCD9AAF5773704B76179E771666886C8AA" + "D5A33A87E34CC381A7D924E3FE3645F0BF98D565DE42C81E1A7A7E7981802811401476926B590BA3245F63C829116A0A3AF7F382D"; - + assertSerializesAndDeserializes(transaction, binary); } - + @Test void serializeOracleSet() throws JsonProcessingException { OracleSet oracleSet = OracleSet.builder() @@ -2169,7 +2223,7 @@ void serializeOracleSet() throws JsonProcessingException { "B40B4101F62264C280C3C9A492B3FF01DCF4AE0CEF12BB6FB2E4EB681B9B81D710A") ) .build(); - + String expectedBinary = "12003324001ECFA62F6644CDA420330000000368400000000000000A7321EDA6501D3E53D47" + "F10AE37A0C6B34194CF8A205DE9611FE81B63E7B62105E90EAC744007205F518BC5D1D4F67E33101F140F692796706278" + "25CDFA4BECDFE7C1D38B40B4101F62264C280C3C9A492B3FF01DCF4AE0CEF12BB6FB2E4EB681B9B81D710A701C0863757" + @@ -2183,7 +2237,7 @@ void serializeOracleSet() throws JsonProcessingException { "0000000004D59520000000000E1F1"; assertSerializesAndDeserializes(oracleSet, expectedBinary); } - + @Test void serializeOracleDelete() throws JsonProcessingException { OracleDelete oracleDelete = OracleDelete.builder() @@ -2198,10 +2252,10 @@ void serializeOracleDelete() throws JsonProcessingException { .build(); String expectedBinary = "120034240000000A201B0000001120330000000168400000000000000F7321ED6884529" + "D21E8059F689827F5BF2AD5CBC138A3427A04C12B004C9BE9BBB22A7781141AFFBE9553C7325305491B100D02E6BED8CE6BA5"; - + assertSerializesAndDeserializes(oracleDelete, expectedBinary); } - + @Test void serializeAmmWithdraw() throws JsonProcessingException { AmmWithdraw ammWithdraw = AmmWithdraw.builder() @@ -2251,7 +2305,7 @@ void serializeAmmWithdraw() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "1200252200010000240000000161D5071AFD498D00000000000000000000000000004C50540000" + "000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D0000000000000000000000" + "0000004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5601AD5071AFD498D0000000000000000000000" + @@ -2262,7 +2316,7 @@ void serializeAmmWithdraw() throws JsonProcessingException { "0000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; assertSerializesAndDeserializes(ammWithdraw, expectedBinary); } - + @Test void serializeAmmBid() throws JsonProcessingException { AmmBid ammBid = AmmBid.builder() @@ -2299,17 +2353,17 @@ void serializeAmmBid() throws JsonProcessingException { AuthAccountWrapper.of(AuthAccount.of(Address.of("rPZtDb6ZHtfYzMmzyUGvehoi2vYhrNAPhy"))) ) .build(); - + String expectedBinary = "120027240000000168400000000000000A6CD5071AFD498D00000000000000000000000000004C5" + "0540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C56DD5071AFD498D00000000000000000000000000004C5054" + "0000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5732102B4A8F64B97151FA303F86417751B7EA5AF1D0014FCC11" + "0C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271F019E01B8114F78AD4FDA66653106AE45EE5FE" + "683C457E6BA9C5E1F103184755534400000000000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9" + "C50418524C555344000000000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammBid, expectedBinary); } - + @Test void serializeAmmCreate() throws JsonProcessingException { AmmCreate ammCreate = AmmCreate.builder() @@ -2335,15 +2389,15 @@ void serializeAmmCreate() throws JsonProcessingException { ) .tradingFee(TradingFee.of(UnsignedInteger.ONE)) .build(); - + String expectedBinary = "120023150001240000000161D5071AFD498D00000000000000000000000000004C505400000000" + "00F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D00000000000000000000000000" + "004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5732102B4A8F64B97151FA303F86417751B7EA5AF1D" + "0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271"; - + assertSerializesAndDeserializes(ammCreate, expectedBinary); } - + @Test void serializeAmmDelete() throws JsonProcessingException { AmmDelete ammDelete = AmmDelete.builder() @@ -2364,15 +2418,15 @@ void serializeAmmDelete() throws JsonProcessingException { .build() ) .build(); - + String expectedBinary = "120028240000000168400000000000000A732102B4A8F64B97151FA303F86417751B7EA5AF1" + "D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000000000" + "00000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C5553440000000000000000000000" + "00000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammDelete, expectedBinary); } - + @Test void serializeAmmDeposit() throws JsonProcessingException { AmmDeposit ammDeposit = AmmDeposit.builder() @@ -2423,7 +2477,7 @@ void serializeAmmDeposit() throws JsonProcessingException { ) .tradingFee(TradingFee.ofPercent(BigDecimal.ONE)) .build(); - + String expectedBinary = "1200241503E82200080000240000000161D5071AFD498D00000000000000000000000000004C50" + "540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C568400000000000000A6BD5071AFD498D0000000000000000" + "0000000000004C50540000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C56019D5071AFD498D0000000000000000" + @@ -2432,10 +2486,10 @@ void serializeAmmDeposit() throws JsonProcessingException { "1B7EA5AF1D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000" + "00000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C55534400000000000000000000" + "0000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammDeposit, expectedBinary); } - + @Test void serializeAmmVote() throws JsonProcessingException { AmmVote ammVote = AmmVote.builder() @@ -2457,15 +2511,15 @@ void serializeAmmVote() throws JsonProcessingException { ) .tradingFee(TradingFee.ofPercent(BigDecimal.ONE)) .build(); - + String expectedBinary = "1200261503E8240000000168400000000000000A732102B4A8F64B97151FA303F86417751B7" + "EA5AF1D0014FCC110C234D04AF15F3F654A81141285FD19EDD3FB7146B87251AFB0E17742B37271031847555344000000" + "00000000000000000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C50418524C55534400000000000000000" + "0000000000000F78AD4FDA66653106AE45EE5FE683C457E6BA9C5"; - + assertSerializesAndDeserializes(ammVote, expectedBinary); } - + private void assertSerializesAndDeserializes( T transaction, String expectedBinary @@ -2473,7 +2527,7 @@ private void assertSerializesAndDeserializes( String transactionJson = objectMapper.writeValueAsString(transaction); String transactionBinary = binaryCodec.encode(transactionJson); assertThat(transactionBinary).isEqualTo(expectedBinary); - + String decodedBinary = binaryCodec.decode(transactionBinary); T deserialized = objectMapper.readValue( decodedBinary, @@ -2481,5 +2535,5 @@ private void assertSerializesAndDeserializes( ); assertThat(deserialized).isEqualTo(transaction); } - + } From 93f49e834abff7211ab0454fda662e0278faebd7 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 12:55:58 -0500 Subject: [PATCH 10/13] Add Preconditions to all Transactions --- .../modules/TransactionDeserializer.java | 27 ++++++++------- .../model/jackson/modules/Xrpl4jModule.java | 6 ++-- .../model/transactions/AccountDelete.java | 12 +++++-- .../xrpl4j/model/transactions/AccountSet.java | 8 +++++ .../xrpl4j/model/transactions/AmmBid.java | 8 +++++ .../xrpl4j/model/transactions/AmmCreate.java | 8 +++++ .../xrpl4j/model/transactions/AmmDelete.java | 8 +++++ .../xrpl4j/model/transactions/AmmDeposit.java | 9 +++++ .../xrpl4j/model/transactions/AmmVote.java | 8 +++++ .../model/transactions/AmmWithdraw.java | 9 +++++ .../model/transactions/CheckCancel.java | 8 +++++ .../xrpl4j/model/transactions/CheckCash.java | 8 +++++ .../model/transactions/CheckCreate.java | 12 +++++-- .../xrpl4j/model/transactions/Clawback.java | 8 +++++ .../model/transactions/DepositPreAuth.java | 8 +++++ .../xrpl4j/model/transactions/DidDelete.java | 8 +++++ .../xrpl4j/model/transactions/DidSet.java | 8 +++++ .../model/transactions/EnableAmendment.java | 9 +++++ .../model/transactions/EscrowCancel.java | 9 +++++ .../model/transactions/EscrowCreate.java | 8 +++++ .../model/transactions/EscrowFinish.java | 7 ++++ .../transactions/NfTokenAcceptOffer.java | 6 ++-- .../model/transactions/NfTokenBurn.java | 9 +++++ .../transactions/NfTokenCancelOffer.java | 8 +++++ .../transactions/NfTokenCreateOffer.java | 9 +++++ .../model/transactions/NfTokenMint.java | 9 +++++ .../model/transactions/OfferCancel.java | 8 +++++ .../model/transactions/OfferCreate.java | 9 ++++- .../model/transactions/OracleDelete.java | 8 +++++ .../xrpl4j/model/transactions/OracleSet.java | 9 +++++ .../xrpl4j/model/transactions/Payment.java | 12 +++++-- .../transactions/PaymentChannelClaim.java | 8 +++++ .../transactions/PaymentChannelCreate.java | 8 +++++ .../transactions/PaymentChannelFund.java | 9 +++++ .../xrpl4j/model/transactions/SetFee.java | 9 +++++ .../model/transactions/SetRegularKey.java | 13 ++++++-- .../model/transactions/SignerListSet.java | 9 +++++ .../model/transactions/TicketCreate.java | 13 ++++++-- .../model/transactions/Transaction.java | 13 ++------ .../model/transactions/TransactionType.java | 1 + .../xrpl4j/model/transactions/TrustSet.java | 8 +++++ .../xrpl4j/model/transactions/UnlModify.java | 33 ++++--------------- .../transactions/UnknownTransactionTest.java | 7 ++-- 43 files changed, 343 insertions(+), 71 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index 0d2e23bbc..24c9d796e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -33,10 +33,10 @@ import java.io.IOException; /** - * Custom deserializer for {@link Transaction}s, which deserializes to a specific {@link Transaction} type based on the - * TransactionType JSON field. + * Custom deserializer for instances of {@link Transaction} that deserialize to a specific {@link Transaction} type + * based on the`TransactionType` JSON field */ -public class TransactionDeserializer extends StdDeserializer { +public class TransactionDeserializer extends StdDeserializer { /** * No-args constructor. @@ -46,19 +46,18 @@ protected TransactionDeserializer() { } @Override - public T deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { - ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec(); - ObjectNode objectNode = objectMapper.readTree(jsonParser); + public Transaction deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { + final ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec(); + final ObjectNode objectNode = objectMapper.readTree(jsonParser); - JsonNode node = objectNode.get("TransactionType"); - TransactionType transactionType = TransactionType.forValue(node.asText()); - @SuppressWarnings("unchecked") - Class transactionTypeClass = (Class) Transaction.typeMap.inverse().get(transactionType); + final JsonNode transactionTypeJsonNode = objectNode.get("TransactionType"); + final TransactionType transactionType = TransactionType.forValue(transactionTypeJsonNode.asText()); + final Class transactionTypeClass = Transaction.typeMap.inverse().get(transactionType); - // Remove the `Account` property from any incoming UnlModify JSON about to be deserialized. This is because the JSON - // returned by the rippled/clio API v1 has a bug where the account value is an empty string. For this particular - // For `UnlModify` only, the Java value for the Account is always set to ACCOUNT_ZERO via a default - // method, so this value is removed from the JSON before deserialization because it's not needed (the default + // Remove the `Account` property from any incoming `UnlModify` JSON about to be deserialized. This is because the + // JSON returned by the rippled/clio API v1 has a bug where the account value in `UnlModify` transactions is an + // empty string. In this case, the Java value for the `Account` property is always set to ACCOUNT_ZERO via a default + // method, so this property is removed from incoming JSON before deserialization because it's not needed (the default // method handles population in Java) and if not removed, this field will end up in the `unknownFields` // map of the ultimate Java object, which is incorrect. if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java index bf9f89bbf..0c968c0b9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/Xrpl4jModule.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -58,7 +58,7 @@ public Xrpl4jModule() { addSerializer(LedgerIndex.class, new LedgerIndexSerializer()); addDeserializer(LedgerIndex.class, new LedgerIndexDeserializer()); - addDeserializer(Transaction.class, new TransactionDeserializer<>()); + addDeserializer(Transaction.class, new TransactionDeserializer()); addDeserializer(ServerInfo.class, new ServerInfoDeserializer()); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index c670b1361..27f4e682b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -80,4 +81,11 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + @Value.Check + default AccountDelete normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ACCOUNT_DELETE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 8814086c5..29d9bb513 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -517,4 +517,12 @@ public int getValue() { return value; } } + + @Value.Check + default AccountSet normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ACCOUNT_SET); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index b52da0635..bab3f6151 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.ledger.AuthAccountWrapper; @@ -107,4 +108,11 @@ default TransactionFlags flags() { @JsonProperty("AuthAccounts") List authAccounts(); + @Value.Check + default AmmBid normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_BID); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index 63838a3c6..d9800d5fd 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -67,4 +68,11 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + @Value.Check + default AmmCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index 6af820fb3..a0508cba9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -58,4 +59,11 @@ default TransactionFlags flags() { @JsonProperty("Asset2") Issue asset2(); + @Value.Check + default AmmDelete normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_DELETE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java index 72bc376c0..c141c7d08 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.AmmDepositFlags; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -105,4 +106,12 @@ static ImmutableAmmDeposit.Builder builder() { */ @JsonProperty("TradingFee") Optional tradingFee(); + + @Value.Check + default AmmDeposit normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_DEPOSIT); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index 9742cfefb..e91e95e4a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -68,5 +69,12 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + @Value.Check + default AmmVote normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_VOTE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index c4208824d..0f0f2201b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; +import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.AmmWithdrawFlags; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -97,4 +99,11 @@ static ImmutableAmmWithdraw.Builder builder() { @JsonProperty("LPTokenIn") Optional lpTokensIn(); + @Value.Check + default AmmWithdraw normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.AMM_WITHDRAW); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index 8ee66aff3..a251c8f54 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -68,4 +69,11 @@ default TransactionFlags flags() { @JsonProperty("CheckID") Hash256 checkId(); + @Value.Check + default CheckCancel normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.CHECK_CANCEL); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index 8dedc75af..bed034c62 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -105,4 +105,12 @@ default void validateOnlyOneAmountSet() { !(amount().isPresent() && deliverMin().isPresent()), "The CheckCash transaction must include either amount or deliverMin, but not both."); } + + @Value.Check + default CheckCash normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.CHECK_CASH); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index b753c3dbb..a0c716ca0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -105,4 +106,11 @@ default TransactionFlags flags() { @JsonProperty("InvoiceID") Optional invoiceId(); + @Value.Check + default CheckCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.CHECK_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java index 8c5c3bdcf..c4ea4de16 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -51,5 +52,12 @@ default TransactionFlags flags() { @JsonProperty("Amount") IssuedCurrencyAmount amount(); + @Value.Check + default Clawback normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.CLAWBACK); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index 5119201ca..74ab22fea 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -92,4 +92,12 @@ default void validateFieldPresence() { !(authorize().isPresent() && unauthorize().isPresent()), "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } + + @Value.Check + default DepositPreAuth normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.DEPOSIT_PRE_AUTH); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index 94bd4d7c4..51249fc6c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -44,4 +45,11 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + @Value.Check + default DidDelete normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.DID_DELETE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java index 95559bfe8..dfd6a2106 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -71,5 +72,12 @@ default TransactionFlags flags() { @JsonProperty("Data") Optional data(); + @Value.Check + default DidSet normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.DID_SET); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index d5eb98a2a..bb4147ba9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; @@ -64,4 +65,12 @@ static ImmutableEnableAmendment.Builder builder() { */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); + + @Value.Check + default EnableAmendment normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ENABLE_AMENDMENT); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index dedfdc65e..023545230 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -76,4 +77,12 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") UnsignedInteger offerSequence(); + @Value.Check + default EscrowCancel normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ESCROW_CANCEL); + return this; + } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java index 7d2001b8a..af801611f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java @@ -132,4 +132,12 @@ default void check() { ); } } + + @Value.Check + default EscrowCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ESCROW_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index 5e02d0a0a..cc1fbaae9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -358,4 +358,11 @@ default EscrowFinish normalizeFulfillment() { } } + @Value.Check + default EscrowFinish normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ESCROW_FINISH); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index c0176c5a9..9610bccfe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -117,7 +117,7 @@ default void brokerFeeNotPresentInDirectModeAndAtleastOneOfferPresent() { "Please specify one offer for direct mode and both offers for brokered mode."); if ((buyOffer().isPresent() || sellOffer().isPresent()) && - !(buyOffer().isPresent() && sellOffer().isPresent())) { + !(buyOffer().isPresent() && sellOffer().isPresent())) { Preconditions.checkState(!brokerFee().isPresent(), "No BrokerFee needed in direct mode."); } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java index 4761de95f..fa5d0bad5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -95,4 +96,12 @@ static ImmutableNfTokenBurn.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @Value.Check + default NfTokenBurn normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.NFTOKEN_BURN); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java index 6c559df54..836bffa9a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java @@ -90,4 +90,12 @@ default void nonEmptyTokenOffers() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @Value.Check + default NfTokenCancelOffer normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.NFTOKEN_CANCEL_OFFER); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index fc4989319..3b017c851 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.NfTokenCreateOfferFlags; @@ -129,4 +130,12 @@ static ImmutableNfTokenCreateOffer.Builder builder() { default NfTokenCreateOfferFlags flags() { return NfTokenCreateOfferFlags.empty(); } + + @Value.Check + default NfTokenCreateOffer normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.NFTOKEN_CREATE_OFFER); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java index 446cbaae2..c6ce205a1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.NfTokenMintFlags; @@ -106,4 +107,12 @@ static ImmutableNfTokenMint.Builder builder() { default NfTokenMintFlags flags() { return NfTokenMintFlags.empty(); } + + @Value.Check + default NfTokenMint normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.NFTOKEN_MINT); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index 45f2e0823..405cf9ad9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; @@ -72,4 +73,11 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") Optional offerSequence(); + @Value.Check + default OfferCancel normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.OFFER_CANCEL); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index c7ef5b191..70d554fcc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; @@ -94,5 +95,11 @@ default OfferCreateFlags flags() { @JsonProperty("Expiration") Optional expiration(); - + @Value.Check + default OfferCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.OFFER_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java index b8e81ea7c..704f4ff61 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; @@ -50,4 +51,11 @@ default TransactionFlags flags() { @JsonProperty("OracleDocumentID") OracleDocumentId oracleDocumentId(); + @Value.Check + default OracleDelete normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ORACLE_DELETE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java index 7116087e8..b3d32a89e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; @@ -97,4 +98,12 @@ default TransactionFlags flags() { */ @JsonProperty("PriceDataSeries") List priceDataSeries(); + + @Value.Check + default OracleSet normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.ORACLE_SET); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 8e6b554ae..0d043a412 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.PaymentFlags; @@ -133,4 +134,11 @@ default PaymentFlags flags() { @JsonProperty("DeliverMin") Optional deliverMin(); + @Value.Check + default Payment normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.PAYMENT); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index 944a2fefd..b881c34bc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.PaymentChannelClaimFlags; @@ -130,4 +131,11 @@ default PaymentChannelClaimFlags flags() { @JsonProperty("PublicKey") Optional publicKey(); + @Value.Check + default PaymentChannelClaim normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.PAYMENT_CHANNEL_CLAIM); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index 2e0397b8c..41d90baea 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value; @@ -118,4 +119,11 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + @Value.Check + default PaymentChannelCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.PAYMENT_CHANNEL_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java index a27ad9737..701d704e4 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedLong; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -93,4 +94,12 @@ default TransactionFlags flags() { */ @JsonProperty("Expiration") Optional expiration(); + + @Value.Check + default PaymentChannelFund normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.PAYMENT_CHANNEL_FUND); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index 8b7ee2412..7115d4e64 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; @@ -152,4 +153,12 @@ default UnsignedInteger reserveIncrement() { */ @JsonProperty("LedgerSequence") Optional ledgerSequence(); + + @Value.Check + default SetFee normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.SET_FEE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index 6f245654f..1a0db6533 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -73,4 +74,12 @@ default TransactionFlags flags() { @JsonProperty("RegularKey") Optional

      regularKey(); + @Value.Check + default SetRegularKey normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.SET_REGULAR_KEY); + return this; + } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 9128e2f7f..9ef0fb50a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -83,4 +84,12 @@ default TransactionFlags flags() { @JsonProperty("SignerEntries") List signerEntries(); + @Value.Check + default SignerListSet normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.SIGNER_LIST_SET); + return this; + } + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java index a05d081a5..33070b4e0 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -69,4 +70,12 @@ static ImmutableTicketCreate.Builder builder() { default TransactionFlags flags() { return TransactionFlags.EMPTY; } + + @Value.Check + default TicketCreate normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.TICKET_CREATE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java index b93e44985..b8fd678ae 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Transaction.java @@ -109,17 +109,8 @@ public interface Transaction { * * @return A {@link TransactionType}. */ - // TODO FIX DOCS - // NOTE: This method is marked `@Derived`, which means the Immutable JSON serializer/deserializer won't include - // this property. However, by marking the `access` as `WRITE_ONLY`, we ensure that this property is always - // serialized - // from Java into JSON, but never deserialized from JSON into Java. This has two effects: (1) The - // `TransactionType` - // is never entered into the `unknownFields` Map, and (2) The Java default method implementation always ensures - // that - // the actual Java `TransactionType` is always populated properly, via the lookup in `typeMap`. @JsonProperty("TransactionType") - @Value.Default // Must be `Default` not `Derived`, else this field will be serialized into `unknownFields`. + @Value.Default // must be Default rather than Derived, otherwise Jackson treats "TransactionType" as an unknownField default TransactionType transactionType() { return typeMap.get(this.getClass()); } @@ -131,6 +122,7 @@ default TransactionType transactionType() { *

      This field is auto-fillable * * @return An {@link XrpCurrencyAmount} representing the transaction cost. + * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @JsonProperty("Fee") @@ -143,6 +135,7 @@ default TransactionType transactionType() { *

      This field is auto-fillable * * @return An {@link UnsignedInteger} representing the sequence of the transaction. + * * @see "https://xrpl.org/transaction-common-fields.html#auto-fillable-fields" */ @Value.Default diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java index 98befdc2b..0beefb089 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TransactionType.java @@ -353,6 +353,7 @@ public enum TransactionType { * Gets an instance of {@link TransactionType} for the given string value. * * @param value The {@link String} value corresponding to a {@link TransactionType}. + * * @return The {@link TransactionType} with the corresponding value. */ public static TransactionType forValue(String value) { diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index aa85c0c44..701b333a6 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.flags.TrustSetFlags; @@ -86,4 +87,11 @@ default TrustSetFlags flags() { @JsonProperty("QualityOut") Optional qualityOut(); + @Value.Check + default TrustSet normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.TRUST_SET); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index 462ffe815..c0d9b0543 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,13 +23,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInteger; import org.immutables.value.Value; import org.xrpl.xrpl4j.model.client.common.LedgerIndex; -import java.util.HashMap; -import java.util.Map; - /** * A {@link UnlModify} pseudo-transaction marks a change to the Negative UNL, indicating that a trusted validator has * gone offline or come back online. @@ -95,30 +93,11 @@ default Address account() { @JsonProperty("UNLModifyValidator") String unlModifyValidator(); - // TODO: Check the transactionType and WARN if this is incorrect (but allow it). - // TODO: Add the above check to all transactions. - // TODO: Add unit tests to verify the transaction for all txs (basically, expect a warning?) - @Value.Check default UnlModify normalize() { - if (unknownFields().containsKey("Account")) { - Map newUnknownFields = new HashMap<>(unknownFields()); // Copy the original - - // newUnknownFields.remove("Account"); - // newUnknownFields.remove("TransactionType"); - - // return ImmutableUnlModify.builder().from(this) - // .unknownFields(Collections.unmodifiableMap(newUnknownFields)) - // .build(); - - } else { - - // if (value() == Integer.MIN_VALUE) { - // return ImmutableNormalized.builder() - // .value(0) - // .build(); - // } - } + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.UNL_MODIFY); return this; } } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java index ad6731216..b1707896c 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java @@ -36,9 +36,10 @@ void testJson() throws JSONException, JsonProcessingException { .sequence(UnsignedInteger.valueOf(5)) .flags(flags) .signingPublicKey( - PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") + PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")) + .unknownFields( + unknownFields ) - .unknownFields(unknownFields) .networkId(NetworkId.of(UnsignedInteger.valueOf(1024))) .build(); @@ -67,4 +68,4 @@ void testJson() throws JSONException, JsonProcessingException { assertCanSerializeAndDeserialize(transaction, json); } -} +} \ No newline at end of file From 5293d98bf7d0068b992da2aeedf45dbbbe3318a2 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 13:07:29 -0500 Subject: [PATCH 11/13] Fix Checkstyle --- .../model/transactions/AccountDelete.java | 3 +++ .../xrpl4j/model/transactions/AccountSet.java | 3 +++ .../xrpl/xrpl4j/model/transactions/AmmBid.java | 3 +++ .../xrpl4j/model/transactions/AmmCreate.java | 3 +++ .../xrpl4j/model/transactions/AmmDelete.java | 3 +++ .../xrpl4j/model/transactions/AmmDeposit.java | 3 +++ .../xrpl4j/model/transactions/AmmVote.java | 3 +++ .../xrpl4j/model/transactions/AmmWithdraw.java | 3 +++ .../xrpl4j/model/transactions/CheckCancel.java | 3 +++ .../xrpl4j/model/transactions/CheckCash.java | 3 +++ .../xrpl4j/model/transactions/CheckCreate.java | 3 +++ .../xrpl4j/model/transactions/Clawback.java | 3 +++ .../model/transactions/DepositPreAuth.java | 3 +++ .../xrpl4j/model/transactions/DidDelete.java | 3 +++ .../xrpl/xrpl4j/model/transactions/DidSet.java | 3 +++ .../model/transactions/EnableAmendment.java | 3 +++ .../model/transactions/EscrowCancel.java | 3 +++ .../model/transactions/EscrowCreate.java | 3 +++ .../model/transactions/EscrowFinish.java | 3 +++ .../model/transactions/NfTokenAcceptOffer.java | 18 ++++++++++++++---- .../xrpl4j/model/transactions/NfTokenBurn.java | 3 +++ .../model/transactions/NfTokenCancelOffer.java | 3 +++ .../model/transactions/NfTokenCreateOffer.java | 3 +++ .../xrpl4j/model/transactions/NfTokenMint.java | 3 +++ .../xrpl4j/model/transactions/OfferCancel.java | 3 +++ .../xrpl4j/model/transactions/OfferCreate.java | 3 +++ .../model/transactions/OracleDelete.java | 3 +++ .../xrpl4j/model/transactions/OracleSet.java | 3 +++ .../xrpl4j/model/transactions/Payment.java | 3 +++ .../transactions/PaymentChannelClaim.java | 3 +++ .../transactions/PaymentChannelCreate.java | 3 +++ .../model/transactions/PaymentChannelFund.java | 3 +++ .../xrpl/xrpl4j/model/transactions/SetFee.java | 3 +++ .../model/transactions/SetRegularKey.java | 3 +++ .../model/transactions/SignerListSet.java | 3 +++ .../model/transactions/TicketCreate.java | 3 +++ .../xrpl4j/model/transactions/TrustSet.java | 3 +++ .../model/transactions/UnknownTransaction.java | 11 +++++++++++ .../xrpl4j/model/transactions/UnlModify.java | 3 +++ .../XChainAccountCreateCommit.java | 11 +++++++++++ .../XChainAddAccountCreateAttestation.java | 11 +++++++++++ .../XChainAddClaimAttestation.java | 11 +++++++++++ .../model/transactions/XChainBridge.java | 4 +++- .../model/transactions/XChainCreateBridge.java | 11 +++++++++++ .../model/transactions/XChainModifyBridge.java | 12 ++++++++++++ 45 files changed, 195 insertions(+), 5 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java index 27f4e682b..37adadbbe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountDelete.java @@ -81,6 +81,9 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AccountDelete normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java index 29d9bb513..457c199ea 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AccountSet.java @@ -518,6 +518,9 @@ public int getValue() { } } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AccountSet normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java index bab3f6151..ebd4cf3eb 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmBid.java @@ -108,6 +108,9 @@ default TransactionFlags flags() { @JsonProperty("AuthAccounts") List authAccounts(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmBid normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java index d9800d5fd..dbf4b7648 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmCreate.java @@ -68,6 +68,9 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java index a0508cba9..a03e3a212 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDelete.java @@ -59,6 +59,9 @@ default TransactionFlags flags() { @JsonProperty("Asset2") Issue asset2(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmDelete normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java index c141c7d08..cd69600fd 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmDeposit.java @@ -107,6 +107,9 @@ static ImmutableAmmDeposit.Builder builder() { @JsonProperty("TradingFee") Optional tradingFee(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmDeposit normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java index e91e95e4a..e4f3b8295 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmVote.java @@ -69,6 +69,9 @@ default TransactionFlags flags() { @JsonProperty("TradingFee") TradingFee tradingFee(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmVote normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java index 0f0f2201b..7d989887f 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/AmmWithdraw.java @@ -99,6 +99,9 @@ static ImmutableAmmWithdraw.Builder builder() { @JsonProperty("LPTokenIn") Optional lpTokensIn(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default AmmWithdraw normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java index a251c8f54..548c2da72 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCancel.java @@ -69,6 +69,9 @@ default TransactionFlags flags() { @JsonProperty("CheckID") Hash256 checkId(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default CheckCancel normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java index bed034c62..1c3f20dcc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCash.java @@ -106,6 +106,9 @@ default void validateOnlyOneAmountSet() { "The CheckCash transaction must include either amount or deliverMin, but not both."); } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default CheckCash normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java index a0c716ca0..2b44fa712 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/CheckCreate.java @@ -106,6 +106,9 @@ default TransactionFlags flags() { @JsonProperty("InvoiceID") Optional invoiceId(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default CheckCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java index c4ea4de16..89613512c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Clawback.java @@ -52,6 +52,9 @@ default TransactionFlags flags() { @JsonProperty("Amount") IssuedCurrencyAmount amount(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default Clawback normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java index 74ab22fea..20e7f8b87 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DepositPreAuth.java @@ -93,6 +93,9 @@ default void validateFieldPresence() { "The DepositPreAuth transaction must include either Authorize or Unauthorize, but not both."); } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default DepositPreAuth normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java index 51249fc6c..3f449cb7c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidDelete.java @@ -45,6 +45,9 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default DidDelete normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java index dfd6a2106..c5000796e 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/DidSet.java @@ -72,6 +72,9 @@ default TransactionFlags flags() { @JsonProperty("Data") Optional data(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default DidSet normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java index bb4147ba9..c1ec721fe 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EnableAmendment.java @@ -66,6 +66,9 @@ static ImmutableEnableAmendment.Builder builder() { @JsonProperty("LedgerSequence") Optional ledgerSequence(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default EnableAmendment normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java index 023545230..e1c4cb06d 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCancel.java @@ -77,6 +77,9 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") UnsignedInteger offerSequence(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default EscrowCancel normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java index af801611f..26d0311df 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowCreate.java @@ -133,6 +133,9 @@ default void check() { } } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default EscrowCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java index cc1fbaae9..14065ca5b 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/EscrowFinish.java @@ -358,6 +358,9 @@ default EscrowFinish normalizeFulfillment() { } } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default EscrowFinish normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index 9610bccfe..e17ff6fbf 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -63,8 +63,8 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { /** * Identifies the NfTOffer that offers to buy the NfT. - * - *

      In direct mode this field is optional, but either SellOffer or + *

      + * In direct mode this field is optional, but either SellOffer or * BuyOffer must be specified. In brokered mode, both SellOffer * and BuyOffer MUST be specified. * @@ -74,7 +74,7 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { Optional buyOffer(); /** - *

      This field is only valid in brokered mode and specifies the + * This field is only valid in brokered mode and specifies the * amount that the broker will keep as part of their fee for * bringing the two offers together; the remaining amount will * be sent to the seller of the NfT being bought. If @@ -93,7 +93,7 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { * the order in which funds are transferred might cause a * transaction that would succeed to fail due to an apparent * lack of funds. To ensure deterministic transaction execution - * and maximimize the chances of successful execution, this + * and maximize the chances of successful execution, this * proposal requires that the account attempting to buy the * NfT is debited first and that funds due to the broker * are credited before crediting the seller. @@ -137,4 +137,14 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default NfTokenAcceptOffer normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.NFTOKEN_ACCEPT_OFFER); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java index fa5d0bad5..56ed474f8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenBurn.java @@ -97,6 +97,9 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default NfTokenBurn normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java index 836bffa9a..9c21f0149 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCancelOffer.java @@ -91,6 +91,9 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default NfTokenCancelOffer normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java index 3b017c851..8b5fc94ea 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenCreateOffer.java @@ -131,6 +131,9 @@ default NfTokenCreateOfferFlags flags() { return NfTokenCreateOfferFlags.empty(); } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default NfTokenCreateOffer normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java index c6ce205a1..a0e7c67d5 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenMint.java @@ -108,6 +108,9 @@ default NfTokenMintFlags flags() { return NfTokenMintFlags.empty(); } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default NfTokenMint normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java index 405cf9ad9..5af90a123 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCancel.java @@ -73,6 +73,9 @@ default TransactionFlags flags() { @JsonProperty("OfferSequence") Optional offerSequence(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default OfferCancel normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java index 70d554fcc..2930446d9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OfferCreate.java @@ -95,6 +95,9 @@ default OfferCreateFlags flags() { @JsonProperty("Expiration") Optional expiration(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default OfferCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java index 704f4ff61..c00d3e583 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleDelete.java @@ -51,6 +51,9 @@ default TransactionFlags flags() { @JsonProperty("OracleDocumentID") OracleDocumentId oracleDocumentId(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default OracleDelete normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java index b3d32a89e..fb688c6b2 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/OracleSet.java @@ -99,6 +99,9 @@ default TransactionFlags flags() { @JsonProperty("PriceDataSeries") List priceDataSeries(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default OracleSet normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java index 0d043a412..c5c4bab52 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/Payment.java @@ -134,6 +134,9 @@ default PaymentFlags flags() { @JsonProperty("DeliverMin") Optional deliverMin(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default Payment normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java index b881c34bc..a0f5905aa 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelClaim.java @@ -131,6 +131,9 @@ default PaymentChannelClaimFlags flags() { @JsonProperty("PublicKey") Optional publicKey(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default PaymentChannelClaim normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java index 41d90baea..aba0bff41 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelCreate.java @@ -119,6 +119,9 @@ default TransactionFlags flags() { @JsonProperty("DestinationTag") Optional destinationTag(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default PaymentChannelCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java index 701d704e4..f96a3dfa1 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/PaymentChannelFund.java @@ -95,6 +95,9 @@ default TransactionFlags flags() { @JsonProperty("Expiration") Optional expiration(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default PaymentChannelFund normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java index 7115d4e64..c1ce5de27 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetFee.java @@ -154,6 +154,9 @@ default UnsignedInteger reserveIncrement() { @JsonProperty("LedgerSequence") Optional ledgerSequence(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default SetFee normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java index 1a0db6533..51e6c0e8a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SetRegularKey.java @@ -74,6 +74,9 @@ default TransactionFlags flags() { @JsonProperty("RegularKey") Optional

      regularKey(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default SetRegularKey normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java index 9ef0fb50a..a33d77591 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/SignerListSet.java @@ -84,6 +84,9 @@ default TransactionFlags flags() { @JsonProperty("SignerEntries") List signerEntries(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default SignerListSet normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java index 33070b4e0..6ecd6227a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TicketCreate.java @@ -71,6 +71,9 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default TicketCreate normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java index 701b333a6..d20eaf9be 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/TrustSet.java @@ -87,6 +87,9 @@ default TrustSetFlags flags() { @JsonProperty("QualityOut") Optional qualityOut(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default TrustSet normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java index 7a54f0122..f01b95c50 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -62,4 +63,14 @@ default TransactionFlags flags() { return TransactionFlags.EMPTY; } + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default UnknownTransaction normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.UNKNOWN); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index c0d9b0543..2b60a2cd3 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -93,6 +93,9 @@ default Address account() { @JsonProperty("UNLModifyValidator") String unlModifyValidator(); + /** + * Immutables Check to ensure property state after construction. + */ @Value.Check default UnlModify normalize() { Preconditions.checkState(!unknownFields().containsKey("TransactionType")); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java index 9272ea579..1ecf69a3c 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommit.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -78,4 +79,14 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default XChainAccountCreateCommit normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.XCHAIN_ACCOUNT_CREATE_COMMIT); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java index cf7be3c94..49c294a23 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestation.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.crypto.keys.PublicKey; @@ -142,4 +143,14 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default XChainAddAccountCreateAttestation normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.XCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java index 68c46c7b4..c29cdc3dc 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestation.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.crypto.keys.PublicKey; @@ -135,4 +136,14 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainClaimId xChainClaimId(); + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default XChainAddClaimAttestation normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.XCHAIN_ADD_CLAIM_ATTESTATION); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java index 614af52f8..b82ab30b2 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; +import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -61,5 +63,5 @@ static ImmutableXChainBridge.Builder builder() { */ @JsonProperty("LockingChainIssue") Issue lockingChainIssue(); - + } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java index 744331b14..2022e5cb9 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridge.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.TransactionFlags; @@ -69,4 +70,14 @@ default TransactionFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default XChainCreateBridge normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.XCHAIN_CREATE_BRIDGE); + return this; + } } diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java index b51324115..1143d1205 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridge.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; +import com.google.common.base.Preconditions; import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.flags.XChainModifyBridgeFlags; @@ -71,4 +72,15 @@ default XChainModifyBridgeFlags flags() { @SuppressWarnings("MethodName") XChainBridge xChainBridge(); + /** + * Immutables Check to ensure property state after construction. + */ + @Value.Check + default XChainModifyBridge normalize() { + Preconditions.checkState(!unknownFields().containsKey("TransactionType")); + Preconditions.checkState(!unknownFields().containsKey("Account")); + Preconditions.checkState(transactionType() == TransactionType.XCHAIN_MODIFY_BRIDGE); + return this; + } + } From 05f1a2f1debf80fde9ed67905adb6246c8c37046 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 13:18:10 -0500 Subject: [PATCH 12/13] Checkstyle fixes --- .../modules/TransactionDeserializer.java | 6 +- .../transactions/NfTokenAcceptOffer.java | 18 +- .../json/AbstractTransactionJsonTest.java | 54 +++--- .../json/AccountDeleteJsonTests.java | 124 ++++++------ .../json/AccountSetJsonTests.java | 2 +- .../json/CheckCancelJsonTests.java | 2 +- .../transactions/json/CheckCashJsonTests.java | 2 +- .../json/CheckCreateJsonTests.java | 2 +- .../json/EnableAmendmentJsonTests.java | 2 +- .../json/EscrowCancelJsonTests.java | 2 +- .../json/EscrowCreateJsonTests.java | 121 ++++++------ .../json/EscrowFinishJsonTests.java | 2 +- .../json/NfTokenAcceptOfferJsonTests.java | 107 +++++----- .../json/NfTokenBurnJsonTests.java | 2 +- .../json/NfTokenCancelOfferJsonTests.java | 91 ++++----- .../json/NfTokenCreateOfferJsonTests.java | 62 +++--- .../json/NfTokenMintJsonTests.java | 86 ++++---- .../json/OfferCancelJsonTests.java | 2 +- .../json/OfferCreateJsonTests.java | 2 +- .../json/PaymentChannelClaimJsonTests.java | 93 ++++----- .../json/PaymentChannelCreateJsonTests.java | 2 +- .../json/PaymentChannelFundJsonTests.java | 93 ++++----- .../transactions/json/PaymentJsonTests.java | 2 +- .../json/SetRegularKeyJsonTest.java | 2 +- .../json/SignerListSetJsonTests.java | 2 +- .../json/TicketCreateJsonTest.java | 2 +- .../transactions/json/TrustSetJsonTests.java | 2 +- .../transactions/json/UnlModifyJsonTests.java | 183 +++++++++--------- 28 files changed, 538 insertions(+), 532 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java index 24c9d796e..08fcad57a 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionDeserializer.java @@ -34,7 +34,7 @@ /** * Custom deserializer for instances of {@link Transaction} that deserialize to a specific {@link Transaction} type - * based on the`TransactionType` JSON field + * based on the`TransactionType` JSON field. */ public class TransactionDeserializer extends StdDeserializer { @@ -57,8 +57,8 @@ public Transaction deserialize(JsonParser jsonParser, DeserializationContext ctx // Remove the `Account` property from any incoming `UnlModify` JSON about to be deserialized. This is because the // JSON returned by the rippled/clio API v1 has a bug where the account value in `UnlModify` transactions is an // empty string. In this case, the Java value for the `Account` property is always set to ACCOUNT_ZERO via a default - // method, so this property is removed from incoming JSON before deserialization because it's not needed (the default - // method handles population in Java) and if not removed, this field will end up in the `unknownFields` + // method, so this property is removed from incoming JSON before deserialization because it's not needed (the + // default method handles population in Java) and if not removed, this field will end up in the `unknownFields` // map of the ultimate Java object, which is incorrect. if (UnlModify.class.isAssignableFrom(transactionTypeClass)) { objectNode.remove("Account"); diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java index e17ff6fbf..775928eca 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/NfTokenAcceptOffer.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -63,8 +63,8 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { /** * Identifies the NfTOffer that offers to buy the NfT. - *

      - * In direct mode this field is optional, but either SellOffer or + * + *

      In direct mode this field is optional, but either SellOffer or * BuyOffer must be specified. In brokered mode, both SellOffer * and BuyOffer MUST be specified. * @@ -74,7 +74,7 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { Optional buyOffer(); /** - * This field is only valid in brokered mode and specifies the + *

      This field is only valid in brokered mode and specifies the * amount that the broker will keep as part of their fee for * bringing the two offers together; the remaining amount will * be sent to the seller of the NfT being bought. If @@ -82,22 +82,22 @@ static ImmutableNfTokenAcceptOffer.Builder builder() { * for the transfer fee charged by the issuer, the amount that * the seller would receive is at least as much as the amount * indicated in the sell offer. - *

      + * * This functionality is intended to allow the owner of an * NfT to offer their token for sale to a third party * broker, who may then attempt to sell the NfT on for a * larger amount, without the broker having to own the NfT * or custody funds. - *

      + * * If both offers are for the same asset, it is possible that * the order in which funds are transferred might cause a * transaction that would succeed to fail due to an apparent * lack of funds. To ensure deterministic transaction execution - * and maximize the chances of successful execution, this + * and maximimize the chances of successful execution, this * proposal requires that the account attempting to buy the * NfT is debited first and that funds due to the broker * are credited before crediting the seller. - *

      + * * Note: in brokered mode, The offers referenced by BuyOffer * and SellOffer must both specify the same TokenID; that is, * both must be for the same NfT.

      diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java index 98b60e7c0..7ef6d095b 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AbstractTransactionJsonTest.java @@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; import org.xrpl.xrpl4j.model.AbstractJsonTest; import org.xrpl.xrpl4j.model.transactions.Transaction; @@ -31,28 +32,29 @@ import java.util.Objects; /** - * An abstract class that helps test various flavors of serialization and deserialization for implementations of {@link Transaction}. + * An abstract class that helps test various flavors of serialization and deserialization for implementations of + * {@link Transaction}. * - * @param The type of Immutable this class will test. - * @param The type of Immutable Builder this class will test. - * @param The type of {@link Transaction} this class will test. + * @param The type of Immutable this class will test. + * @param The type of Immutable Builder this class will test. + * @param The type of {@link Transaction} this class will test. */ -public abstract class AbstractTransactionJsonTest extends AbstractJsonTest { +public abstract class AbstractTransactionJsonTest extends AbstractJsonTest { private final Class interfaceClass; - private final Class immutableClass; + private final Class immutableClass; private final TransactionType expectedTransactionType; /** * Required-args Constructor. * * @param interfaceClass A class of type {@link T} that for the Immutables intefarce. - * @param immutableClass A class of type {@link IM} that for the Immutables implementation. + * @param immutableClass A class of type {@link I} that for the Immutables implementation. * @param expectedTransactionType A {@link TransactionType} representing the expected transaction type. */ protected AbstractTransactionJsonTest( final Class interfaceClass, - final Class immutableClass, + final Class immutableClass, final TransactionType expectedTransactionType ) { this.interfaceClass = Objects.requireNonNull(interfaceClass); @@ -81,24 +83,6 @@ protected AbstractTransactionJsonTest( */ protected abstract T fullyPopulatedTransactionWithUnknownFields(); - /** - * Helper for populating unknown fields into a Transaction. - * - * @param - */ - interface UnknownFieldPutter { - B putUnknownFields(String key, Object value); - } - - /** - * Helper for building from an unknown builder. - * - * @param - */ - interface Builder { - T build(); - } - /** * Construct and return a minimally-populated transaction of type {@link T}. * @@ -113,6 +97,10 @@ void testTransactionType() { assertThat(minimallyPopulatedTransaction().transactionType()).isEqualTo(expectedTransactionType); } + /** + * This test asserts that deserialization works the same regardless of whether a Java interface, immutable, or + * instance of the {@link Transaction} parent class are supplied to the {@link ObjectMapper}. + */ @Test public void assertCanDeserializeAllTypesFullyPopulated() throws JsonProcessingException { T expectedObject = fullyPopulatedTransaction(); @@ -122,10 +110,14 @@ public void assertCanDeserializeAllTypesFullyPopulated() throws JsonProcessingEx assertThat(deserializedTransaction).isEqualTo(expectedObject); T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); assertThat(deserializedInterface).isEqualTo(expectedObject); - IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + I deserializedImmutable = objectMapper.readValue(serialized, immutableClass); assertThat(deserializedImmutable).isEqualTo(expectedObject); } + /** + * This test asserts that deserialization works the same regardless of whether a Java interface, immutable, or + * instance of the {@link Transaction} parent class are supplied to the {@link ObjectMapper}. + */ @Test public void assertCanDeserializeAllTypesFullyPopulatedWithUnknownFields() throws JsonProcessingException { T expectedObject = fullyPopulatedTransactionWithUnknownFields(); @@ -135,10 +127,14 @@ public void assertCanDeserializeAllTypesFullyPopulatedWithUnknownFields() throws assertThat(deserializedTransaction).isEqualTo(expectedObject); T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); assertThat(deserializedInterface).isEqualTo(expectedObject); - IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + I deserializedImmutable = objectMapper.readValue(serialized, immutableClass); assertThat(deserializedImmutable).isEqualTo(expectedObject); } + /** + * This test asserts that deserialization works the same regardless of whether a Java interface, immutable, or + * instance of the {@link Transaction} parent class are supplied to the {@link ObjectMapper}. + */ @Test public void assertCanDeserializeAllTypesWithMinimallyPopulated() throws JsonProcessingException { T expectedObject = minimallyPopulatedTransaction(); @@ -148,7 +144,7 @@ public void assertCanDeserializeAllTypesWithMinimallyPopulated() throws JsonProc assertThat(deserializedTransaction).isEqualTo(expectedObject); T deserializedInterface = objectMapper.readValue(serialized, interfaceClass); assertThat(deserializedInterface).isEqualTo(expectedObject); - IM deserializedImmutable = objectMapper.readValue(serialized, immutableClass); + I deserializedImmutable = objectMapper.readValue(serialized, immutableClass); assertThat(deserializedImmutable).isEqualTo(expectedObject); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java index 3425963d2..cc17a7455 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountDeleteJsonTests.java @@ -37,7 +37,7 @@ public class AccountDeleteJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected AccountDeleteJsonTests() { super(AccountDelete.class, ImmutableAccountDelete.class, TransactionType.ACCOUNT_DELETE); @@ -87,17 +87,17 @@ protected AccountDelete minimallyPopulatedTransaction() { public void testFullyPopulatedJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": 0,\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; this.assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } @@ -106,17 +106,17 @@ public void testFullyPopulatedJson() throws JsonProcessingException, JSONExcepti public void testFullyPopulatedWithUnknownFieldsJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": 0,\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; this.assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } @@ -125,13 +125,13 @@ public void testFullyPopulatedWithUnknownFieldsJson() throws JsonProcessingExcep public void testMinimallyPopulatedJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"Fee\": \"5000000\",\n" + - " \"Sequence\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"Fee\": \"5000000\",\n" + + " \"Sequence\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; this.assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); } @@ -145,17 +145,17 @@ public void testJsonWithUnsetFlags() throws JsonProcessingException, JSONExcepti String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": 0,\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": 0,\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedAccountDelete, json); } @@ -170,17 +170,17 @@ public void testJsonWithNonZeroFlags() throws JsonProcessingException, JSONExcep String json = String.format( "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Flags\": %s,\n" + - " \"NetworkID\": 1024,\n" + - " \"Sequence\": 2470665,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Flags\": %s,\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 2470665,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); assertCanSerializeAndDeserialize(fullyPopulatedTransaction, json); } @@ -189,16 +189,16 @@ public void testJsonWithNonZeroFlags() throws JsonProcessingException, JSONExcep public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"AccountDelete\",\n" + - " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + - " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + - " \"DestinationTag\": 13,\n" + - " \"Flags\": 0,\n" + - " \"Fee\": \"5000000\",\n" + - " \"Sequence\": 2470665,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"AccountDelete\",\n" + + " \"Account\": \"rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm\",\n" + + " \"Destination\": \"rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\",\n" + + " \"DestinationTag\": 13,\n" + + " \"Flags\": 0,\n" + + " \"Fee\": \"5000000\",\n" + + " \"Sequence\": 2470665,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java index c98e6b158..f9abd0261 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/AccountSetJsonTests.java @@ -42,7 +42,7 @@ public class AccountSetJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected AccountSetJsonTests() { super(AccountSet.class, ImmutableAccountSet.class, TransactionType.ACCOUNT_SET); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java index c64f89890..07e39e7da 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCancelJsonTests.java @@ -38,7 +38,7 @@ public class CheckCancelJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected CheckCancelJsonTests() { super(CheckCancel.class, ImmutableCheckCancel.class, TransactionType.CHECK_CANCEL); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java index 01e665d5c..1d6f85390 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCashJsonTests.java @@ -39,7 +39,7 @@ public class CheckCashJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected CheckCashJsonTests() { super(CheckCash.class, ImmutableCheckCash.class, TransactionType.CHECK_CASH); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java index 5333379c9..668bf69fb 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/CheckCreateJsonTests.java @@ -38,7 +38,7 @@ public class CheckCreateJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected CheckCreateJsonTests() { super(CheckCreate.class, ImmutableCheckCreate.class, TransactionType.CHECK_CREATE); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java index 7434d2cfa..fea1c16fc 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EnableAmendmentJsonTests.java @@ -38,7 +38,7 @@ public class EnableAmendmentJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected EnableAmendmentJsonTests() { super(EnableAmendment.class, ImmutableEnableAmendment.class, TransactionType.ENABLE_AMENDMENT); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java index 1a6d40d0c..a23a79522 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCancelJsonTests.java @@ -17,7 +17,7 @@ public class EscrowCancelJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected EscrowCancelJsonTests() { super(EscrowCancel.class, ImmutableEscrowCancel.class, TransactionType.ESCROW_CANCEL); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java index c5ece7cdd..fbcedf579 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowCreateJsonTests.java @@ -37,11 +37,12 @@ import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class EscrowCreateJsonTests - extends AbstractTransactionJsonTest { +public class EscrowCreateJsonTests extends AbstractTransactionJsonTest< + ImmutableEscrowCreate, ImmutableEscrowCreate.Builder, EscrowCreate + > { /** - * No-args Constructor + * No-args Constructor. */ protected EscrowCreateJsonTests() { super(EscrowCreate.class, ImmutableEscrowCreate.class, TransactionType.ESCROW_CREATE); @@ -123,20 +124,20 @@ public void testEscrowCreateJson() throws JsonProcessingException, JSONException .build(); String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; assertCanSerializeAndDeserialize(escrowCreate, json); } @@ -164,20 +165,20 @@ public void testEscrowCreateJsonWithUnsetFlags() throws JsonProcessingException, .build(); String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}"; + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}"; assertCanSerializeAndDeserialize(escrowCreate, json); } @@ -206,20 +207,20 @@ public void testEscrowCreateJsonWithNonZeroFlags() .build(); String json = String.format("{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"Flags\": %s,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Fee\": \"12\"\n" + - "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"Flags\": %s,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Fee\": \"12\"\n" + + "}", TransactionFlags.FULLY_CANONICAL_SIG.getValue()); assertCanSerializeAndDeserialize(escrowCreate, json); } @@ -249,21 +250,21 @@ public void testEscrowCreateJsonWithUnknownFields() .build(); String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"TransactionType\": \"EscrowCreate\",\n" + - " \"Amount\": \"10000\",\n" + - " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"CancelAfter\": 533257958,\n" + - " \"FinishAfter\": 533171558,\n" + - " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + - " \"DestinationTag\": 23480,\n" + - " \"SourceTag\": 11747,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Fee\": \"12\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"TransactionType\": \"EscrowCreate\",\n" + + " \"Amount\": \"10000\",\n" + + " \"Destination\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"CancelAfter\": 533257958,\n" + + " \"FinishAfter\": 533171558,\n" + + " \"Condition\": \"A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100\",\n" + + " \"DestinationTag\": 23480,\n" + + " \"SourceTag\": 11747,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Fee\": \"12\"\n" + + "}"; assertCanSerializeAndDeserialize(escrowCreate, json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java index 91bffe59a..ec49c001c 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/EscrowFinishJsonTests.java @@ -42,7 +42,7 @@ public class EscrowFinishJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected EscrowFinishJsonTests() { super(EscrowFinish.class, ImmutableEscrowFinish.class, TransactionType.ESCROW_FINISH); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java index 1259e2b22..80b9e2c0e 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenAcceptOfferJsonTests.java @@ -34,11 +34,12 @@ import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenAcceptOfferJsonTests - extends AbstractTransactionJsonTest { +public class NfTokenAcceptOfferJsonTests extends AbstractTransactionJsonTest< + ImmutableNfTokenAcceptOffer, ImmutableNfTokenAcceptOffer.Builder, NfTokenAcceptOffer + > { /** - * No-args Constructor + * No-args Constructor. */ protected NfTokenAcceptOfferJsonTests() { super(NfTokenAcceptOffer.class, ImmutableNfTokenAcceptOffer.class, TransactionType.NFTOKEN_ACCEPT_OFFER); @@ -90,16 +91,16 @@ protected NfTokenAcceptOffer minimallyPopulatedTransaction() { public void testMinimalNfTokenAcceptOfferJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + - "}"; + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @@ -112,17 +113,17 @@ public void testNfTokenAcceptOfferJsonWithUnsetFlags() throws JsonProcessingExce String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 0,\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\",\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"Sequence\": 12,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\",\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"Sequence\": 12,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(transactionWithUnsetFlags, json); } @@ -135,17 +136,17 @@ public void testNfTokenAcceptOfferJsonWithNonZeroFlags() throws JsonProcessingEx String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + - "}"; + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + + "}"; assertCanSerializeAndDeserialize(transactionWithNonZeroFlags, json); } @@ -165,13 +166,13 @@ public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingExcept String json = "{\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json); } @@ -180,17 +181,17 @@ public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingExcept public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenBrokerFee\": \"10\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenAcceptOffer\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NFTokenBuyOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"NFTokenSellOffer\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenBrokerFee\": \"10\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java index 4b30cb7d6..64dba9d77 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenBurnJsonTests.java @@ -38,7 +38,7 @@ public class NfTokenBurnJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected NfTokenBurnJsonTests() { super(NfTokenBurn.class, ImmutableNfTokenBurn.class, TransactionType.NFTOKEN_BURN); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java index b538cfc56..de3c445a5 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCancelOfferJsonTests.java @@ -37,11 +37,12 @@ import java.util.ArrayList; import java.util.List; -public class NfTokenCancelOfferJsonTests - extends AbstractTransactionJsonTest { +public class NfTokenCancelOfferJsonTests extends AbstractTransactionJsonTest< + ImmutableNfTokenCancelOffer, ImmutableNfTokenCancelOffer.Builder, NfTokenCancelOffer + > { /** - * No-args Constructor + * No-args Constructor. */ protected NfTokenCancelOfferJsonTests() { super(NfTokenCancelOffer.class, ImmutableNfTokenCancelOffer.class, TransactionType.NFTOKEN_CANCEL_OFFER); @@ -95,15 +96,15 @@ protected NfTokenCancelOffer minimallyPopulatedTransaction() { public void testMinimalNfTokenCancelOfferJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 0,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); } @@ -116,17 +117,17 @@ public void testNfTokenCancelOfferJsonWithUnsetFlags() throws JsonProcessingExce String json = "{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": 0,\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(transaction, json); } @@ -139,17 +140,17 @@ public void testNfTokenCancelOfferJsonWithNonZeroFlags() throws JsonProcessingEx String json = "{\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(transaction, json); } @@ -158,17 +159,17 @@ public void testNfTokenCancelOfferJsonWithNonZeroFlags() throws JsonProcessingEx public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\": \"Bar\",\n" + - " \"TransactionType\": \"NFTokenCancelOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenOffers\": [" + - " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + - " ],\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"Foo\": \"Bar\",\n" + + " \"TransactionType\": \"NFTokenCancelOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenOffers\": [" + + " \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\"" + + " ],\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java index 54aa5da7e..c7cf13c83 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenCreateOfferJsonTests.java @@ -34,10 +34,12 @@ import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenCreateOfferJsonTests extends AbstractTransactionJsonTest { +public class NfTokenCreateOfferJsonTests extends AbstractTransactionJsonTest< + ImmutableNfTokenCreateOffer, ImmutableNfTokenCreateOffer.Builder, NfTokenCreateOffer + > { /** - * No-args Constructor + * No-args Constructor. */ protected NfTokenCreateOfferJsonTests() { super(NfTokenCreateOffer.class, ImmutableNfTokenCreateOffer.class, TransactionType.NFTOKEN_CREATE_OFFER); @@ -90,14 +92,14 @@ protected NfTokenCreateOffer minimallyPopulatedTransaction() { public void testMinimalNfTokenCreateOfferJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 0,\n" + - " \"Amount\": \"2000\",\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"Amount\": \"2000\",\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); } @@ -110,16 +112,16 @@ public void testJsonWithFlags() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Amount\": \"2000\",\n" + - " \"Flags\": " + NfTokenCreateOfferFlags.SELL_NFTOKEN + ",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Amount\": \"2000\",\n" + + " \"Flags\": " + NfTokenCreateOfferFlags.SELL_NFTOKEN + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(transaction, json); } @@ -142,16 +144,16 @@ public void testJsonWithUnknownFields() throws JsonProcessingException, JSONExce String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenCreateOffer\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 12,\n" + - " \"Amount\": \"2000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenCreateOffer\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 12,\n" + + " \"Amount\": \"2000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"NFTokenID\": \"000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" + + "}"; assertCanSerializeAndDeserialize(nfTokenCreateOffer, json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java index 46ce0a105..17072e613 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/NfTokenMintJsonTests.java @@ -36,10 +36,12 @@ import org.xrpl.xrpl4j.model.transactions.TransferFee; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class NfTokenMintJsonTests extends AbstractTransactionJsonTest { +public class NfTokenMintJsonTests extends AbstractTransactionJsonTest< + ImmutableNfTokenMint, ImmutableNfTokenMint.Builder, NfTokenMint + > { /** - * No-args Constructor + * No-args Constructor. */ protected NfTokenMintJsonTests() { super(NfTokenMint.class, ImmutableNfTokenMint.class, TransactionType.NFTOKEN_MINT); @@ -92,16 +94,16 @@ protected NfTokenMint minimallyPopulatedTransaction() { public void testMinimalNfTokenMintJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + - "}"; + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @@ -110,13 +112,13 @@ public void testMinimalNfTokenMintJson() throws JsonProcessingException, JSONExc public void testJsonWithoutFlags() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Sequence\": 0,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + - "}"; + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Sequence\": 0,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + + "}"; assertCanSerializeAndDeserialize(minimallyPopulatedTransaction(), json); } @@ -130,18 +132,18 @@ public void testMinimalNfTokenMintWithUriJson() throws JsonProcessingException, String json = "{\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"URI\": \"697066733A2F2F62616679626569676479727A74357366703775646D3768753736756837" + - "7932366E6634646675796C71616266336F636C67747179353566627A6469\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694,\n" + - " \"NetworkID\": 1024\n" + - "}"; + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"URI\": \"697066733A2F2F62616679626569676479727A74357366703775646D3768753736756837" + + "7932366E6634646675796C71616266336F636C67747179353566627A6469\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694,\n" + + " \"NetworkID\": 1024\n" + + "}"; assertCanSerializeAndDeserialize(transaction, json); } @@ -150,17 +152,17 @@ public void testMinimalNfTokenMintWithUriJson() throws JsonProcessingException, public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"TransactionType\": \"NFTokenMint\",\n" + - " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + - " \"Fee\": \"12\",\n" + - " \"Flags\": 2147483656,\n" + - " \"Sequence\": 12,\n" + - " \"TransferFee\": 1000,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"NFTokenTaxon\": 146999694\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"TransactionType\": \"NFTokenMint\",\n" + + " \"Account\": \"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59Ba\",\n" + + " \"Fee\": \"12\",\n" + + " \"Flags\": 2147483656,\n" + + " \"Sequence\": 12,\n" + + " \"TransferFee\": 1000,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"NFTokenTaxon\": 146999694\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java index 74226cfb8..5923d55d6 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCancelJsonTests.java @@ -37,7 +37,7 @@ public class OfferCancelJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected OfferCancelJsonTests() { super(OfferCancel.class, ImmutableOfferCancel.class, TransactionType.OFFER_CANCEL); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java index e4d545c6a..00061c2d8 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/OfferCreateJsonTests.java @@ -37,7 +37,7 @@ public class OfferCreateJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected OfferCreateJsonTests() { super(OfferCreate.class, ImmutableOfferCreate.class, TransactionType.OFFER_CREATE); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java index 0c8bdd1a9..a85163ebc 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelClaimJsonTests.java @@ -34,11 +34,12 @@ import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class PaymentChannelClaimJsonTests - extends AbstractTransactionJsonTest { +public class PaymentChannelClaimJsonTests extends AbstractTransactionJsonTest< + ImmutablePaymentChannelClaim, ImmutablePaymentChannelClaim.Builder, PaymentChannelClaim + > { /** - * No-args Constructor + * No-args Constructor. */ protected PaymentChannelClaimJsonTests() { super(PaymentChannelClaim.class, ImmutablePaymentChannelClaim.class, TransactionType.PAYMENT_CHANNEL_CLAIM); @@ -59,7 +60,7 @@ protected PaymentChannelClaim fullyPopulatedTransaction() { .balance(XrpCurrencyAmount.ofDrops(1000000)) .amount(XrpCurrencyAmount.ofDrops(1000000)) .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + - "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") + "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") @@ -82,7 +83,7 @@ protected PaymentChannelClaim minimallyPopulatedTransaction() { .fee(XrpCurrencyAmount.ofDrops(10)) .channel(Hash256.of("C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198")) .signature("30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4779E" + - "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") + "F4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B") .publicKey("32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A") .signingPublicKey( PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC") @@ -94,19 +95,19 @@ protected PaymentChannelClaim minimallyPopulatedTransaction() { public void testPaymentChannelClaimJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelClaim\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + - "}"; + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelClaim\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @@ -123,20 +124,20 @@ public void testPaymentChannelClaimJsonWithFlags() throws JsonProcessingExceptio String json = "{\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": 2147680256,\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"NetworkID\": 1024,\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + - " \"Sequence\": 1,\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TransactionType\": \"PaymentChannelClaim\"\n" + - "}"; + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 2147680256,\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"NetworkID\": 1024,\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\",\n" + + " \"Sequence\": 1,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"PaymentChannelClaim\"\n" + + "}"; assertCanSerializeAndDeserialize(transaction, json); } @@ -144,20 +145,20 @@ public void testPaymentChannelClaimJsonWithFlags() throws JsonProcessingExceptio public void testPaymentChannelClaimJsonWithUnknownFields() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelClaim\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Balance\": \"1000000\",\n" + - " \"Amount\": \"1000000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + - "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelClaim\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Balance\": \"1000000\",\n" + + " \"Amount\": \"1000000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"Signature\": \"30440220718D264EF05CAED7C781FF6DE298DCAC68D002562C9BF3A07C1E721B420C0DAB02203A5A4" + + "779EF4D2CCC7BC3EF886676D803A9981B928D3B8ACA483B80ECA3CD7B9B\",\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"PublicKey\": \"32D2471DB72B27E3310F355BB33E339BF26F8392D5A93D3BC0FC3B566612DA0F0A\"\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransactionWithUnknownFields(), json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java index fd40690c9..fc543a33d 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelCreateJsonTests.java @@ -39,7 +39,7 @@ public class PaymentChannelCreateJsonTests extends AbstractTransactionJsonTest< > { /** - * No-args Constructor + * No-args Constructor. */ protected PaymentChannelCreateJsonTests() { super(PaymentChannelCreate.class, ImmutablePaymentChannelCreate.class, TransactionType.PAYMENT_CHANNEL_CREATE); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java index cf0ed4d62..26b05fd66 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelFundJsonTests.java @@ -35,11 +35,12 @@ import org.xrpl.xrpl4j.model.transactions.TransactionType; import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount; -public class PaymentChannelFundJsonTests - extends AbstractTransactionJsonTest { +public class PaymentChannelFundJsonTests extends AbstractTransactionJsonTest< + ImmutablePaymentChannelFund, ImmutablePaymentChannelFund.Builder, PaymentChannelFund + > { /** - * No-args Constructor + * No-args Constructor. */ protected PaymentChannelFundJsonTests() { super(PaymentChannelFund.class, ImmutablePaymentChannelFund.class, TransactionType.PAYMENT_CHANNEL_FUND); @@ -90,16 +91,16 @@ protected PaymentChannelFund minimallyPopulatedTransaction() { public void testPaymentChannelFundJson() throws JsonProcessingException, JSONException { String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}"; + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Amount\": \"200000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Expiration\": 543171558\n" + + "}"; assertCanSerializeAndDeserialize(fullyPopulatedTransaction(), json); } @@ -112,17 +113,17 @@ public void testPaymentChannelFundJsonWithUnsetFlags() throws JsonProcessingExce String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Amount\": \"200000\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Expiration\": 543171558,\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": 0,\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\"\n" + - "}"; + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Amount\": \"200000\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Expiration\": 543171558,\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": 0,\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\"\n" + + "}"; assertCanSerializeAndDeserialize(fund, json); } @@ -135,17 +136,17 @@ public void testPaymentChannelFundJsonWithNonZeroFlags() throws JsonProcessingEx String json = "{\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Amount\": \"200000\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Expiration\": 543171558,\n" + - " \"Fee\": \"10\",\n" + - " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + - " \"NetworkID\": 1024,\n" + - " \"Sequence\": 1,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"TransactionType\": \"PaymentChannelFund\"\n" + - "}"; + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Amount\": \"200000\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Expiration\": 543171558,\n" + + " \"Fee\": \"10\",\n" + + " \"Flags\": " + TransactionFlags.FULLY_CANONICAL_SIG.getValue() + ",\n" + + " \"NetworkID\": 1024,\n" + + " \"Sequence\": 1,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"TransactionType\": \"PaymentChannelFund\"\n" + + "}"; assertCanSerializeAndDeserialize(fund, json); } @@ -168,17 +169,17 @@ public void testPaymentChannelFundJsonWithUnknownFields() throws JsonProcessingE String json = "{\n" + - " \"Foo\" : \"Bar\",\n" + - " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + - " \"Fee\": \"10\",\n" + - " \"Sequence\": 1,\n" + - " \"TransactionType\": \"PaymentChannelFund\",\n" + - " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + - " \"Amount\": \"200000\",\n" + - " \"NetworkID\": 1024,\n" + - " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + - " \"Expiration\": 543171558\n" + - "}"; + " \"Foo\" : \"Bar\",\n" + + " \"Account\": \"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn\",\n" + + " \"Fee\": \"10\",\n" + + " \"Sequence\": 1,\n" + + " \"TransactionType\": \"PaymentChannelFund\",\n" + + " \"Channel\": \"C1AE6DDDEEC05CF2978C0BAD6FE302948E9533691DC749DCDD3B9E5992CA6198\",\n" + + " \"Amount\": \"200000\",\n" + + " \"NetworkID\": 1024,\n" + + " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" + + " \"Expiration\": 543171558\n" + + "}"; assertCanSerializeAndDeserialize(fund, json); } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java index c6196864f..cbe48c40a 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentJsonTests.java @@ -41,7 +41,7 @@ public class PaymentJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected PaymentJsonTests() { super(Payment.class, ImmutablePayment.class, TransactionType.PAYMENT); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java index aa6860e0c..b5b9c1fab 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SetRegularKeyJsonTest.java @@ -37,7 +37,7 @@ public class SetRegularKeyJsonTest extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected SetRegularKeyJsonTest() { super(SetRegularKey.class, ImmutableSetRegularKey.class, TransactionType.SET_REGULAR_KEY); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java index 42dd4f17f..1479edcff 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/SignerListSetJsonTests.java @@ -39,7 +39,7 @@ public class SignerListSetJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected SignerListSetJsonTests() { super(SignerListSet.class, ImmutableSignerListSet.class, TransactionType.SIGNER_LIST_SET); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java index 4c38fd2bc..ff05203e6 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TicketCreateJsonTest.java @@ -37,7 +37,7 @@ class TicketCreateJsonTest extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected TicketCreateJsonTest() { super(TicketCreate.class, ImmutableTicketCreate.class, TransactionType.TICKET_CREATE); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java index 4e53de1b7..9d59adf26 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/TrustSetJsonTests.java @@ -38,7 +38,7 @@ public class TrustSetJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected TrustSetJsonTests() { super(TrustSet.class, ImmutableTrustSet.class, TransactionType.TRUST_SET); diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java index 7c9a55d54..05b0e9a3e 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/UnlModifyJsonTests.java @@ -40,7 +40,7 @@ public class UnlModifyJsonTests extends AbstractTransactionJsonTest { /** - * No-args Constructor + * No-args Constructor. */ protected UnlModifyJsonTests() { super(UnlModify.class, ImmutableUnlModify.class, TransactionType.UNL_MODIFY); @@ -91,14 +91,14 @@ public void testJsonWithAccountZero() throws JsonProcessingException, JSONExcept .build(); String json = "{" + - "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; assertCanSerializeAndDeserialize(unlModify, json); } @@ -115,15 +115,15 @@ public void testJsonWithAccountZeroAndUnknownFields() throws JsonProcessingExcep .build(); String json = "{" + - "\"Foo\" : \"Bar\",\n" + - "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Foo\" : \"Bar\",\n" + + "\"Account\":\"" + UnlModify.ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; assertCanSerializeAndDeserialize(unlModify, json); } @@ -139,31 +139,32 @@ public void testJsonWithEmptyAccount() throws JsonProcessingException, JSONExcep .build(); // What we expect the ObjectMapper to Serialize (given the above object) - String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + String expectedSerializedJson = + "{" + + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize String jsonForDeserialization = "{" + - "\"Account\":\"\"," + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); @@ -182,32 +183,32 @@ public void testJsonWithEmptyAccountAndUnknownFields() throws JsonProcessingExce // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize String jsonForDeserialization = "{" + - "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! - "\"Account\":\"\"," + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Account\":\"\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); @@ -225,27 +226,27 @@ public void testJsonWithMissingAccount() throws JsonProcessingException, JSONExc // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize String jsonForDeserialization = "{" + // <-- The crux of the test (i.e., missing account) - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"}"; Transaction deserialized = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserialized).isEqualTo(unlModify); @@ -264,31 +265,31 @@ public void testJsonWithMissingAccountAndUnknownFields() throws JsonProcessingEx // What we expect the ObjectMapper to Serialize (given the above object) String expectedSerializedJson = "{" + - "\"Account\":\"" + ACCOUNT_ZERO + "\"," + - "\"Foo\" : \"Bar\"," + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Account\":\"" + ACCOUNT_ZERO + "\"," + + "\"Foo\" : \"Bar\"," + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; String serialized = objectMapper.writeValueAsString(unlModify); JSONAssert.assertEquals(expectedSerializedJson, serialized, JSONCompareMode.STRICT); // What we provide the ObjectMapper to Deserialize String jsonForDeserialization = "{" + // <-- The crux of the test (i.e., missing account) - "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! - "\"Fee\":\"12\"," + - "\"LedgerSequence\":67850752," + - "\"Sequence\":2470665," + - "\"SigningPubKey\":\"\"," + - "\"TransactionType\":\"UNLModify\"," + - "\"UNLModifyDisabling\":1," + - "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + - "}"; + "\"Foo\" : \"Bar\",\n" + // <-- The crux of the test! + "\"Fee\":\"12\"," + + "\"LedgerSequence\":67850752," + + "\"Sequence\":2470665," + + "\"SigningPubKey\":\"\"," + + "\"TransactionType\":\"UNLModify\"," + + "\"UNLModifyDisabling\":1," + + "\"UNLModifyValidator\":\"EDB6FC8E803EE8EDC2793F1EC917B2EE41D35255618DEB91D3F9B1FC89B75D4539\"" + + "}"; Transaction deserializedTransaction = objectMapper.readValue(jsonForDeserialization, Transaction.class); assertThat(deserializedTransaction).isEqualTo(unlModify); From 7f7e86f6b8d42192a86015d02e6d26a2c7c66b29 Mon Sep 17 00:00:00 2001 From: David Fuelling Date: Sun, 16 Feb 2025 13:31:03 -0500 Subject: [PATCH 13/13] Misc cleanup --- .../java/org/xrpl/xrpl4j/model/transactions/UnlModify.java | 2 +- .../org/xrpl/xrpl4j/model/transactions/XChainBridge.java | 4 +--- .../model/transactions/NegativeTransactionMetadataTest.java | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java index 2b60a2cd3..fa8697ec8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnlModify.java @@ -61,7 +61,7 @@ static ImmutableUnlModify.Builder builder() { * @return Always returns ACCOUNT_ZERO, which is the base58 encoding of the number zero. */ @Override - @JsonProperty(value = "Account") + @JsonProperty("Account") @Value.Default // Must be `Default` not `Derived`, else this field will be serialized into `unknownFields`. default Address account() { return ACCOUNT_ZERO; diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java index b82ab30b2..614af52f8 100644 --- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java +++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/XChainBridge.java @@ -4,8 +4,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.google.common.annotations.Beta; -import com.google.common.base.Preconditions; -import org.immutables.value.Value; import org.immutables.value.Value.Immutable; import org.xrpl.xrpl4j.model.ledger.Issue; @@ -63,5 +61,5 @@ static ImmutableXChainBridge.Builder builder() { */ @JsonProperty("LockingChainIssue") Issue lockingChainIssue(); - + } diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java index 663a11d36..97000c605 100644 --- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java +++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/NegativeTransactionMetadataTest.java @@ -1,7 +1,6 @@ package org.xrpl.xrpl4j.model.transactions; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; @@ -113,8 +112,8 @@ void deserializeLedgerResultWithNegativeAmounts(String ledgerResultFileName) thr } /** - * This test validates that the ledger 87704323 and all of its transactions and metadata are handled correctly, even - * in the presence of negative XRP or IOU amounts. + * This test validates that the ledger 94084608 and all of its transactions and metadata are handled correctly, even + * in the presence of a `UnlModify` transaction that has an empty `Account`. */ @ParameterizedTest @ValueSource(strings = {