mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-14 09:25:37 -04:00
Change network version to avoid connecting to bisq nodes (#275)
Co-authored-by: l0nelyc0w <coinrunner@danwin1210.me>
This commit is contained in:
parent
435051f204
commit
00765d7b32
70 changed files with 142 additions and 135 deletions
|
@ -51,7 +51,7 @@ public class PrivateNotificationMessage extends NetworkEnvelope implements Mailb
|
|||
private PrivateNotificationMessage(PrivateNotificationPayload privateNotificationPayload,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
super(messageVersion);
|
||||
this.privateNotificationPayload = privateNotificationPayload;
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -68,7 +68,7 @@ public class PrivateNotificationMessage extends NetworkEnvelope implements Mailb
|
|||
.build();
|
||||
}
|
||||
|
||||
public static PrivateNotificationMessage fromProto(protobuf.PrivateNotificationMessage proto, int messageVersion) {
|
||||
public static PrivateNotificationMessage fromProto(protobuf.PrivateNotificationMessage proto, String messageVersion) {
|
||||
return new PrivateNotificationMessage(PrivateNotificationPayload.fromProto(proto.getPrivateNotificationPayload()),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -39,7 +39,7 @@ public class GetInventoryRequest extends NetworkEnvelope {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private GetInventoryRequest(String version, int messageVersion) {
|
||||
private GetInventoryRequest(String version, String messageVersion) {
|
||||
super(messageVersion);
|
||||
|
||||
this.version = version;
|
||||
|
@ -53,7 +53,7 @@ public class GetInventoryRequest extends NetworkEnvelope {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static GetInventoryRequest fromProto(protobuf.GetInventoryRequest proto, int messageVersion) {
|
||||
public static GetInventoryRequest fromProto(protobuf.GetInventoryRequest proto, String messageVersion) {
|
||||
return new GetInventoryRequest(proto.getVersion(), messageVersion);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class GetInventoryResponse extends NetworkEnvelope {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private GetInventoryResponse(Map<InventoryItem, String> inventory, int messageVersion) {
|
||||
private GetInventoryResponse(Map<InventoryItem, String> inventory, String messageVersion) {
|
||||
super(messageVersion);
|
||||
|
||||
this.inventory = inventory;
|
||||
|
@ -63,7 +63,7 @@ public class GetInventoryResponse extends NetworkEnvelope {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static GetInventoryResponse fromProto(protobuf.GetInventoryResponse proto, int messageVersion) {
|
||||
public static GetInventoryResponse fromProto(protobuf.GetInventoryResponse proto, String messageVersion) {
|
||||
// For protobuf we use a map with a string key
|
||||
Map<String, String> map = proto.getInventoryMap();
|
||||
Map<InventoryItem, String> inventory = new HashMap<>();
|
||||
|
|
|
@ -71,7 +71,7 @@ public final class OfferAvailabilityRequest extends OfferMessage implements Supp
|
|||
long takersTradePrice,
|
||||
boolean isTakerApiUser,
|
||||
@Nullable Capabilities supportedCapabilities,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
@Nullable String uid,
|
||||
InitTradeRequest tradeRequest) {
|
||||
super(messageVersion, offerId, uid);
|
||||
|
@ -81,7 +81,7 @@ public final class OfferAvailabilityRequest extends OfferMessage implements Supp
|
|||
this.supportedCapabilities = supportedCapabilities;
|
||||
this.tradeRequest = tradeRequest;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public protobuf.Offer toProtoMessage() {
|
||||
// return protobuf.Offer.newBuilder().setOfferPayload(offerPayload.toProtoMessage().getOfferPayload()).build();
|
||||
|
@ -108,7 +108,7 @@ public final class OfferAvailabilityRequest extends OfferMessage implements Supp
|
|||
.build();
|
||||
}
|
||||
|
||||
public static OfferAvailabilityRequest fromProto(protobuf.OfferAvailabilityRequest proto, CoreProtoResolver coreProtoResolver, int messageVersion) {
|
||||
public static OfferAvailabilityRequest fromProto(protobuf.OfferAvailabilityRequest proto, CoreProtoResolver coreProtoResolver, String messageVersion) {
|
||||
return new OfferAvailabilityRequest(proto.getOfferId(),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
proto.getTakersTradePrice(),
|
||||
|
|
|
@ -69,7 +69,7 @@ public final class OfferAvailabilityResponse extends OfferMessage implements Sup
|
|||
private OfferAvailabilityResponse(String offerId,
|
||||
AvailabilityResult availabilityResult,
|
||||
@Nullable Capabilities supportedCapabilities,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
@Nullable String uid,
|
||||
String makerSignature,
|
||||
NodeAddress arbitratorNodeAddress) {
|
||||
|
@ -96,7 +96,7 @@ public final class OfferAvailabilityResponse extends OfferMessage implements Sup
|
|||
.build();
|
||||
}
|
||||
|
||||
public static OfferAvailabilityResponse fromProto(protobuf.OfferAvailabilityResponse proto, int messageVersion) {
|
||||
public static OfferAvailabilityResponse fromProto(protobuf.OfferAvailabilityResponse proto, String messageVersion) {
|
||||
return new OfferAvailabilityResponse(proto.getOfferId(),
|
||||
ProtoUtil.enumFromProto(AvailabilityResult.class, proto.getAvailabilityResult().name()),
|
||||
Capabilities.fromIntList(proto.getSupportedCapabilitiesList()),
|
||||
|
|
|
@ -38,7 +38,7 @@ public abstract class OfferMessage extends NetworkEnvelope implements DirectMess
|
|||
@Nullable
|
||||
protected final String uid;
|
||||
|
||||
protected OfferMessage(int messageVersion, String offerId, @Nullable String uid) {
|
||||
protected OfferMessage(String messageVersion, String offerId, @Nullable String uid) {
|
||||
super(messageVersion);
|
||||
this.offerId = offerId;
|
||||
this.uid = uid;
|
||||
|
|
|
@ -46,7 +46,7 @@ public final class SignOfferRequest extends OfferMessage implements DirectMessag
|
|||
String senderAccountId,
|
||||
OfferPayload offerPayload,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String reserveTxHash,
|
||||
String reserveTxHex,
|
||||
|
@ -91,7 +91,7 @@ public final class SignOfferRequest extends OfferMessage implements DirectMessag
|
|||
}
|
||||
|
||||
public static SignOfferRequest fromProto(protobuf.SignOfferRequest proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new SignOfferRequest(proto.getOfferId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -29,7 +29,7 @@ public final class SignOfferResponse extends OfferMessage implements DirectMessa
|
|||
|
||||
public SignOfferResponse(String offerId,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
OfferPayload signedOfferPayload) {
|
||||
super(messageVersion, offerId, uid);
|
||||
this.signedOfferPayload = signedOfferPayload;
|
||||
|
@ -51,7 +51,7 @@ public final class SignOfferResponse extends OfferMessage implements DirectMessa
|
|||
}
|
||||
|
||||
public static SignOfferResponse fromProto(protobuf.SignOfferResponse proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new SignOfferResponse(proto.getOfferId(),
|
||||
proto.getUid(),
|
||||
messageVersion,
|
||||
|
|
|
@ -106,7 +106,7 @@ public class CoreNetworkProtoResolver extends CoreProtoResolver implements Netwo
|
|||
@Override
|
||||
public NetworkEnvelope fromProto(protobuf.NetworkEnvelope proto) throws ProtobufferException {
|
||||
if (proto != null) {
|
||||
final int messageVersion = proto.getMessageVersion();
|
||||
final String messageVersion = proto.getMessageVersion();
|
||||
switch (proto.getMessageCase()) {
|
||||
case PRELIMINARY_GET_DATA_REQUEST:
|
||||
return PreliminaryGetDataRequest.fromProto(proto.getPreliminaryGetDataRequest(), messageVersion);
|
||||
|
|
|
@ -21,7 +21,7 @@ import bisq.core.support.SupportType;
|
|||
import bisq.core.support.dispute.messages.DisputeMessage;
|
||||
|
||||
abstract class ArbitrationMessage extends DisputeMessage {
|
||||
ArbitrationMessage(int messageVersion, String uid, SupportType supportType) {
|
||||
ArbitrationMessage(String messageVersion, String uid, SupportType supportType) {
|
||||
super(messageVersion, uid, supportType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class PeerPublishedDisputePayoutTxMessage extends ArbitrationMessag
|
|||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType) {
|
||||
super(messageVersion, uid, supportType);
|
||||
this.updatedMultisigHex = updatedMultisigHex;
|
||||
|
@ -82,7 +82,7 @@ public final class PeerPublishedDisputePayoutTxMessage extends ArbitrationMessag
|
|||
}
|
||||
|
||||
public static PeerPublishedDisputePayoutTxMessage fromProto(protobuf.PeerPublishedDisputePayoutTxMessage proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new PeerPublishedDisputePayoutTxMessage(proto.getUpdatedMultisigHex(),
|
||||
proto.getPayoutTxHex(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class ArbitratorPayoutTxRequest extends DisputeMessage {
|
|||
private ArbitratorPayoutTxRequest(Dispute dispute,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType,
|
||||
String updatedMultisigHex) {
|
||||
super(messageVersion, uid, supportType);
|
||||
|
@ -79,7 +79,7 @@ public final class ArbitratorPayoutTxRequest extends DisputeMessage {
|
|||
|
||||
public static ArbitratorPayoutTxRequest fromProto(protobuf.ArbitratorPayoutTxRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new ArbitratorPayoutTxRequest(Dispute.fromProto(proto.getDispute(), coreProtoResolver),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class ArbitratorPayoutTxResponse extends DisputeMessage {
|
|||
private ArbitratorPayoutTxResponse(String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType,
|
||||
String arbitratorSignedPayoutTxHex) {
|
||||
super(messageVersion, uid, supportType);
|
||||
|
@ -78,7 +78,7 @@ public final class ArbitratorPayoutTxResponse extends DisputeMessage {
|
|||
|
||||
public static ArbitratorPayoutTxResponse fromProto(protobuf.ArbitratorPayoutTxResponse proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new ArbitratorPayoutTxResponse(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
|
|||
public abstract class DisputeMessage extends SupportMessage {
|
||||
public static final long TTL = TimeUnit.DAYS.toMillis(15);
|
||||
|
||||
public DisputeMessage(int messageVersion, String uid, SupportType supportType) {
|
||||
public DisputeMessage(String messageVersion, String uid, SupportType supportType) {
|
||||
super(messageVersion, uid, supportType);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public final class DisputeResultMessage extends DisputeMessage {
|
|||
private DisputeResultMessage(DisputeResult disputeResult,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType) {
|
||||
super(messageVersion, uid, supportType);
|
||||
this.disputeResult = disputeResult;
|
||||
|
@ -72,7 +72,7 @@ public final class DisputeResultMessage extends DisputeMessage {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static DisputeResultMessage fromProto(protobuf.DisputeResultMessage proto, int messageVersion) {
|
||||
public static DisputeResultMessage fromProto(protobuf.DisputeResultMessage proto, String messageVersion) {
|
||||
checkArgument(proto.hasDisputeResult(), "DisputeResult must be set");
|
||||
return new DisputeResultMessage(DisputeResult.fromProto(proto.getDisputeResult()),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class OpenNewDisputeMessage extends DisputeMessage {
|
|||
private OpenNewDisputeMessage(Dispute dispute,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType,
|
||||
String updatedMultisigHex) {
|
||||
super(messageVersion, uid, supportType);
|
||||
|
@ -79,7 +79,7 @@ public final class OpenNewDisputeMessage extends DisputeMessage {
|
|||
|
||||
public static OpenNewDisputeMessage fromProto(protobuf.OpenNewDisputeMessage proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new OpenNewDisputeMessage(Dispute.fromProto(proto.getDispute(), coreProtoResolver),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -53,7 +53,7 @@ public final class PeerOpenedDisputeMessage extends DisputeMessage {
|
|||
private PeerOpenedDisputeMessage(Dispute dispute,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
SupportType supportType) {
|
||||
super(messageVersion, uid, supportType);
|
||||
this.dispute = dispute;
|
||||
|
@ -71,7 +71,7 @@ public final class PeerOpenedDisputeMessage extends DisputeMessage {
|
|||
.build();
|
||||
}
|
||||
|
||||
public static PeerOpenedDisputeMessage fromProto(protobuf.PeerOpenedDisputeMessage proto, CoreProtoResolver coreProtoResolver, int messageVersion) {
|
||||
public static PeerOpenedDisputeMessage fromProto(protobuf.PeerOpenedDisputeMessage proto, CoreProtoResolver coreProtoResolver, String messageVersion) {
|
||||
return new PeerOpenedDisputeMessage(Dispute.fromProto(proto.getDispute(), coreProtoResolver),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
proto.getUid(),
|
||||
|
|
|
@ -183,7 +183,7 @@ public final class ChatMessage extends SupportMessage {
|
|||
boolean arrived,
|
||||
boolean storedInMailbox,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
boolean acknowledged,
|
||||
@Nullable String sendMessageError,
|
||||
@Nullable String ackError,
|
||||
|
@ -238,7 +238,7 @@ public final class ChatMessage extends SupportMessage {
|
|||
|
||||
// The protobuf definition ChatMessage cannot be changed as it would break backward compatibility.
|
||||
public static ChatMessage fromProto(protobuf.ChatMessage proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
// If we get a msg from an old client type will be ordinal 0 which is the dispute entry and as we only added
|
||||
// the trade case it is the desired behaviour.
|
||||
final ChatMessage chatMessage = new ChatMessage(
|
||||
|
@ -267,7 +267,7 @@ public final class ChatMessage extends SupportMessage {
|
|||
// We don't check the message version here as it was checked in the carrier envelope already (in connection class)
|
||||
// Payloads don't have a message version and are also used for persistence
|
||||
// We set the value to -1 to indicate it is set but irrelevant
|
||||
return fromProto(proto, -1);
|
||||
return fromProto(proto, "-1");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class SupportMessage extends NetworkEnvelope implements MailboxM
|
|||
// Added with v1.1.6. Old clients will not have set that field and we fall back to entry 0 which is ARBITRATION.
|
||||
protected final SupportType supportType;
|
||||
|
||||
public SupportMessage(int messageVersion, String uid, SupportType supportType) {
|
||||
public SupportMessage(String messageVersion, String uid, SupportType supportType) {
|
||||
super(messageVersion);
|
||||
this.uid = uid;
|
||||
this.supportType = supportType;
|
||||
|
|
|
@ -72,7 +72,7 @@ public final class CounterCurrencyTransferStartedMessage extends TradeMailboxMes
|
|||
@Nullable String counterCurrencyTxId,
|
||||
@Nullable String counterCurrencyExtraData,
|
||||
String uid,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
this.buyerPayoutAddress = buyerPayoutAddress;
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -97,7 +97,7 @@ public final class CounterCurrencyTransferStartedMessage extends TradeMailboxMes
|
|||
}
|
||||
|
||||
public static CounterCurrencyTransferStartedMessage fromProto(protobuf.CounterCurrencyTransferStartedMessage proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new CounterCurrencyTransferStartedMessage(proto.getTradeId(),
|
||||
proto.getBuyerPayoutAddress(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class DelayedPayoutTxSignatureRequest extends TradeMessage implemen
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private DelayedPayoutTxSignatureRequest(int messageVersion,
|
||||
private DelayedPayoutTxSignatureRequest(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
|
@ -78,7 +78,7 @@ public final class DelayedPayoutTxSignatureRequest extends TradeMessage implemen
|
|||
}
|
||||
|
||||
public static DelayedPayoutTxSignatureRequest fromProto(protobuf.DelayedPayoutTxSignatureRequest proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new DelayedPayoutTxSignatureRequest(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class DelayedPayoutTxSignatureResponse extends TradeMessage impleme
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private DelayedPayoutTxSignatureResponse(int messageVersion,
|
||||
private DelayedPayoutTxSignatureResponse(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
|
@ -79,7 +79,7 @@ public final class DelayedPayoutTxSignatureResponse extends TradeMessage impleme
|
|||
}
|
||||
|
||||
public static DelayedPayoutTxSignatureResponse fromProto(protobuf.DelayedPayoutTxSignatureResponse proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new DelayedPayoutTxSignatureResponse(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class DepositRequest extends TradeMessage implements DirectMessage
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String contractSignature,
|
||||
String depositTxHex,
|
||||
|
@ -77,7 +77,7 @@ public final class DepositRequest extends TradeMessage implements DirectMessage
|
|||
|
||||
public static DepositRequest fromProto(protobuf.DepositRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new DepositRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -38,7 +38,7 @@ public final class DepositResponse extends TradeMessage implements DirectMessage
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -65,7 +65,7 @@ public final class DepositResponse extends TradeMessage implements DirectMessage
|
|||
|
||||
public static DepositResponse fromProto(protobuf.DepositResponse proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new DepositResponse(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -53,7 +53,7 @@ public final class DepositTxAndDelayedPayoutTxMessage extends TradeMailboxMessag
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private DepositTxAndDelayedPayoutTxMessage(int messageVersion,
|
||||
private DepositTxAndDelayedPayoutTxMessage(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
|
@ -78,7 +78,7 @@ public final class DepositTxAndDelayedPayoutTxMessage extends TradeMailboxMessag
|
|||
}
|
||||
|
||||
public static DepositTxAndDelayedPayoutTxMessage fromProto(protobuf.DepositTxAndDelayedPayoutTxMessage proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new DepositTxAndDelayedPayoutTxMessage(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -67,7 +67,7 @@ public final class DepositTxMessage extends TradeMessage implements DirectMessag
|
|||
return getNetworkEnvelopeBuilder().setDepositTxMessage(builder).build();
|
||||
}
|
||||
|
||||
public static DepositTxMessage fromProto(protobuf.DepositTxMessage proto, int messageVersion) {
|
||||
public static DepositTxMessage fromProto(protobuf.DepositTxMessage proto, String messageVersion) {
|
||||
return new DepositTxMessage(proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -47,7 +47,7 @@ public final class InitMultisigRequest extends TradeMessage implements DirectMes
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String preparedMultisigHex,
|
||||
String madeMultisigHex) {
|
||||
|
@ -82,7 +82,7 @@ public final class InitMultisigRequest extends TradeMessage implements DirectMes
|
|||
|
||||
public static InitMultisigRequest fromProto(protobuf.InitMultisigRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new InitMultisigRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -78,7 +78,7 @@ public final class InitTradeRequest extends TradeMessage implements DirectMessag
|
|||
String paymentAccountId,
|
||||
String paymentMethodId,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
@Nullable byte[] accountAgeWitnessSignatureOfOfferId,
|
||||
long currentDate,
|
||||
NodeAddress makerNodeAddress,
|
||||
|
@ -145,7 +145,7 @@ public final class InitTradeRequest extends TradeMessage implements DirectMessag
|
|||
|
||||
public static InitTradeRequest fromProto(protobuf.InitTradeRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new InitTradeRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -90,7 +90,7 @@ public final class InputsForDepositTxRequest extends TradeMessage implements Dir
|
|||
NodeAddress mediatorNodeAddress,
|
||||
NodeAddress refundAgentNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
byte[] accountAgeWitnessSignatureOfOfferId,
|
||||
long currentDate) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
|
@ -160,7 +160,7 @@ public final class InputsForDepositTxRequest extends TradeMessage implements Dir
|
|||
|
||||
public static InputsForDepositTxRequest fromProto(protobuf.InputsForDepositTxRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
List<RawTransactionInput> rawTransactionInputs = proto.getRawTransactionInputsList().stream()
|
||||
.map(rawTransactionInput -> new RawTransactionInput(rawTransactionInput.getIndex(),
|
||||
rawTransactionInput.getParentTransaction().toByteArray(), rawTransactionInput.getValue()))
|
||||
|
|
|
@ -106,7 +106,7 @@ public final class InputsForDepositTxResponse extends TradeMessage implements Di
|
|||
List<RawTransactionInput> makerInputs,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
@Nullable byte[] accountAgeWitnessSignatureOfPreparedDepositTx,
|
||||
long currentDate,
|
||||
long lockTime) {
|
||||
|
@ -149,7 +149,7 @@ public final class InputsForDepositTxResponse extends TradeMessage implements Di
|
|||
.build();
|
||||
}
|
||||
|
||||
public static InputsForDepositTxResponse fromProto(protobuf.InputsForDepositTxResponse proto, CoreProtoResolver coreProtoResolver, int messageVersion) {
|
||||
public static InputsForDepositTxResponse fromProto(protobuf.InputsForDepositTxResponse proto, CoreProtoResolver coreProtoResolver, String messageVersion) {
|
||||
List<RawTransactionInput> makerInputs = proto.getMakerInputsList().stream()
|
||||
.map(RawTransactionInput::fromProto)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -54,7 +54,7 @@ public final class MediatedPayoutTxPublishedMessage extends TradeMailboxMessage
|
|||
byte[] payoutTx,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
this.payoutTx = payoutTx;
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -71,7 +71,7 @@ public final class MediatedPayoutTxPublishedMessage extends TradeMailboxMessage
|
|||
.build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(protobuf.MediatedPayoutTxPublishedMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.MediatedPayoutTxPublishedMessage proto, String messageVersion) {
|
||||
return new MediatedPayoutTxPublishedMessage(proto.getTradeId(),
|
||||
proto.getPayoutTx().toByteArray(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -55,7 +55,7 @@ public class MediatedPayoutTxSignatureMessage extends TradeMailboxMessage {
|
|||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
String uid,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
this.txSignature = txSignature;
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -73,7 +73,7 @@ public class MediatedPayoutTxSignatureMessage extends TradeMailboxMessage {
|
|||
}
|
||||
|
||||
public static MediatedPayoutTxSignatureMessage fromProto(protobuf.MediatedPayoutTxSignatureMessage proto,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new MediatedPayoutTxSignatureMessage(proto.getTxSignature().toByteArray(),
|
||||
proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
|
|
|
@ -40,7 +40,7 @@ public final class PaymentAccountPayloadRequest extends TradeMessage implements
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
|
@ -70,7 +70,7 @@ public final class PaymentAccountPayloadRequest extends TradeMessage implements
|
|||
|
||||
public static PaymentAccountPayloadRequest fromProto(protobuf.PaymentAccountPayloadRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new PaymentAccountPayloadRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -66,7 +66,7 @@ public final class PayoutTxPublishedMessage extends TradeMailboxMessage {
|
|||
NodeAddress senderNodeAddress,
|
||||
@Nullable SignedWitness signedWitness,
|
||||
String uid,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
this.signedMultisigTxHex = signedMultisigTxHex;
|
||||
this.senderNodeAddress = senderNodeAddress;
|
||||
|
@ -84,7 +84,7 @@ public final class PayoutTxPublishedMessage extends TradeMailboxMessage {
|
|||
return getNetworkEnvelopeBuilder().setPayoutTxPublishedMessage(builder).build();
|
||||
}
|
||||
|
||||
public static NetworkEnvelope fromProto(protobuf.PayoutTxPublishedMessage proto, int messageVersion) {
|
||||
public static NetworkEnvelope fromProto(protobuf.PayoutTxPublishedMessage proto, String messageVersion) {
|
||||
// There is no method to check for a nullable non-primitive data type object but we know that all fields
|
||||
// are empty/null, so we check for the signature to see if we got a valid signedWitness.
|
||||
protobuf.SignedWitness protoSignedWitness = proto.getSignedWitness();
|
||||
|
|
|
@ -43,7 +43,7 @@ public final class PeerPublishedDelayedPayoutTxMessage extends TradeMailboxMessa
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private PeerPublishedDelayedPayoutTxMessage(int messageVersion,
|
||||
private PeerPublishedDelayedPayoutTxMessage(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress) {
|
||||
|
@ -60,7 +60,7 @@ public final class PeerPublishedDelayedPayoutTxMessage extends TradeMailboxMessa
|
|||
return getNetworkEnvelopeBuilder().setPeerPublishedDelayedPayoutTxMessage(builder).build();
|
||||
}
|
||||
|
||||
public static PeerPublishedDelayedPayoutTxMessage fromProto(protobuf.PeerPublishedDelayedPayoutTxMessage proto, int messageVersion) {
|
||||
public static PeerPublishedDelayedPayoutTxMessage fromProto(protobuf.PeerPublishedDelayedPayoutTxMessage proto, String messageVersion) {
|
||||
return new PeerPublishedDelayedPayoutTxMessage(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RefreshTradeStateRequest extends TradeMailboxMessage {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private RefreshTradeStateRequest(int messageVersion,
|
||||
private RefreshTradeStateRequest(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress) {
|
||||
|
@ -56,7 +56,7 @@ public class RefreshTradeStateRequest extends TradeMailboxMessage {
|
|||
return getNetworkEnvelopeBuilder().setRefreshTradeStateRequest(builder).build();
|
||||
}
|
||||
|
||||
public static RefreshTradeStateRequest fromProto(protobuf.RefreshTradeStateRequest proto, int messageVersion) {
|
||||
public static RefreshTradeStateRequest fromProto(protobuf.RefreshTradeStateRequest proto, String messageVersion) {
|
||||
return new RefreshTradeStateRequest(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -42,7 +42,7 @@ public final class SignContractRequest extends TradeMessage implements DirectMes
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String accountId,
|
||||
byte[] paymentAccountPayloadHash,
|
||||
|
@ -82,7 +82,7 @@ public final class SignContractRequest extends TradeMessage implements DirectMes
|
|||
|
||||
public static SignContractRequest fromProto(protobuf.SignContractRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new SignContractRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class SignContractResponse extends TradeMessage implements DirectMe
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String contractSignature) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
|
@ -76,7 +76,7 @@ public final class SignContractResponse extends TradeMessage implements DirectMe
|
|||
|
||||
public static SignContractResponse fromProto(protobuf.SignContractResponse proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new SignContractResponse(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -29,7 +29,7 @@ import lombok.ToString;
|
|||
public abstract class TradeMailboxMessage extends TradeMessage implements MailboxMessage {
|
||||
public static final long TTL = TimeUnit.DAYS.toMillis(15);
|
||||
|
||||
protected TradeMailboxMessage(int messageVersion, String tradeId, String uid) {
|
||||
protected TradeMailboxMessage(String messageVersion, String tradeId, String uid) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public abstract class TradeMessage extends NetworkEnvelope implements UidMessage
|
|||
protected final String tradeId;
|
||||
protected final String uid;
|
||||
|
||||
protected TradeMessage(int messageVersion, String tradeId, String uid) {
|
||||
protected TradeMessage(String messageVersion, String tradeId, String uid) {
|
||||
super(messageVersion);
|
||||
this.tradeId = tradeId;
|
||||
this.uid = uid;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class TraderSignedWitnessMessage extends TradeMailboxMessage {
|
|||
// PROTO BUFFER
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private TraderSignedWitnessMessage(int messageVersion,
|
||||
private TraderSignedWitnessMessage(String messageVersion,
|
||||
String uid,
|
||||
String tradeId,
|
||||
NodeAddress senderNodeAddress,
|
||||
|
@ -73,7 +73,7 @@ public class TraderSignedWitnessMessage extends TradeMailboxMessage {
|
|||
return getNetworkEnvelopeBuilder().setTraderSignedWitnessMessage(builder).build();
|
||||
}
|
||||
|
||||
public static TraderSignedWitnessMessage fromProto(protobuf.TraderSignedWitnessMessage proto, int messageVersion) {
|
||||
public static TraderSignedWitnessMessage fromProto(protobuf.TraderSignedWitnessMessage proto, String messageVersion) {
|
||||
return new TraderSignedWitnessMessage(messageVersion,
|
||||
proto.getUid(),
|
||||
proto.getTradeId(),
|
||||
|
|
|
@ -45,7 +45,7 @@ public final class UpdateMultisigRequest extends TradeMessage implements DirectM
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String updatedMultisigHex) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
|
@ -77,7 +77,7 @@ public final class UpdateMultisigRequest extends TradeMessage implements DirectM
|
|||
|
||||
public static UpdateMultisigRequest fromProto(protobuf.UpdateMultisigRequest proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new UpdateMultisigRequest(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
|
@ -45,7 +45,7 @@ public final class UpdateMultisigResponse extends TradeMessage implements Direct
|
|||
NodeAddress senderNodeAddress,
|
||||
PubKeyRing pubKeyRing,
|
||||
String uid,
|
||||
int messageVersion,
|
||||
String messageVersion,
|
||||
long currentDate,
|
||||
String updatedMultisigHex) {
|
||||
super(messageVersion, tradeId, uid);
|
||||
|
@ -77,7 +77,7 @@ public final class UpdateMultisigResponse extends TradeMessage implements Direct
|
|||
|
||||
public static UpdateMultisigResponse fromProto(protobuf.UpdateMultisigResponse proto,
|
||||
CoreProtoResolver coreProtoResolver,
|
||||
int messageVersion) {
|
||||
String messageVersion) {
|
||||
return new UpdateMultisigResponse(proto.getTradeId(),
|
||||
NodeAddress.fromProto(proto.getSenderNodeAddress()),
|
||||
PubKeyRing.fromProto(proto.getPubKeyRing()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue