From 14765d6caa56fe1460f22c0fa0c7d0002945c860 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Thu, 21 Oct 2021 15:36:21 +0200 Subject: [PATCH] Move protobuf OfferPayload.Direction to OfferDirection --- .../java/bisq/core/offer/OfferDirection.java | 6 +++--- proto/src/main/proto/pb.proto | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/bisq/core/offer/OfferDirection.java b/core/src/main/java/bisq/core/offer/OfferDirection.java index 02be95f50f..ade5334a88 100644 --- a/core/src/main/java/bisq/core/offer/OfferDirection.java +++ b/core/src/main/java/bisq/core/offer/OfferDirection.java @@ -23,11 +23,11 @@ public enum OfferDirection { BUY, SELL; - public static OfferDirection fromProto(protobuf.OfferPayload.Direction direction) { + public static OfferDirection fromProto(protobuf.OfferDirection direction) { return ProtoUtil.enumFromProto(OfferDirection.class, direction.name()); } - public static protobuf.OfferPayload.Direction toProtoMessage(OfferDirection direction) { - return protobuf.OfferPayload.Direction.valueOf(direction.name()); + public static protobuf.OfferDirection toProtoMessage(OfferDirection direction) { + return protobuf.OfferDirection.valueOf(direction.name()); } } diff --git a/proto/src/main/proto/pb.proto b/proto/src/main/proto/pb.proto index 673e3f57ab..d781a543bc 100644 --- a/proto/src/main/proto/pb.proto +++ b/proto/src/main/proto/pb.proto @@ -710,7 +710,7 @@ message Filter { message TradeStatistics2 { string base_currency = 1 [deprecated = true]; string counter_currency = 2 [deprecated = true]; - OfferPayload.Direction direction = 3 [deprecated = true]; + OfferDirection direction = 3 [deprecated = true]; int64 trade_price = 4 [deprecated = true]; int64 trade_amount = 5 [deprecated = true]; int64 trade_date = 6 [deprecated = true]; @@ -746,17 +746,11 @@ message MailboxStoragePayload { } message OfferPayload { - enum Direction { - PB_ERROR = 0; - BUY = 1; - SELL = 2; - } - string id = 1; int64 date = 2; NodeAddress owner_node_address = 3; PubKeyRing pub_key_ring = 4; - Direction direction = 5; + OfferDirection direction = 5; int64 price = 6; double market_price_margin = 7; bool use_market_based_price = 8; @@ -792,6 +786,12 @@ message OfferPayload { int32 protocol_version = 38; } +enum OfferDirection { + OFFER_DIRECTION_ERROR = 0; + BUY = 1; + SELL = 2; +} + message AccountAgeWitness { bytes hash = 1; int64 date = 2;