Move protobuf OfferPayload.Direction to OfferDirection

This commit is contained in:
chimp1984 2021-10-21 15:40:25 +02:00
parent 14765d6caa
commit 611b944609
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
15 changed files with 28 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
/**

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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());
}
}