From 880b21f36f180cac170ca3bbb50a592c03946e09 Mon Sep 17 00:00:00 2001 From: overcat <4catcode@gmail.com> Date: Fri, 28 Jul 2023 15:06:57 +0800 Subject: [PATCH] Remove unnecessary SerializedName --- .../requests/sorobanrpc/GetEventsRequest.java | 12 +----------- .../sorobanrpc/GetLedgerEntriesRequest.java | 2 -- .../sorobanrpc/GetTransactionRequest.java | 2 -- .../sorobanrpc/SendTransactionRequest.java | 2 -- .../sorobanrpc/SimulateTransactionRequest.java | 2 -- .../requests/sorobanrpc/SorobanRpcRequest.java | 3 --- .../sorobanrpc/GetEventsResponse.java | 13 ------------- .../sorobanrpc/GetHealthResponse.java | 2 -- .../sorobanrpc/GetLatestLedgerResponse.java | 4 ---- .../sorobanrpc/GetLedgerEntriesResponse.java | 4 ---- .../sorobanrpc/GetNetworkResponse.java | 4 ---- .../sorobanrpc/GetTransactionResponse.java | 18 ------------------ .../sorobanrpc/SendTransactionResponse.java | 13 ------------- .../SimulateTransactionResponse.java | 9 --------- .../sorobanrpc/SorobanRpcResponse.java | 6 ------ 15 files changed, 1 insertion(+), 95 deletions(-) diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetEventsRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetEventsRequest.java index 6647644b1..2ea0f22ac 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetEventsRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetEventsRequest.java @@ -1,6 +1,5 @@ package org.stellar.sdk.requests.sorobanrpc; -import com.google.gson.annotations.SerializedName; import java.util.Collection; import lombok.Builder; import lombok.NonNull; @@ -10,38 +9,29 @@ @Value @Builder public class GetEventsRequest { - @NonNull - @SerializedName("startLedger") - String startLedger; + @NonNull String startLedger; - @SerializedName("filters") @Singular("filter") Collection filters; - @SerializedName("pagination") PaginationOptions pagination; @Value @Builder public static class PaginationOptions { - @SerializedName("limit") Long limit; - @SerializedName("cursor") String cursor; } @Builder @Value public static class EventFilter { - @SerializedName("type") EventFilterType type; - @SerializedName("contractIds") Collection contractIds; @Singular("topic") - @SerializedName("topics") Collection> topics; } } diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetLedgerEntriesRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetLedgerEntriesRequest.java index 8447467e0..af25a8c46 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetLedgerEntriesRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetLedgerEntriesRequest.java @@ -1,6 +1,5 @@ package org.stellar.sdk.requests.sorobanrpc; -import com.google.gson.annotations.SerializedName; import java.util.Collection; import lombok.AllArgsConstructor; import lombok.Value; @@ -8,6 +7,5 @@ @AllArgsConstructor @Value public class GetLedgerEntriesRequest { - @SerializedName("keys") Collection keys; } diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetTransactionRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetTransactionRequest.java index 368a1b3d4..e361c8620 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetTransactionRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/GetTransactionRequest.java @@ -1,12 +1,10 @@ package org.stellar.sdk.requests.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @Value @AllArgsConstructor public class GetTransactionRequest { - @SerializedName("hash") String hash; } diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SendTransactionRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SendTransactionRequest.java index 48d26d1e6..de27d1187 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SendTransactionRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SendTransactionRequest.java @@ -1,12 +1,10 @@ package org.stellar.sdk.requests.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class SendTransactionRequest { - @SerializedName("transaction") String transaction; } diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SimulateTransactionRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SimulateTransactionRequest.java index e510d32e6..309a9132c 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SimulateTransactionRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SimulateTransactionRequest.java @@ -1,12 +1,10 @@ package org.stellar.sdk.requests.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class SimulateTransactionRequest { - @SerializedName("transaction") String transaction; } diff --git a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SorobanRpcRequest.java b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SorobanRpcRequest.java index 0fc256152..917e818ca 100644 --- a/src/main/java/org/stellar/sdk/requests/sorobanrpc/SorobanRpcRequest.java +++ b/src/main/java/org/stellar/sdk/requests/sorobanrpc/SorobanRpcRequest.java @@ -10,12 +10,9 @@ public class SorobanRpcRequest { @SerializedName("jsonrpc") String jsonRpc = "2.0"; - @SerializedName("id") String id; - @SerializedName("method") String method; - @SerializedName("params") T params; } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetEventsResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetEventsResponse.java index a6316a381..23ddd8c31 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetEventsResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetEventsResponse.java @@ -1,7 +1,6 @@ package org.stellar.sdk.responses.sorobanrpc; import com.google.common.collect.ImmutableList; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; import org.stellar.sdk.requests.sorobanrpc.EventFilterType; @@ -9,47 +8,35 @@ @AllArgsConstructor @Value public class GetEventsResponse { - @SerializedName("events") ImmutableList events; - @SerializedName("latestLedger") Long latestLedger; @AllArgsConstructor @Value public static class EventInfo { - @SerializedName("type") EventFilterType type; - @SerializedName("ledger") Integer ledger; - @SerializedName("ledgerClosedAt") String ledgerClosedAt; - @SerializedName("contractId") String contractId; - @SerializedName("id") String id; - @SerializedName("pagingToken") String pagingToken; - @SerializedName("topic") ImmutableList topic; - @SerializedName("value") EventInfoValue value; - @SerializedName("inSuccessfulContractCall") Boolean inSuccessfulContractCall; } @AllArgsConstructor @Value public static class EventInfoValue { - @SerializedName("xdr") String xdr; } } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetHealthResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetHealthResponse.java index 31049653f..aae761a27 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetHealthResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetHealthResponse.java @@ -1,12 +1,10 @@ package org.stellar.sdk.responses.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class GetHealthResponse { - @SerializedName("status") String status; } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLatestLedgerResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLatestLedgerResponse.java index 08176f280..824e8fadb 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLatestLedgerResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLatestLedgerResponse.java @@ -1,18 +1,14 @@ package org.stellar.sdk.responses.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class GetLatestLedgerResponse { - @SerializedName("id") String id; - @SerializedName("protocolVersion") Integer protocolVersion; - @SerializedName("sequence") Integer sequence; } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLedgerEntriesResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLedgerEntriesResponse.java index 6329c701c..5d2ed9d1b 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLedgerEntriesResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetLedgerEntriesResponse.java @@ -8,19 +8,15 @@ @AllArgsConstructor @Value public class GetLedgerEntriesResponse { - @SerializedName("entries") ImmutableList entries; - @SerializedName("latestLedger") Long latestLedger; @AllArgsConstructor @Value public static class LedgerEntryResult { - @SerializedName("key") String key; - @SerializedName("xdr") String xdr; @SerializedName("lastModifiedLedgerSeq") diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetNetworkResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetNetworkResponse.java index 98f7409c8..bf0684489 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetNetworkResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetNetworkResponse.java @@ -1,18 +1,14 @@ package org.stellar.sdk.responses.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class GetNetworkResponse { - @SerializedName("friendbotUrl") String friendbotUrl; - @SerializedName("passphrase") String passphrase; - @SerializedName("protocolVersion") Integer protocolVersion; } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetTransactionResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetTransactionResponse.java index 1be32ec5a..1a385daf9 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetTransactionResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/GetTransactionResponse.java @@ -1,56 +1,38 @@ package org.stellar.sdk.responses.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class GetTransactionResponse { - @SerializedName("status") GetTransactionStatus status; - @SerializedName("latestLedger") Long latestLedger; - @SerializedName("latestLedgerCloseTime") Long latestLedgerCloseTime; - @SerializedName("oldestLedger") Long oldestLedger; - @SerializedName("oldestLedgerCloseTime") Long oldestLedgerCloseTime; - @SerializedName("applicationOrder") Integer applicationOrder; - @SerializedName("feeBump") Boolean feeBump; - @SerializedName("envelopeXdr") String envelopeXdr; - @SerializedName("resultXdr") String resultXdr; - @SerializedName("resultMetaXdr") String resultMetaXdr; - @SerializedName("ledger") Long ledger; - @SerializedName("createdAt") Long createdAt; public enum GetTransactionStatus { - @SerializedName("NOT_FOUND") NOT_FOUND, - - @SerializedName("SUCCESS") SUCCESS, - - @SerializedName("FAILED") FAILED } } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SendTransactionResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SendTransactionResponse.java index 15ab1565c..7669377e2 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SendTransactionResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SendTransactionResponse.java @@ -1,38 +1,25 @@ package org.stellar.sdk.responses.sorobanrpc; -import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Value; @AllArgsConstructor @Value public class SendTransactionResponse { - @SerializedName("status") SendTransactionStatus status; - @SerializedName("errorResultXdr") String errorResultXdr; - @SerializedName("hash") String hash; - @SerializedName("latestLedger") Long latestLedger; - @SerializedName("latestLedgerCloseTime") Long latestLedgerCloseTime; public enum SendTransactionStatus { - @SerializedName("PENDING") PENDING, - - @SerializedName("DUPLICATE") DUPLICATE, - - @SerializedName("TRY_AGAIN_LATER") TRY_AGAIN_LATER, - - @SerializedName("ERROR") ERROR } } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SimulateTransactionResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SimulateTransactionResponse.java index bf1f8e1d3..ba739940b 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SimulateTransactionResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SimulateTransactionResponse.java @@ -9,34 +9,25 @@ @AllArgsConstructor @Value public class SimulateTransactionResponse { - @SerializedName("error") String error; - @SerializedName("transactionData") String transactionData; - @SerializedName("events") ImmutableList events; - @SerializedName("minResourceFee") Long minResourceFee; - @SerializedName("results") ImmutableList results; - @SerializedName("cost") SimulateTransactionCost cost; - @SerializedName("latestLedger") Long latestLedger; @AllArgsConstructor @Value public static class SimulateHostFunctionResult { - @SerializedName("auth") ImmutableList auth; - @SerializedName("xdr") String xdr; } diff --git a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SorobanRpcResponse.java b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SorobanRpcResponse.java index 3aaaca66f..e47986a49 100644 --- a/src/main/java/org/stellar/sdk/responses/sorobanrpc/SorobanRpcResponse.java +++ b/src/main/java/org/stellar/sdk/responses/sorobanrpc/SorobanRpcResponse.java @@ -12,25 +12,19 @@ public class SorobanRpcResponse extends Response { @SerializedName("jsonrpc") private final String jsonRpc; - @SerializedName("id") private final String id; - @SerializedName("result") private final T result; - @SerializedName("error") private final Error error; @AllArgsConstructor @Value public static class Error { - @SerializedName("code") Integer code; - @SerializedName("message") String message; - @SerializedName("data") String data; } }