mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Move protobuf OfferPayload.Direction to OfferDirection
This commit is contained in:
parent
14765d6caa
commit
611b944609
@ -35,7 +35,7 @@ import org.junit.jupiter.api.TestMethodOrder;
|
||||
import static bisq.apitest.config.ApiTestConfig.BSQ;
|
||||
import static bisq.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
|
@ -40,8 +40,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
|
@ -36,8 +36,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
|
@ -52,8 +52,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
@Disabled
|
||||
|
@ -47,8 +47,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
@Disabled
|
||||
|
@ -35,7 +35,7 @@ import static bisq.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAs
|
||||
import static java.lang.String.format;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
|
@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.Offer.State.OFFER_FEE_PAID;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
|
||||
|
||||
|
@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.Offer.State.OFFER_FEE_PAID;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||
|
||||
@Disabled
|
||||
|
@ -62,7 +62,7 @@ import static bisq.core.trade.model.bisq_v1.Trade.State.*;
|
||||
import static java.lang.String.format;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static protobuf.Offer.State.OFFER_FEE_PAID;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.Offer.State.OFFER_FEE_PAID;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||
|
||||
@Disabled
|
||||
|
@ -35,8 +35,8 @@ import static bisq.cli.CurrencyFormat.formatPrice;
|
||||
import static bisq.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
|
||||
import static java.lang.System.getenv;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
|
||||
|
||||
|
@ -24,8 +24,8 @@ import java.util.function.Function;
|
||||
|
||||
import static bisq.cli.ColumnHeaderConstants.COL_HEADER_DIRECTION;
|
||||
import static java.lang.String.format;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
class DirectionFormat {
|
||||
|
||||
|
@ -38,8 +38,8 @@ import static bisq.proto.grpc.EditOfferRequest.EditType.MKT_PRICE_MARGIN_ONLY;
|
||||
import static bisq.proto.grpc.EditOfferRequest.EditType.TRIGGER_PRICE_ONLY;
|
||||
import static java.util.Comparator.comparing;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
import static protobuf.OfferPayload.Direction.BUY;
|
||||
import static protobuf.OfferPayload.Direction.SELL;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
|
||||
|
||||
|
@ -17,12 +17,11 @@
|
||||
|
||||
package bisq.core.util;
|
||||
|
||||
import bisq.core.offer.OfferDirection;
|
||||
import bisq.core.offer.OpenOffer;
|
||||
|
||||
import bisq.common.proto.ProtoUtil;
|
||||
|
||||
import protobuf.OfferPayload;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@ -34,10 +33,10 @@ public class ProtoUtilTest {
|
||||
//TODO Use NetworkProtoResolver, PersistenceProtoResolver or ProtoResolver which are all in bisq.common.
|
||||
@Test
|
||||
public void testEnum() {
|
||||
OfferPayload.Direction direction = OfferPayload.Direction.SELL;
|
||||
OfferPayload.Direction direction2 = OfferPayload.Direction.BUY;
|
||||
OfferPayload.Direction realDirection = getDirection(direction);
|
||||
OfferPayload.Direction realDirection2 = getDirection(direction2);
|
||||
OfferDirection direction = OfferDirection.SELL;
|
||||
OfferDirection direction2 = OfferDirection.BUY;
|
||||
OfferDirection realDirection = getDirection(direction);
|
||||
OfferDirection realDirection2 = getDirection(direction2);
|
||||
assertEquals("SELL", realDirection.name());
|
||||
assertEquals("BUY", realDirection2.name());
|
||||
}
|
||||
@ -63,7 +62,7 @@ public class ProtoUtilTest {
|
||||
}
|
||||
}
|
||||
|
||||
public static OfferPayload.Direction getDirection(OfferPayload.Direction direction) {
|
||||
return OfferPayload.Direction.valueOf(direction.name());
|
||||
public static OfferDirection getDirection(OfferDirection direction) {
|
||||
return OfferDirection.valueOf(direction.name());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user