Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky De/Serialization and Tests #4960

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
package org.knowm.xchange.bitfinex.v2.dto.account;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/** https://docs.bitfinex.com/reference#rest-auth-ledgers */
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({
"id",
"currency",
"placeHolder0",
"timestamp",
"placeHolder1",
"amount",
"balance",
"placeHolder2",
"description"
})
@Data
public class LedgerEntry {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,38 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Value;

/** https://docs.bitfinex.com/reference#rest-auth-movements */
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"ID",
"CURRENCY",
"CURRENCY_NAME",
"nullField1",
"nullField2",
"MTS_STARTED",
"MTS_UPDATED",
"nullField3",
"nullField4",
"STATUS",
"nullField5",
"nullField6",
"AMOUNT",
"FEES",
"nullField7",
"nullField8",
"DESTINATION_ADDRESS",
"nullField9",
"nullField10",
"nullField11",
"TRANSACTION_ID",
"nullField12"
})
@Value
public class Movement {
/* Movement identifier */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.account;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AccessLevel;
Expand All @@ -9,6 +10,16 @@

/** see https://docs.bitfinex.com/reference#rest-auth-transfer */
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({
"timestamp",
"type",
"messageId",
"placeHolder0",
"transfer",
"code",
"status",
"text"
})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class TransferBetweenWalletsResponse {
Expand Down Expand Up @@ -38,6 +49,16 @@ public Date getTimestamp() {
}

@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({
"timestamp",
"walletFrom",
"walletTo",
"placeHolder0",
"currency",
"currencyTo",
"placeHolder1",
"amount"
})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public static class Transfer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
package org.knowm.xchange.bitfinex.v2.dto.account;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.Value;

/** https://docs.bitfinex.com/reference#rest-auth-wallets */
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({
"walletType",
"currency",
"balance",
"unsettledInterest",
"availableBalance",
"lastChange",
"tradeDetails"
})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class Wallet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.time.Instant;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
Expand All @@ -12,6 +13,7 @@
* @author cyrus13 *
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"timestamp", "open", "close", "high", "low", "volume"})
@Jacksonized
@Data
@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand All @@ -10,6 +11,7 @@
* @see https://docs.bitfinex.com/reference#rest-public-book
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"rate", "period", "count", "amount"})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class BitfinexFundingOrder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand All @@ -11,6 +12,7 @@
* of R0)
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"id", "period", "rate", "amount"})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class BitfinexFundingRawOrder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.ToString;

@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"tradeId", "timestamp", "amount", "rate", "period"})
@Getter
@ToString
public class BitfinexPublicFundingTrade {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import org.knowm.xchange.dto.Order.OrderType;

@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"tradeId", "timestamp", "amount", "price"})
public class BitfinexPublicTrade {

private long tradeId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AccessLevel;
Expand All @@ -11,6 +12,7 @@
* @see https://docs.bitfinex.com/reference#rest-public-stats1
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"millisecondTimestamp", "value"})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class BitfinexStats {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -12,6 +13,25 @@
@NoArgsConstructor
@Getter
@ToString
@JsonPropertyOrder({
"symbol",
"frr",
"bid",
"bidPeriod",
"bidSize",
"ask",
"askPeriod",
"askSize",
"dailyChange",
"dailyChangePerc",
"lastPrice",
"volume",
"high",
"low",
"placeHolder0",
"placeHolder1",
"frrAmountAvailable"
})
public class BitfinexTickerFundingCurrency implements BitfinexTicker {

private String symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -12,6 +13,19 @@
@NoArgsConstructor
@Getter
@ToString
@JsonPropertyOrder({
"symbol",
"bid",
"bidSize",
"ask",
"askSize",
"dailyChange",
"dailyChangePerc",
"lastPrice",
"volume",
"high",
"low"
})
public class BitfinexTickerTraidingPair implements BitfinexTicker {

private String symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand All @@ -10,6 +11,7 @@
* @see https://docs.bitfinex.com/reference#rest-public-book
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"price", "count", "amount"})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class BitfinexTradingOrder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
Expand All @@ -11,6 +12,7 @@
* of R0)
*/
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({"orderId", "price", "amount"})
@Value
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
public class BitfinexTradingRawOrder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,40 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({
"symbol",
"timestamp",
"placeHolder0",
"derivPrice",
"spotPrice",
"placeHolder1",
"insuranceFundBalance",
"placeHolder2",
"nextFundingEvtTimestampMillis",
"nextFundingAccrued",
"nextFundingStep",
"placeHolder4",
"currentFunding",
"placeHolder5",
"placeHolder6",
"markPrice",
"placeHolder7",
"placeHolder8",
"openInterest",
"placeHolder9",
"placeHolder10",
"placeHolder11",
"clampMin",
"clampMax"
})
@Setter
@Getter
@ToString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.bitfinex.v2.dto.trade;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Getter;
Expand All @@ -9,6 +10,33 @@

/** https://docs.bitfinex.com/v2/reference#rest-auth-trades-hist */
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
@JsonPropertyOrder({
"id",
"gid",
"cid",
"symbol",
"timestampCreate",
"timestampUpdate",
"amount",
"amountOrig",
"type",
"typePrev",
"placeHolder0",
"placeHolder1",
"flags",
"orderStatus",
"placeHolder2",
"placeHolder3",
"price",
"priceAvg",
"priceTrailing",
"priceAuxLimit",
"placeHolder4",
"placeHolder5",
"placeHolder6",
"hidden",
"placedId"
})
@Setter
@Getter
@ToString
Expand Down
Loading