Date: Sat, 2 Nov 2024 17:46:30 -0400
Subject: [PATCH 08/10] javadoc
---
.../transactions/UnknownTransaction.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
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 1c8f1dbdc..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
@@ -8,6 +8,9 @@
import org.immutables.value.Value.Immutable;
import org.xrpl.xrpl4j.model.flags.TransactionFlags;
+/**
+ * Mapping for any transaction type that is unrecognized/unsupported by xrpl4j.
+ */
@Immutable
@JsonSerialize(as = ImmutableUnknownTransaction.class)
@JsonDeserialize(as = ImmutableUnknownTransaction.class)
@@ -23,7 +26,9 @@ static ImmutableUnknownTransaction.Builder builder() {
}
/**
- * This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType},
+ * The actual transaction type found in the {@code "TransactionType"} field of the transaction JSON.
+ *
+ * This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType},
* which only has an UNKNOWN variant. Because this method is also annotated with {@link JsonProperty} of
* "TransactionType", this essentially overrides the "TransactionType" field in JSON, but {@link #transactionType()}
* will always be {@link TransactionType#UNKNOWN} and this field will contain the actual "TransactionType" field.
@@ -33,12 +38,24 @@ static ImmutableUnknownTransaction.Builder builder() {
@JsonProperty("TransactionType")
String unknownTransactionType();
+ /**
+ * The {@link TransactionType} of this UnknownTransaction, which will always be {@link TransactionType#UNKNOWN}.
+ * {@link #unknownTransactionType()} contains the actual transaction type value.
+ *
+ * @return {@link TransactionType#UNKNOWN}.
+ */
@Override
@JsonIgnore
+ @Value.Derived
default TransactionType transactionType() {
return Transaction.super.transactionType();
}
+ /**
+ * A set of {@link TransactionFlags}.
+ *
+ * @return A {@link TransactionFlags}.
+ */
@JsonProperty("Flags")
@Value.Default
default TransactionFlags flags() {
From 2c7c292c0716ed23af88bf6ef2998fd55052c17e Mon Sep 17 00:00:00 2001
From: nkramer44
Date: Sat, 2 Nov 2024 17:49:02 -0400
Subject: [PATCH 09/10] Revert "javadoc"
This reverts commit e19502cc45e93e3d2e1a6f3b5cc5ac3e5393073b.
---
.../transactions/UnknownTransaction.java | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
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..1c8f1dbdc 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
@@ -8,9 +8,6 @@
import org.immutables.value.Value.Immutable;
import org.xrpl.xrpl4j.model.flags.TransactionFlags;
-/**
- * Mapping for any transaction type that is unrecognized/unsupported by xrpl4j.
- */
@Immutable
@JsonSerialize(as = ImmutableUnknownTransaction.class)
@JsonDeserialize(as = ImmutableUnknownTransaction.class)
@@ -26,9 +23,7 @@ static ImmutableUnknownTransaction.Builder builder() {
}
/**
- * The actual transaction type found in the {@code "TransactionType"} field of the transaction JSON.
- *
- * This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType},
+ * This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType},
* which only has an UNKNOWN variant. Because this method is also annotated with {@link JsonProperty} of
* "TransactionType", this essentially overrides the "TransactionType" field in JSON, but {@link #transactionType()}
* will always be {@link TransactionType#UNKNOWN} and this field will contain the actual "TransactionType" field.
@@ -38,24 +33,12 @@ static ImmutableUnknownTransaction.Builder builder() {
@JsonProperty("TransactionType")
String unknownTransactionType();
- /**
- * The {@link TransactionType} of this UnknownTransaction, which will always be {@link TransactionType#UNKNOWN}.
- * {@link #unknownTransactionType()} contains the actual transaction type value.
- *
- * @return {@link TransactionType#UNKNOWN}.
- */
@Override
@JsonIgnore
- @Value.Derived
default TransactionType transactionType() {
return Transaction.super.transactionType();
}
- /**
- * A set of {@link TransactionFlags}.
- *
- * @return A {@link TransactionFlags}.
- */
@JsonProperty("Flags")
@Value.Default
default TransactionFlags flags() {
From 18f9dabc006712ebdb000519d7fd2ef4ef746b33 Mon Sep 17 00:00:00 2001
From: nkramer44
Date: Sat, 2 Nov 2024 17:49:02 -0400
Subject: [PATCH 10/10] Revert "unknown transaction"
This reverts commit 14f726419d857f7edb2dc86234a35d03d79566c6.
---
.../xrpl4j/model/flags/TransactionFlags.java | 4 -
...ntTransactionsTransactionDeserializer.java | 17 +--
.../modules/TransactionDeserializer.java | 1 -
.../TransactionResultDeserializer.java | 15 +--
.../xrpl4j/model/transactions/AmmBid.java | 6 -
.../model/transactions/Transaction.java | 10 --
.../model/transactions/TransactionType.java | 6 +-
.../transactions/UnknownTransaction.java | 48 --------
.../xrpl4j/model/transactions/UnlModify.java | 4 +-
.../xrpl4j/model/transactions/AmmBidTest.java | 54 ---------
.../model/transactions/AmmCreateTest.java | 40 -------
.../model/transactions/AmmDeleteTest.java | 38 ------
.../model/transactions/AmmDepositTest.java | 57 ---------
.../model/transactions/AmmVoteTest.java | 40 -------
.../model/transactions/AmmWithdrawTest.java | 26 +----
.../model/transactions/ClawbackTest.java | 36 ------
.../model/transactions/DidDeleteTest.java | 18 ---
.../xrpl4j/model/transactions/DidSetTest.java | 28 -----
.../model/transactions/OracleDeleteTest.java | 19 ---
.../model/transactions/OracleSetTest.java | 20 ----
.../xrpl4j/model/transactions/SetFeeTest.java | 34 ------
.../transactions/TransactionTypeTests.java | 31 +++--
.../transactions/UnknownTransactionTest.java | 76 ------------
.../XChainAccountCreateCommitTest.java | 52 ---------
...XChainAddAccountCreateAttestationTest.java | 38 ------
.../XChainAddClaimAttestationTest.java | 40 -------
.../model/transactions/XChainClaimTest.java | 33 ------
.../model/transactions/XChainCommitTest.java | 41 -------
.../transactions/XChainCreateBridgeTest.java | 32 -----
.../transactions/XChainCreateClaimIdTest.java | 31 -----
.../transactions/XChainModifyBridgeTest.java | 29 -----
.../json/AccountDeleteJsonTests.java | 30 -----
.../json/AccountSetJsonTests.java | 48 --------
.../transactions/json/CheckJsonTests.java | 94 ---------------
.../json/EnableAmendmentJsonTests.java | 24 ----
.../transactions/json/EscrowJsonTests.java | 110 ------------------
.../json/NfTokenAcceptOfferJsonTests.java | 35 ------
.../json/NfTokenBurnJsonTests.java | 30 -----
.../json/NfTokenCancelOfferJsonTests.java | 33 ------
.../json/NfTokenCreateOfferJsonTests.java | 32 -----
.../json/NfTokenMintJsonTests.java | 34 ------
.../transactions/json/OfferJsonTests.java | 62 ----------
.../json/PaymentChannelJsonTests.java | 109 -----------------
.../transactions/json/PaymentJsonTests.java | 32 -----
.../json/SetRegularKeyJsonTest.java | 28 -----
.../json/SignerListSetJsonTests.java | 30 -----
.../json/TicketCreateJsonTest.java | 28 -----
.../transactions/json/TrustSetJsonTests.java | 40 -------
.../transactions/json/UnlModifyJsonTests.java | 3 -
49 files changed, 34 insertions(+), 1692 deletions(-)
delete mode 100644 xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java
delete mode 100644 xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java
diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/TransactionFlags.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/TransactionFlags.java
index 8c03379a7..a79f04ce0 100644
--- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/TransactionFlags.java
+++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/TransactionFlags.java
@@ -49,10 +49,6 @@ public class TransactionFlags extends Flags {
TransactionFlags() {
}
- public static TransactionFlags of(long value) {
- return new TransactionFlags(value);
- }
-
/**
* Flags indicating that a fully-canonical signature is required. This flag is highly recommended.
*
diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/AccountTransactionsTransactionDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/AccountTransactionsTransactionDeserializer.java
index 4c2d0cd23..e4256eba6 100644
--- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/AccountTransactionsTransactionDeserializer.java
+++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/AccountTransactionsTransactionDeserializer.java
@@ -25,9 +25,6 @@
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;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
import com.google.common.primitives.UnsignedInteger;
import com.google.common.primitives.UnsignedLong;
import org.xrpl.xrpl4j.model.client.accounts.AccountTransactionsTransaction;
@@ -36,9 +33,7 @@
import org.xrpl.xrpl4j.model.transactions.Transaction;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Optional;
-import java.util.Set;
/**
* Custom Jackson Deserializer for {@link AccountTransactionsTransaction}s. This is necessary because Jackson
@@ -46,8 +41,6 @@
*/
public class AccountTransactionsTransactionDeserializer extends StdDeserializer> {
- public static final Set EXTRA_TRANSACTION_FIELDS = Sets.newHashSet("ledger_index", "date", "hash");
-
/**
* No-args constructor.
*/
@@ -61,20 +54,14 @@ public AccountTransactionsTransaction> deserialize(
DeserializationContext ctxt
) throws IOException {
ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec();
- ObjectNode node = objectMapper.readTree(jsonParser);
+ JsonNode node = objectMapper.readTree(jsonParser);
+ Transaction transaction = objectMapper.readValue(node.toString(), Transaction.class);
long ledgerIndex = node.get("ledger_index").asLong(-1L);
String hash = node.get("hash").asText();
Optional closeDate = Optional.ofNullable(node.get("date"))
.map(JsonNode::asLong)
.map(UnsignedLong::valueOf);
-
- // The Transaction is @JsonUnwrapped in AccountTransactionsTransaction, which means these three fields
- // get added to the Transaction.unknownFields Map. To prevent that, we simply remove them from the JSON, because
- // they should only show up in AccountTransactionsTransaction
- node.remove(EXTRA_TRANSACTION_FIELDS);
- Transaction transaction = objectMapper.readValue(node.toString(), Transaction.class);
-
return AccountTransactionsTransaction.builder()
.transaction(transaction)
.ledgerIndex(LedgerIndex.of(UnsignedInteger.valueOf(ledgerIndex)))
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 1eccf82a6..c4cb3a483 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
@@ -27,7 +27,6 @@
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 java.io.IOException;
diff --git a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionResultDeserializer.java b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionResultDeserializer.java
index 932a9f277..7ab4c6795 100644
--- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionResultDeserializer.java
+++ b/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/jackson/modules/TransactionResultDeserializer.java
@@ -27,7 +27,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.Sets;
import com.google.common.primitives.UnsignedInteger;
import com.google.common.primitives.UnsignedLong;
import org.xrpl.xrpl4j.model.client.common.LedgerIndex;
@@ -38,7 +37,6 @@
import java.io.IOException;
import java.util.Optional;
-import java.util.Set;
/**
* Custom deserializer for {@link TransactionResult}, which wraps the {@link Transaction} fields in the result JSON.
@@ -50,10 +48,6 @@
*/
public class TransactionResultDeserializer extends StdDeserializer> {
- public static final Set EXTRA_TRANSACTION_FIELDS = Sets.newHashSet(
- "ledger_index", "date", "hash", "status", "validated", "meta", "metaData"
- );
-
/**
* No-args constructor.
*/
@@ -66,6 +60,10 @@ public TransactionResult deserialize(JsonParser jsonParser, DeserializationCo
ObjectMapper objectMapper = (ObjectMapper) jsonParser.getCodec();
ObjectNode objectNode = objectMapper.readTree(jsonParser);
+ JavaType javaType = objectMapper.getTypeFactory().constructType(new TypeReference() {
+ });
+ T transaction = objectMapper.convertValue(objectNode, javaType);
+
LedgerIndex ledgerIndex = objectNode.has("ledger_index") ?
LedgerIndex.of(UnsignedInteger.valueOf(objectNode.get("ledger_index").asInt())) :
null;
@@ -75,11 +73,6 @@ public TransactionResult deserialize(JsonParser jsonParser, DeserializationCo
Optional metadata = getTransactionMetadata(objectMapper, objectNode);
UnsignedLong closeDate = objectNode.has("date") ? UnsignedLong.valueOf(objectNode.get("date").asLong()) : null;
- objectNode.remove(EXTRA_TRANSACTION_FIELDS);
- JavaType javaType = objectMapper.getTypeFactory().constructType(new TypeReference() {
- });
- T transaction = objectMapper.convertValue(objectNode, javaType);
-
return TransactionResult.builder()
.transaction(transaction)
.ledgerIndex(Optional.ofNullable(ledgerIndex))
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 3bc9261d1..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
@@ -1,7 +1,5 @@
package org.xrpl.xrpl4j.model.transactions;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -12,7 +10,6 @@
import org.xrpl.xrpl4j.model.ledger.Issue;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
/**
@@ -110,7 +107,4 @@ default TransactionFlags flags() {
@JsonProperty("AuthAccounts")
List authAccounts();
- /*@Override
- @JsonAnyGetter
- Map unknownFields();*/
}
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 fb96cd14a..9f4f1acaf 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
@@ -20,10 +20,7 @@
* =========================LICENSE_END==================================
*/
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
@@ -33,7 +30,6 @@
import org.xrpl.xrpl4j.crypto.signing.Signature;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
/**
@@ -94,7 +90,6 @@ public interface Transaction {
.put(ImmutableDidDelete.class, TransactionType.DID_DELETE)
.put(ImmutableOracleSet.class, TransactionType.ORACLE_SET)
.put(ImmutableOracleDelete.class, TransactionType.ORACLE_DELETE)
- .put(ImmutableUnknownTransaction.class, TransactionType.UNKNOWN)
.build();
/**
@@ -111,7 +106,6 @@ public interface Transaction {
* @return A {@link TransactionType}.
*/
@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());
}
@@ -226,8 +220,4 @@ default PublicKey signingPublicKey() {
@JsonProperty("NetworkID")
Optional networkId();
- @JsonAnyGetter
- @JsonInclude(Include.NON_ABSENT)
- Map unknownFields();
-
}
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 92cd912f1..bc19f8dbf 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
@@ -336,9 +336,7 @@ public enum TransactionType {
* is subject to change.
*/
@Beta
- ORACLE_DELETE("OracleDelete"),
-
- UNKNOWN("Unknown");
+ ORACLE_DELETE("OracleDelete");
private final String value;
@@ -360,7 +358,7 @@ public static TransactionType forValue(String value) {
}
}
- return UNKNOWN;
+ throw new IllegalArgumentException("No matching TransactionType enum value for String value " + value);
}
/**
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
deleted file mode 100644
index 1c8f1dbdc..000000000
--- a/xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/transactions/UnknownTransaction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.xrpl.xrpl4j.model.transactions;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.immutables.value.Value;
-import org.immutables.value.Value.Immutable;
-import org.xrpl.xrpl4j.model.flags.TransactionFlags;
-
-@Immutable
-@JsonSerialize(as = ImmutableUnknownTransaction.class)
-@JsonDeserialize(as = ImmutableUnknownTransaction.class)
-public interface UnknownTransaction extends Transaction {
-
- /**
- * Construct a {@code UnknownTransaction} builder.
- *
- * @return An {@link ImmutableUnknownTransaction.Builder}.
- */
- static ImmutableUnknownTransaction.Builder builder() {
- return ImmutableUnknownTransaction.builder();
- }
-
- /**
- * This has to be a {@link String} because {@link Transaction#transactionType()} is a {@link TransactionType},
- * which only has an UNKNOWN variant. Because this method is also annotated with {@link JsonProperty} of
- * "TransactionType", this essentially overrides the "TransactionType" field in JSON, but {@link #transactionType()}
- * will always be {@link TransactionType#UNKNOWN} and this field will contain the actual "TransactionType" field.
- *
- * @return A {@link String} containing the transaction type from JSON.
- */
- @JsonProperty("TransactionType")
- String unknownTransactionType();
-
- @Override
- @JsonIgnore
- default TransactionType transactionType() {
- return Transaction.super.transactionType();
- }
-
- @JsonProperty("Flags")
- @Value.Default
- 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 9ad15e842..e171a22e0 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
@@ -62,9 +62,7 @@ static ImmutableUnlModify.Builder builder() {
*/
@Override
@JsonProperty("Account")
- // FIXME: Have to make this Default, otherwise JsonAnySetter adds this field to unknownFields. Other option
- // is that's totally fine, which i think it is -- we should let the JSON set this field if it's there
- @Value.Default
+ @Value.Derived
default Address account() {
return ACCOUNT_ZERO;
}
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmBidTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmBidTest.java
index 9cfab3080..0975e3aa0 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmBidTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmBidTest.java
@@ -312,58 +312,4 @@ void testJsonWithXrpAmountBidMinAndMax() throws JSONException, JsonProcessingExc
"}";
assertCanSerializeAndDeserialize(ammBid, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmBid bid = AmmBid.builder()
- .account(Address.of("rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm"))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")
- )
- .asset(Issue.XRP)
- .asset2(
- Issue.builder()
- .issuer(Address.of("rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"))
- .currency("TST")
- .build()
- )
- .addAuthAccounts(
- AuthAccountWrapper.of(AuthAccount.of(Address.of("rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"))),
- AuthAccountWrapper.of(AuthAccount.of(Address.of("rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv")))
- )
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.valueOf(9))
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm\",\n" +
- " \"Asset\" : {\n" +
- " \"currency\" : \"XRP\"\n" +
- " },\n" +
- " \"Asset2\" : {\n" +
- " \"currency\" : \"TST\",\n" +
- " \"issuer\" : \"rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd\"\n" +
- " },\n" +
- " \"AuthAccounts\" : [\n" +
- " {\n" +
- " \"AuthAccount\" : {\n" +
- " \"Account\" : \"rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg\"\n" +
- " }\n" +
- " },\n" +
- " {\n" +
- " \"AuthAccount\" : {\n" +
- " \"Account\" : \"rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv\"\n" +
- " }\n" +
- " }\n" +
- " ],\n" +
- " \"Fee\" : \"10\",\n" +
- " \"Sequence\" : 9,\n" +
- " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" +
- " \"TransactionType\" : \"AMMBid\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(bid, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmCreateTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmCreateTest.java
index 927f1820a..275582f17 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmCreateTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmCreateTest.java
@@ -127,44 +127,4 @@ void testJsonWithNonZeroFlags() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(ammCreate, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmCreate ammCreate = AmmCreate.builder()
- .account(Address.of("rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm"))
- .amount(
- IssuedCurrencyAmount.builder()
- .currency("TST")
- .issuer(Address.of("rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"))
- .value("25")
- .build()
- )
- .amount2(XrpCurrencyAmount.ofDrops(250000000))
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.valueOf(6))
- .tradingFee(TradingFee.of(UnsignedInteger.valueOf(500)))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")
- )
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm\",\n" +
- " \"Amount\" : {\n" +
- " \"currency\" : \"TST\",\n" +
- " \"issuer\" : \"rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd\",\n" +
- " \"value\" : \"25\"\n" +
- " },\n" +
- " \"Amount2\" : \"250000000\",\n" +
- " \"Fee\" : \"10\",\n" +
- " \"Sequence\" : 6,\n" +
- " \"TradingFee\" : 500,\n" +
- " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" +
- " \"TransactionType\" : \"AMMCreate\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(ammCreate, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDeleteTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDeleteTest.java
index 83681dfc7..2889e572e 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDeleteTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDeleteTest.java
@@ -46,42 +46,4 @@ void testJson() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(ammDelete, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmDelete ammDelete = AmmDelete.builder()
- .asset(Issue.XRP)
- .asset2(
- Issue.builder()
- .issuer(Address.of("rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"))
- .currency("TST")
- .build()
- )
- .account(Address.of("rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm"))
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.valueOf(9))
- .signingPublicKey(PublicKey.fromBase16EncodedPublicKey(
- "EDD299D60BCE7980F6082945B5597FFFD35223F1950673BFA4D4AED6FDE5097156"
- ))
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm\",\n" +
- " \"Asset\" : {\n" +
- " \"currency\" : \"XRP\"\n" +
- " },\n" +
- " \"Asset2\" : {\n" +
- " \"currency\" : \"TST\",\n" +
- " \"issuer\" : \"rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd\"\n" +
- " },\n" +
- " \"Fee\" : \"10\",\n" +
- " \"Sequence\" : 9,\n" +
- " \"SigningPubKey\" : \"EDD299D60BCE7980F6082945B5597FFFD35223F1950673BFA4D4AED6FDE5097156\",\n" +
- " \"TransactionType\" : \"AMMDelete\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(ammDelete, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDepositTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDepositTest.java
index 247367fd1..004816e7d 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDepositTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmDepositTest.java
@@ -385,61 +385,4 @@ void constructTwoAssetIfEmptyDepositTestJson() throws JSONException, JsonProcess
assertCanSerializeAndDeserialize(deposit, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmDeposit deposit = AmmDeposit.builder()
- .account(Address.of("rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm"))
- .fee(XrpCurrencyAmount.ofDrops(10))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")
- )
- .flags(AmmDepositFlags.TWO_ASSET_IF_EMPTY)
- .asset(Issue.XRP)
- .asset2(
- Issue.builder()
- .issuer(Address.of("rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"))
- .currency("TST")
- .build()
- )
- .amount(
- IssuedCurrencyAmount.builder()
- .currency("039C99CD9AB0B70B32ECDA51EAAE471625608EA2")
- .issuer(Address.of("rE54zDvgnghAoPopCgvtiqWNq3dU5y836S"))
- .value("100")
- .build()
- )
- .amount2(XrpCurrencyAmount.ofDrops(10))
- .effectivePrice(XrpCurrencyAmount.ofDrops(10))
- .putUnknownFields("Foo", "Bar")
- .build();
-
- assertThat(deposit.flags()).isEqualTo(AmmDepositFlags.TWO_ASSET_IF_EMPTY);
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"" + deposit.account() + "\",\n" +
- " \"Amount\" : {\n" +
- " \"currency\" : \"039C99CD9AB0B70B32ECDA51EAAE471625608EA2\",\n" +
- " \"issuer\" : \"rE54zDvgnghAoPopCgvtiqWNq3dU5y836S\",\n" +
- " \"value\" : \"100\"\n" +
- " },\n" +
- " \"Amount2\" : \"10\",\n" +
- " \"EPrice\" : \"10\",\n" +
- " \"Asset2\" : {\n" +
- " \"currency\" : \"TST\",\n" +
- " \"issuer\" : \"rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd\"\n" +
- " },\n" +
- " \"Asset\" : {\n" +
- " \"currency\" : \"XRP\"\n" +
- " },\n" +
- " \"Fee\" : \"10\",\n" +
- " \"Flags\" : " + AmmDepositFlags.TWO_ASSET_IF_EMPTY + ",\n" +
- " \"Sequence\" : 0,\n" +
- " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" +
- " \"TransactionType\" : \"AMMDeposit\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(deposit, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmVoteTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmVoteTest.java
index 8c285f51f..e0fee4500 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmVoteTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmVoteTest.java
@@ -128,44 +128,4 @@ void testJsonWithNonZeroFlags() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(vote, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmVote vote = AmmVote.builder()
- .account(Address.of("rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm"))
- .asset(Issue.XRP)
- .asset2(
- Issue.builder()
- .currency("TST")
- .issuer(Address.of("rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"))
- .build()
- )
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.valueOf(8))
- .tradingFee(TradingFee.of(UnsignedInteger.valueOf(600)))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")
- )
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm\",\n" +
- " \"Asset\" : {\n" +
- " \"currency\" : \"XRP\"\n" +
- " },\n" +
- " \"Asset2\" : {\n" +
- " \"currency\" : \"TST\",\n" +
- " \"issuer\" : \"rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd\"\n" +
- " },\n" +
- " \"Fee\" : \"10\",\n" +
- " \"Sequence\" : 8,\n" +
- " \"TradingFee\" : 600,\n" +
- " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" +
- " \"TransactionType\" : \"AMMVote\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(vote, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmWithdrawTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmWithdrawTest.java
index b59ed7cc7..8f89e64ff 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmWithdrawTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/AmmWithdrawTest.java
@@ -1,5 +1,7 @@
package org.xrpl.xrpl4j.model.transactions;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
import com.fasterxml.jackson.core.JsonProcessingException;
import org.json.JSONException;
import org.junit.jupiter.api.Test;
@@ -210,30 +212,6 @@ void constructLimitLpTokenAndTestJson() throws JSONException, JsonProcessingExce
assertCanSerializeAndDeserialize(withdraw, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- AmmWithdraw withdraw = baseBuilder()
- .flags(AmmWithdrawFlags.LP_TOKEN)
- .lpTokensIn(lpTokensIn())
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\" : \"rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm\",\n" +
- " \"LPTokensIn\" : " + objectMapper.writeValueAsString(withdraw.lpTokensIn()) + "," +
- " \"Asset\" : " + objectMapper.writeValueAsString(withdraw.asset()) + "," +
- " \"Asset2\" : " + objectMapper.writeValueAsString(withdraw.asset2()) + "," +
- " \"Fee\" : \"10\",\n" +
- " \"Flags\" : " + AmmWithdrawFlags.LP_TOKEN + ",\n" +
- " \"Sequence\" : 0,\n" +
- " \"SigningPubKey\" : \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\",\n" +
- " \"TransactionType\" : \"AMMWithdraw\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(withdraw, json);
- }
-
private ImmutableIssuedCurrencyAmount amount() {
return IssuedCurrencyAmount.builder()
.currency("TST")
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/ClawbackTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/ClawbackTest.java
index 8eac63ea1..5eeb0410a 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/ClawbackTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/ClawbackTest.java
@@ -115,40 +115,4 @@ void testJsonWithNonZeroFlags() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(clawback, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- Clawback clawback = Clawback.builder()
- .account(Address.of("rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S"))
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.ONE)
- .signingPublicKey(PublicKey.fromBase16EncodedPublicKey(
- "02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC"
- ))
- .amount(
- IssuedCurrencyAmount.builder()
- .currency("FOO")
- .issuer(Address.of("rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"))
- .value("314.159")
- .build()
- )
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"Clawback\",\n" +
- " \"Account\": \"rp6abvbTbjoce8ZDJkT6snvxTZSYMBCC9S\",\n" +
- " \"Amount\": {\n" +
- " \"currency\": \"FOO\",\n" +
- " \"issuer\": \"rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW\",\n" +
- " \"value\": \"314.159\"\n" +
- " },\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": \"02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(clawback, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidDeleteTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidDeleteTest.java
index b9d5951dd..739963267 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidDeleteTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidDeleteTest.java
@@ -62,24 +62,6 @@ void testJsonWithSetFlags() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(transaction, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- DidDelete transaction = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"DIDDelete\", \n" +
- " \"Account\": \"rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex\",\n" +
- " \"Fee\": \"12\",\n" +
- " \"Sequence\": 391,\n" +
- " \"SigningPubKey\":\"%s\"\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(transaction, json);
- }
-
private ImmutableDidDelete.Builder baseBuilder() {
return DidDelete.builder()
.account(Address.of("rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex"))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidSetTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidSetTest.java
index 8541f0040..09051f8c9 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidSetTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/DidSetTest.java
@@ -113,32 +113,4 @@ void testJsonWithSetFlags() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(transaction, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- DidSet transaction = DidSet.builder()
- .account(Address.of("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"))
- .fee(XrpCurrencyAmount.ofDrops(10))
- .sequence(UnsignedInteger.valueOf(391))
- .didDocument(DidDocument.of(""))
- .uri(DidUri.of(""))
- .data(DidData.of(""))
- .signingPublicKey(ED_PUBLIC_KEY)
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"DIDSet\",\n" +
- " \"Account\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 391,\n" +
- " \"DIDDocument\": \"\",\n" +
- " \"URI\": \"\",\n" +
- " \"Data\": \"\",\n" +
- " \"SigningPubKey\":\"%s\"\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(transaction, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleDeleteTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleDeleteTest.java
index fbdcdf222..54e54264a 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleDeleteTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleDeleteTest.java
@@ -37,25 +37,6 @@ void testJson() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(oracleDelete, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- OracleDelete oracleDelete = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
- String json = "\n" +
- "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"OracleDelete\",\n" +
- " \"Account\": \"rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex\",\n" +
- " \"OracleDocumentID\": 1,\n" +
- " \"Fee\": \"12\",\n" +
- " \"Sequence\": 391,\n" +
- " \"SigningPubKey\": \"" + ED_PUBLIC_KEY_HEX + "\"\n" +
- "}";
-
- assertCanSerializeAndDeserialize(oracleDelete, json);
- }
-
private static ImmutableOracleDelete.Builder baseBuilder() {
return OracleDelete.builder()
.account(Address.of("rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex"))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleSetTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleSetTest.java
index 859417cb0..05bdb2733 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleSetTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/OracleSetTest.java
@@ -82,26 +82,6 @@ void testFullJson() throws JSONException, JsonProcessingException {
assertCanSerializeAndDeserialize(oracleSet, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- OracleSet oracleSet = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
- String json = "\n" +
- "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"OracleSet\",\n" +
- " \"Account\": \"rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex\",\n" +
- " \"OracleDocumentID\": 1,\n" +
- " \"Fee\": \"12\",\n" +
- " \"Sequence\": 391,\n" +
- " \"SigningPubKey\": \"" + ED_PUBLIC_KEY_HEX + "\",\n" +
- " \"LastUpdateTime\": 1\n" +
- "}";
-
- assertCanSerializeAndDeserialize(oracleSet, json);
- }
-
private static ImmutableOracleSet.Builder baseBuilder() {
return OracleSet.builder()
.account(Address.of("rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex"))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/SetFeeTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/SetFeeTest.java
index 49a83f717..42018706f 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/SetFeeTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/SetFeeTest.java
@@ -155,38 +155,4 @@ public void testDeserializePostXrpFeesTransaction() throws JsonProcessingExcepti
assertThat(redeserialized).isEqualTo(expected);
}
-
- @Test
- public void testJsonWithUnknownFields() throws JsonProcessingException {
- SetFee expected = SetFee.builder()
- .account(Address.of("rrrrrrrrrrrrrrrrrrrrrhoLvTp"))
- .fee(XrpCurrencyAmount.ofDrops(0))
- .sequence(UnsignedInteger.valueOf(0))
- .baseFeeDrops(XrpCurrencyAmount.ofDrops(10))
- .reserveBaseDrops(XrpCurrencyAmount.ofDrops(10000000))
- .reserveIncrementDrops(XrpCurrencyAmount.ofDrops(2000000))
- .ledgerSequence(Optional.of(LedgerIndex.of(UnsignedInteger.valueOf(66462465))))
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rrrrrrrrrrrrrrrrrrrrrhoLvTp\",\n" +
- " \"BaseFeeDrops\": \"10\",\n" +
- " \"Fee\": \"0\",\n" +
- " \"LedgerSequence\": 66462465,\n" +
- " \"ReserveBaseDrops\": \"10000000\",\n" +
- " \"ReserveIncrementDrops\": \"2000000\",\n" +
- " \"Sequence\": 0,\n" +
- " \"SigningPubKey\": \"\",\n" +
- " \"TransactionType\": \"SetFee\"}";
-
- Transaction actual = objectMapper.readValue(json, Transaction.class);
- assertThat(actual).isEqualTo(expected);
-
- String reserialized = objectMapper.writeValueAsString(actual);
- Transaction redeserialized = objectMapper.readValue(reserialized, Transaction.class);
-
- assertThat(redeserialized).isEqualTo(expected);
- }
}
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/TransactionTypeTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/TransactionTypeTests.java
index af5e049c2..77beee833 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/TransactionTypeTests.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/TransactionTypeTests.java
@@ -32,9 +32,7 @@
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.jupiter.params.provider.ArgumentsSource;
import org.junit.jupiter.params.provider.EmptySource;
-import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.NullSource;
-import org.junit.jupiter.params.provider.ValueSource;
/**
* Unit tests for {@link TransactionType}.
@@ -42,9 +40,8 @@
public class TransactionTypeTests {
@ParameterizedTest
- @EnumSource
- public void shouldReturnTransactionTypeForValidValues(TransactionType type) {
- String value = type.value();
+ @ArgumentsSource(value = TransactionTypeValidArgumentProvider.class)
+ public void shouldReturnTransactionTypeForValidValues(String value) {
TransactionType transactionType = TransactionType.forValue(value);
assertNotNull(transactionType);
assertTrue(transactionType instanceof TransactionType);
@@ -53,9 +50,28 @@ public void shouldReturnTransactionTypeForValidValues(TransactionType type) {
@EmptySource
@NullSource
@ParameterizedTest
- @ValueSource(strings = {"bla", "blaaa", "123"})
+ @ArgumentsSource(value = TransactionTypeInvalidArgumentProvider.class)
public void shouldThrowIllegalArgumentExceptionForInvalidValues(String value) {
- assertThat(TransactionType.forValue(value)).isEqualTo(TransactionType.UNKNOWN);
+ assertThrows(IllegalArgumentException.class, () -> TransactionType.forValue(value),
+ "No matching TransactionType enum value for String value " + value);
+ }
+
+ public static class TransactionTypeValidArgumentProvider implements ArgumentsProvider {
+
+ @Override
+ public java.util.stream.Stream extends Arguments> provideArguments(ExtensionContext context) {
+ return java.util.stream.Stream.of(TransactionType.values()).map(TransactionType::value).map(Arguments::of);
+ }
+
+ }
+
+ public static class TransactionTypeInvalidArgumentProvider implements ArgumentsProvider {
+
+ @Override
+ public java.util.stream.Stream extends Arguments> provideArguments(ExtensionContext context) {
+ return java.util.stream.Stream.of("bla", "blaaa", "123").map(Arguments::of);
+ }
+
}
@Test
@@ -98,6 +114,5 @@ public void testTxTypeCapitalization() {
assertThat(TransactionType.XCHAIN_CREATE_BRIDGE.value()).isEqualTo("XChainCreateBridge");
assertThat(TransactionType.XCHAIN_CREATE_CLAIM_ID.value()).isEqualTo("XChainCreateClaimID");
assertThat(TransactionType.XCHAIN_MODIFY_BRIDGE.value()).isEqualTo("XChainModifyBridge");
- assertThat(TransactionType.UNKNOWN.value()).isEqualTo("Unknown");
}
}
\ 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
deleted file mode 100644
index aeacb2a42..000000000
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/UnknownTransactionTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.xrpl.xrpl4j.model.transactions;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.base.Strings;
-import com.google.common.collect.Maps;
-import com.google.common.primitives.UnsignedInteger;
-import org.immutables.value.Value.Immutable;
-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.AccountSet.AccountSetFlag;
-
-import java.util.HashMap;
-import java.util.Optional;
-
-class UnknownTransactionTest extends AbstractJsonTest {
-
- @Test
- void testJson() throws JSONException, JsonProcessingException {
- HashMap unknownFields = Maps.newHashMap();
- unknownFields.put("Domain", "");
- unknownFields.put("SetFlag", 5);
- unknownFields.put("MessageKey", "");
- unknownFields.put("TransferRate", 1000000001);
- unknownFields.put("TickSize", 15);
- unknownFields.put("ClearFlag", 8);
- unknownFields.put("NFTokenMinter", "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn");
- unknownFields.put("WalletLocator", Strings.repeat("0", 64));
- unknownFields.put("EmailHash", Strings.repeat("0", 32));
- Transaction transaction = UnknownTransaction.builder()
- .unknownTransactionType("AccountSet2")
- .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"))
- .fee(XrpCurrencyAmount.ofDrops(12))
- .sequence(UnsignedInteger.valueOf(5))
- .flags(TransactionFlags.of(2147483648L))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC"))
- .unknownFields(
- unknownFields
- )
- .networkId(NetworkId.of(UnsignedInteger.valueOf(1024)))
- .build();
-
- // Same properties as AccountSet, but TransactionType is AccountSet2
- String json = "{\n" +
- " \"TransactionType\":\"AccountSet2\",\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(transaction, json);
- }
-
-}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommitTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommitTest.java
index 05e79d8d5..9996af22a 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommitTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAccountCreateCommitTest.java
@@ -213,56 +213,4 @@ void testJsonWithEmptySignatureReward() throws JSONException, JsonProcessingExce
assertCanSerializeAndDeserialize(commit, json);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainAccountCreateCommit commit = XChainAccountCreateCommit.builder()
- .account(Address.of("rwEqJ2UaQHe7jihxGqmx6J4xdbGiiyMaGa"))
- .fee(XrpCurrencyAmount.ofDrops(1))
- .sequence(UnsignedInteger.ONE)
- .destination(Address.of("rD323VyRjgzzhY4bFpo44rmyh2neB5d8Mo"))
- .amount(XrpCurrencyAmount.ofDrops(20000000))
- .signatureReward(XrpCurrencyAmount.ofDrops(100))
- .signingPublicKey(ED_PUBLIC_KEY)
- .xChainBridge(
- XChainBridge.builder()
- .lockingChainDoor(Address.of("rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4"))
- .lockingChainIssue(Issue.XRP)
- .issuingChainDoor(Address.of("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"))
- .issuingChainIssue(
- Issue.builder()
- .currency("TST")
- .issuer(Address.of("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"))
- .build()
- )
- .build()
- )
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rwEqJ2UaQHe7jihxGqmx6J4xdbGiiyMaGa\",\n" +
- " \"Fee\": \"1\",\n" +
- " \"Sequence\": 1,\n" +
- " \"Destination\": \"rD323VyRjgzzhY4bFpo44rmyh2neB5d8Mo\",\n" +
- " \"TransactionType\": \"XChainAccountCreateCommit\",\n" +
- " \"Amount\": \"20000000\",\n" +
- " \"SignatureReward\": \"100\",\n" +
- " \"SigningPubKey\": \"%s\",\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"TST\",\n" +
- " \"issuer\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\"\n" +
- " }\n" +
- " }\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(commit, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestationTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestationTest.java
index da41a745d..dbb05e850 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestationTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddAccountCreateAttestationTest.java
@@ -230,42 +230,4 @@ private ImmutableXChainAddAccountCreateAttestation.Builder baseBuilder() {
.sequence(UnsignedInteger.ONE)
.signingPublicKey(ED_PUBLIC_KEY);
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainAddAccountCreateAttestation transaction = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rDr5okqGKmMpn44Bbhe5WAfDQx8e9XquEv\",\n" +
- " \"TransactionType\": \"XChainAddAccountCreateAttestation\",\n" +
- " \"OtherChainSource\": \"rUzB7yg1LcFa7m3q1hfrjr5w53vcWzNh3U\",\n" +
- " \"Destination\": \"rJMfWNVbyjcCtds8kpoEjEbYQ41J5B6MUd\",\n" +
- " \"Amount\": \"2000000000\",\n" +
- " \"PublicKey\": \"EDF7C3F9C80C102AF6D241752B37356E91ED454F26A35C567CF6F8477960F66614\",\n" +
- " \"Signature\": \"F95675BA8FDA21030DE1B687937A79E8491CE51832D6BEEBC071484FA5AF5B8A0E9AFF11A4AA46F09EC" +
- "FFB04C6A8DAE8284AF3ED8128C7D0046D842448478500\",\n" +
- " \"WasLockingChainSend\": 1,\n" +
- " \"AttestationRewardAccount\": \"rpFp36UHW6FpEcZjZqq5jSJWY6UCj3k4Es\",\n" +
- " \"AttestationSignerAccount\": \"rpWLegmW9WrFBzHUj7brhQNZzrxgLj9oxw\",\n" +
- " \"XChainAccountCreateCount\": \"2\",\n" +
- " \"SignatureReward\": \"204\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s,\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"r3nCVTbZGGYoWvZ58BcxDmiMUU7ChMa1eC\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"Fee\": \"20\"\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(transaction, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestationTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestationTest.java
index 09711426e..d1c158446 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestationTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainAddClaimAttestationTest.java
@@ -236,44 +236,4 @@ private ImmutableXChainAddClaimAttestation.Builder baseBuilder() {
)
.xChainClaimId(XChainClaimId.of(UnsignedLong.ONE));
}
-
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainAddClaimAttestation attestation = baseBuilder()
- .wasLockingChainSend(false)
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3\",\n" +
- " \"Amount\": \"10000000\",\n" +
- " \"AttestationRewardAccount\": \"rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3\",\n" +
- " \"AttestationSignerAccount\": \"rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3\",\n" +
- " \"Destination\": \"rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi\",\n" +
- " \"Fee\": \"20\",\n" +
- " \"LastLedgerSequence\": 19,\n" +
- " \"OtherChainSource\": \"raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym\",\n" +
- " \"PublicKey\": \"ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E1136\",\n" +
- " \"Sequence\": 9,\n" +
- " \"Signature\": \"7C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA5" +
- "0E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C\",\n" +
- " \"SigningPubKey\": \"ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C\",\n" +
- " \"TransactionType\": \"XChainAddClaimAttestation\",\n" +
- " \"WasLockingChainSend\": 0,\n" +
- " \"XChainBridge\": {\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"LockingChainDoor\": \"rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"XChainClaimID\": \"1\"\n" +
- " }";
-
- assertCanSerializeAndDeserialize(attestation, json);
- }
}
\ No newline at end of file
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainClaimTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainClaimTest.java
index 494223c60..4426f54dd 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainClaimTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainClaimTest.java
@@ -134,39 +134,6 @@ void testJsonWithFullyCanonicalSigFlags() throws JSONException, JsonProcessingEx
assertCanSerializeAndDeserialize(attestation, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainClaim attestation = baseBuilder()
- .destinationTag(UnsignedInteger.ONE)
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rahDmoXrtPdh7sUdrPjini3gcnTVYjbjjw\",\n" +
- " \"Amount\": \"10000\",\n" +
- " \"Fee\": \"12\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s,\n" +
- " \"TransactionType\": \"XChainClaim\",\n" +
- " \"XChainClaimID\": \"13f\",\n" +
- " \"Destination\": \"rahDmoXrtPdh7sUdrPjini3gcnTVYjbjjw\",\n" +
- " \"DestinationTag\": 1,\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " }\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(attestation, json);
- }
-
private ImmutableXChainClaim.Builder baseBuilder() {
return XChainClaim.builder()
.account(Address.of("rahDmoXrtPdh7sUdrPjini3gcnTVYjbjjw"))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCommitTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCommitTest.java
index 832812cd0..270229447 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCommitTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCommitTest.java
@@ -139,47 +139,6 @@ void testJsonWithFullyCanonicalSigFlags() throws JSONException, JsonProcessingEx
assertCanSerializeAndDeserialize(commit, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainCommit commit = baseBuilder()
- .amount(
- IssuedCurrencyAmount.builder()
- .currency("CNY")
- .issuer(Address.of("r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK"))
- .value("5000")
- .build()
- )
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rMTi57fNy2UkUb4RcdoUeJm7gjxVQvxzUo\",\n" +
- " \"TransactionType\": \"XChainCommit\",\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"Amount\": {" +
- " \"currency\": \"CNY\",\n" +
- " \"value\": \"5000\",\n" +
- " \"issuer\": \"r45dBj4S3VvMMYXxr9vHX4Z4Ma6ifPMCkK\"\n" +
- " },\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s,\n" +
- " \"XChainClaimID\": \"13f\"\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(commit, json);
- }
-
private ImmutableXChainCommit.Builder baseBuilder() {
return XChainCommit.builder()
.fee(XrpCurrencyAmount.ofDrops(10))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridgeTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridgeTest.java
index d15eb7937..f4bc61714 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridgeTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateBridgeTest.java
@@ -103,38 +103,6 @@ void testJsonWithFullyCanonicalSigFlags() throws JSONException, JsonProcessingEx
assertCanSerializeAndDeserialize(createBridge, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainCreateBridge createBridge = baseBuilder()
- .minAccountCreateAmount(XrpCurrencyAmount.ofDrops(1000000))
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("\n" +
- "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"XChainCreateBridge\",\n" +
- " \"Account\": \"rhWQzvdmhf5vFS35vtKUSUwNZHGT53qQsg\",\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rhWQzvdmhf5vFS35vtKUSUwNZHGT53qQsg\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"SignatureReward\": \"200\",\n" +
- " \"MinAccountCreateAmount\": \"1000000\",\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(createBridge, json);
- }
-
private ImmutableXChainCreateBridge.Builder baseBuilder() {
return XChainCreateBridge.builder()
.fee(XrpCurrencyAmount.ofDrops(10))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimIdTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimIdTest.java
index ac5983c39..ec1824104 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimIdTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainCreateClaimIdTest.java
@@ -102,37 +102,6 @@ void testJsonWithFullyCanonicalSigFlags() throws JSONException, JsonProcessingEx
assertCanSerializeAndDeserialize(claimId, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainCreateClaimId claimId = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("\n" +
- "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"Account\": \"rahDmoXrtPdh7sUdrPjini3gcnTVYjbjjw\",\n" +
- " \"OtherChainSource\": \"rMTi57fNy2UkUb4RcdoUeJm7gjxVQvxzUo\",\n" +
- " \"TransactionType\": \"XChainCreateClaimID\",\n" +
- " \"SignatureReward\": \"100\",\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(claimId, json);
- }
-
private ImmutableXChainCreateClaimId.Builder baseBuilder() {
return XChainCreateClaimId.builder()
.fee(XrpCurrencyAmount.ofDrops(10))
diff --git a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridgeTest.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridgeTest.java
index bbcce697c..caa0a86d3 100644
--- a/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridgeTest.java
+++ b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/XChainModifyBridgeTest.java
@@ -127,35 +127,6 @@ void testWithSigRewardAndMinAccountCreateAmount() throws JSONException, JsonProc
assertCanSerializeAndDeserialize(modify, json);
}
- @Test
- void testJsonWithUnknownFields() throws JSONException, JsonProcessingException {
- XChainModifyBridge modify = baseBuilder()
- .putUnknownFields("Foo", "Bar")
- .build();
-
- String json = String.format("\n" +
- "{\n" +
- " \"Foo\" : \"Bar\",\n" +
- " \"TransactionType\": \"XChainModifyBridge\",\n" +
- " \"Account\": \"rhWQzvdmhf5vFS35vtKUSUwNZHGT53qQsg\",\n" +
- " \"XChainBridge\": {\n" +
- " \"LockingChainDoor\": \"rhWQzvdmhf5vFS35vtKUSUwNZHGT53qQsg\",\n" +
- " \"LockingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " },\n" +
- " \"IssuingChainDoor\": \"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh\",\n" +
- " \"IssuingChainIssue\": {\n" +
- " \"currency\": \"XRP\"\n" +
- " }\n" +
- " },\n" +
- " \"Fee\": \"10\",\n" +
- " \"Sequence\": 1,\n" +
- " \"SigningPubKey\": %s\n" +
- "}", ED_PUBLIC_KEY.base16Value());
-
- assertCanSerializeAndDeserialize(modify, json);
- }
-
private ImmutableXChainModifyBridge.Builder baseBuilder() {
return XChainModifyBridge.builder()
.fee(XrpCurrencyAmount.ofDrops(10))
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..8177a0b61 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
@@ -117,34 +117,4 @@ public void testJsonWithNonZeroFlags() throws JsonProcessingException, JSONExcep
assertCanSerializeAndDeserialize(accountDelete, 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" +
- "}";
-
- assertCanSerializeAndDeserialize(accountDelete, 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..4f38e2afc 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
@@ -310,52 +310,4 @@ void testJsonWithUnrecognizedClearAndSetFlag() throws JSONException, JsonProcess
assertCanSerializeAndDeserialize(accountSet, json);
}
-
- @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" +
- "}";
-
- assertCanSerializeAndDeserialize(accountSet, 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
index 056979430..b20288ed3 100644
--- 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
@@ -115,34 +115,6 @@ public void testCheckCancelJsonWithNonZeroFlags() throws JsonProcessingException
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()
@@ -253,36 +225,6 @@ public void testCheckCashJsonWithNonZeroFlags() throws JsonProcessingException,
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()
@@ -398,40 +340,4 @@ public void testCheckCreateJsonWithNonZeroFlags() throws JsonProcessingException
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..372360b7e 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
@@ -56,28 +56,4 @@ public void testJson() throws JsonProcessingException, JSONException {
assertCanSerializeAndDeserialize(enableAmendment, json);
}
-
- @Test
- public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException {
- EnableAmendment enableAmendment = 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();
-
- String json = "{" +
- "\"Foo\" : \"Bar\",\n" +
- "\"Account\":\"rrrrrrrrrrrrrrrrrrrrrhoLvTp\"," +
- "\"Fee\":\"12\"," +
- "\"LedgerSequence\":67850752," +
- "\"Sequence\":2470665," +
- "\"SigningPubKey\":\"\"," +
- "\"TransactionType\":\"EnableAmendment\"," +
- "\"Amendment\":\"42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE\"}";
-
- assertCanSerializeAndDeserialize(enableAmendment, 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
index c9b1b7aaa..6c7c39f87 100644
--- 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
@@ -166,50 +166,6 @@ public void testEscrowCreateJsonWithNonZeroFlags()
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()
@@ -291,35 +247,6 @@ public void testEscrowCancelJsonWithNonZeroFlags() throws JsonProcessingExceptio
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()
@@ -466,41 +393,4 @@ void testEscrowFinishJsonWithMalformedFulfillment() throws JsonProcessingExcepti
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..0c4b82073 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
@@ -156,39 +156,4 @@ public void testNfTokenAcceptOfferWithOnlyBuyOffer() throws JsonProcessingExcept
assertCanSerializeAndDeserialize(nfTokenAcceptOffer, json);
}
-
- @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" +
- "}";
-
- assertCanSerializeAndDeserialize(nfTokenAcceptOffer, 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..51d734f08 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
@@ -116,34 +116,4 @@ public void testNfTokenBurnJsonWithNonZeroFlags() throws JsonProcessingException
assertCanSerializeAndDeserialize(nfTokenBurn, 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" +
- "}";
-
- assertCanSerializeAndDeserialize(nfTokenBurn, 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..5bc21ef08 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
@@ -130,37 +130,4 @@ public void testNfTokenCancelOfferJsonWithNonZeroFlags() throws JsonProcessingEx
assertCanSerializeAndDeserialize(nfTokenCancelOffer, 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" +
- "}";
-
- assertCanSerializeAndDeserialize(nfTokenCancelOffer, 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..880cfa734 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
@@ -94,36 +94,4 @@ public void testJsonWithFlags() throws JsonProcessingException, JSONException {
assertCanSerializeAndDeserialize(nfTokenCreateOffer, json);
}
-
- @Test
- public void testJsonWithUnknownFields() throws JsonProcessingException, JSONException {
-
- NfTokenId id = NfTokenId.of("000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65");
- NfTokenCreateOffer nfTokenCreateOffer = NfTokenCreateOffer.builder()
- .account(Address.of("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"))
- .fee(XrpCurrencyAmount.ofDrops(12))
- .nfTokenId(id)
- .sequence(UnsignedInteger.valueOf(12))
- .amount(XrpCurrencyAmount.ofDrops(2000L))
- .signingPublicKey(
- PublicKey.fromBase16EncodedPublicKey("02356E89059A75438887F9FEE2056A2890DB82A68353BE9C0C0C8F89C0018B37FC")
- )
- .networkId(NetworkId.of(1024))
- .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" +
- "}";
-
- 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..662baeb6c 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
@@ -127,38 +127,4 @@ public void testMinimalNfTokenMintWithUriJson() throws JsonProcessingException,
assertCanSerializeAndDeserialize(nfTokenMint, 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" +
- "}";
-
- assertCanSerializeAndDeserialize(nfTokenMint, 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
index 0d3ef0c9d..6f7ec73b8 100644
--- 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
@@ -114,34 +114,6 @@ public void testOfferCancelJsonWithNonZeroFlags() throws JsonProcessingException
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()
@@ -206,38 +178,4 @@ public void testOfferCreateJsonWithFlags() throws JsonProcessingException, JSONE
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/PaymentChannelJsonTests.java b/xrpl4j-core/src/test/java/org/xrpl/xrpl4j/model/transactions/json/PaymentChannelJsonTests.java
index 251e65df8..c0541fd10 100644
--- 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
@@ -153,46 +153,6 @@ public void testPaymentChannelCreateJsonWithNonZeroFlags() throws JsonProcessing
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()
@@ -263,43 +223,6 @@ public void testPaymentChannelClaimJsonWithFlags() throws JsonProcessingExceptio
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()
@@ -389,36 +312,4 @@ public void testPaymentChannelFundJsonWithNonZeroFlags() throws JsonProcessingEx
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..a5713e920 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
@@ -157,36 +157,4 @@ public void testComplicatedJson() throws JsonProcessingException, JSONException
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);
- }
}
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..54b8e5cd5 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
@@ -111,32 +111,4 @@ public void testSetRegularKeyJsonWithNonZeroFlags() throws JsonProcessingExcepti
assertCanSerializeAndDeserialize(setRegularKey, json);
}
-
- @Test
- public void testJsonWithUnknownFields() 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")
- )
- .networkId(NetworkId.of(1024))
- .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" +
- "}";
-
- assertCanSerializeAndDeserialize(setRegularKey, 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..749f60883 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
@@ -177,34 +177,4 @@ public void testSignerListSetJsonWithNonZeroFlags() throws JsonProcessingExcepti
assertCanSerializeAndDeserialize(signerListSet, 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());
-
- assertCanSerializeAndDeserialize(signerListSet, 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..23403cc91 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
@@ -111,32 +111,4 @@ void testJsonWithNonZeroFlags() throws JSONException, JsonProcessingException {
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" +
- "}";
-
- assertCanSerializeAndDeserialize(ticketCreate, 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..157d93be4 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
@@ -144,44 +144,4 @@ public void testTrustSetWithQualityJson() throws JsonProcessingException, JSONEx
assertCanSerializeAndDeserialize(trustSet, json);
}
-
- @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" +
- " \"currency\": \"USD\",\n" +
- " \"issuer\": \"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\n" +
- " \"value\": \"100\"\n" +
- " },\n" +
- " \"NetworkID\": 1024,\n" +
- " \"Sequence\": 12\n" +
- "}";
-
- assertCanSerializeAndDeserialize(trustSet, 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 3226642b2..3b9646413 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,15 +20,12 @@
* =========================LICENSE_END==================================
*/
-import static org.assertj.core.api.Assertions.assertThat;
-
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.model.AbstractJsonTest;
import org.xrpl.xrpl4j.model.client.common.LedgerIndex;
-import org.xrpl.xrpl4j.model.transactions.Transaction;
import org.xrpl.xrpl4j.model.transactions.UnlModify;
import org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount;