mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2024-10-01 01:35:42 -04:00
decrease trade step timeout for testnet
This commit is contained in:
parent
ca8cea8e82
commit
4ea5025393
6
dist/protobuf/pb_pb.d.ts
vendored
6
dist/protobuf/pb_pb.d.ts
vendored
@ -6158,6 +6158,11 @@ export class Trade extends jspb.Message {
|
|||||||
getIsCompleted(): boolean;
|
getIsCompleted(): boolean;
|
||||||
setIsCompleted(value: boolean): Trade;
|
setIsCompleted(value: boolean): Trade;
|
||||||
|
|
||||||
|
getImportedMultisigHexesList(): Array<string>;
|
||||||
|
setImportedMultisigHexesList(value: Array<string>): Trade;
|
||||||
|
clearImportedMultisigHexesList(): Trade;
|
||||||
|
addImportedMultisigHexes(value: string, index?: number): Trade;
|
||||||
|
|
||||||
serializeBinary(): Uint8Array;
|
serializeBinary(): Uint8Array;
|
||||||
toObject(includeInstance?: boolean): Trade.AsObject;
|
toObject(includeInstance?: boolean): Trade.AsObject;
|
||||||
static toObject(includeInstance: boolean, msg: Trade): Trade.AsObject;
|
static toObject(includeInstance: boolean, msg: Trade): Trade.AsObject;
|
||||||
@ -6196,6 +6201,7 @@ export namespace Trade {
|
|||||||
counterCurrencyExtraData: string,
|
counterCurrencyExtraData: string,
|
||||||
uid: string,
|
uid: string,
|
||||||
isCompleted: boolean,
|
isCompleted: boolean,
|
||||||
|
importedMultisigHexesList: Array<string>,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum State {
|
export enum State {
|
||||||
|
53
dist/protobuf/pb_pb.js
vendored
53
dist/protobuf/pb_pb.js
vendored
@ -49595,7 +49595,7 @@ proto.io.haveno.protobuffer.Tradable.prototype.hasArbitratorTrade = function() {
|
|||||||
* @private {!Array<number>}
|
* @private {!Array<number>}
|
||||||
* @const
|
* @const
|
||||||
*/
|
*/
|
||||||
proto.io.haveno.protobuffer.Trade.repeatedFields_ = [20];
|
proto.io.haveno.protobuffer.Trade.repeatedFields_ = [20,29];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -49656,7 +49656,8 @@ proto.io.haveno.protobuffer.Trade.toObject = function(includeInstance, msg) {
|
|||||||
refundResultState: jspb.Message.getFieldWithDefault(msg, 25, 0),
|
refundResultState: jspb.Message.getFieldWithDefault(msg, 25, 0),
|
||||||
counterCurrencyExtraData: jspb.Message.getFieldWithDefault(msg, 26, ""),
|
counterCurrencyExtraData: jspb.Message.getFieldWithDefault(msg, 26, ""),
|
||||||
uid: jspb.Message.getFieldWithDefault(msg, 27, ""),
|
uid: jspb.Message.getFieldWithDefault(msg, 27, ""),
|
||||||
isCompleted: jspb.Message.getBooleanFieldWithDefault(msg, 28, false)
|
isCompleted: jspb.Message.getBooleanFieldWithDefault(msg, 28, false),
|
||||||
|
importedMultisigHexesList: (f = jspb.Message.getRepeatedField(msg, 29)) == null ? undefined : f
|
||||||
};
|
};
|
||||||
|
|
||||||
if (includeInstance) {
|
if (includeInstance) {
|
||||||
@ -49812,6 +49813,10 @@ proto.io.haveno.protobuffer.Trade.deserializeBinaryFromReader = function(msg, re
|
|||||||
var value = /** @type {boolean} */ (reader.readBool());
|
var value = /** @type {boolean} */ (reader.readBool());
|
||||||
msg.setIsCompleted(value);
|
msg.setIsCompleted(value);
|
||||||
break;
|
break;
|
||||||
|
case 29:
|
||||||
|
var value = /** @type {string} */ (reader.readString());
|
||||||
|
msg.addImportedMultisigHexes(value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
reader.skipField();
|
reader.skipField();
|
||||||
break;
|
break;
|
||||||
@ -50044,6 +50049,13 @@ proto.io.haveno.protobuffer.Trade.serializeBinaryToWriter = function(message, wr
|
|||||||
f
|
f
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
f = message.getImportedMultisigHexesList();
|
||||||
|
if (f.length > 0) {
|
||||||
|
writer.writeRepeatedString(
|
||||||
|
29,
|
||||||
|
f
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -50797,6 +50809,43 @@ proto.io.haveno.protobuffer.Trade.prototype.setIsCompleted = function(value) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* repeated string imported_multisig_hexes = 29;
|
||||||
|
* @return {!Array<string>}
|
||||||
|
*/
|
||||||
|
proto.io.haveno.protobuffer.Trade.prototype.getImportedMultisigHexesList = function() {
|
||||||
|
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 29));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {!Array<string>} value
|
||||||
|
* @return {!proto.io.haveno.protobuffer.Trade} returns this
|
||||||
|
*/
|
||||||
|
proto.io.haveno.protobuffer.Trade.prototype.setImportedMultisigHexesList = function(value) {
|
||||||
|
return jspb.Message.setField(this, 29, value || []);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} value
|
||||||
|
* @param {number=} opt_index
|
||||||
|
* @return {!proto.io.haveno.protobuffer.Trade} returns this
|
||||||
|
*/
|
||||||
|
proto.io.haveno.protobuffer.Trade.prototype.addImportedMultisigHexes = function(value, opt_index) {
|
||||||
|
return jspb.Message.addToRepeatedField(this, 29, value, opt_index);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the list making it empty but non-null.
|
||||||
|
* @return {!proto.io.haveno.protobuffer.Trade} returns this
|
||||||
|
*/
|
||||||
|
proto.io.haveno.protobuffer.Trade.prototype.clearImportedMultisigHexesList = function() {
|
||||||
|
return this.setImportedMultisigHexesList([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
dist/protobuf/pb_pb.js.map
vendored
2
dist/protobuf/pb_pb.js.map
vendored
File diff suppressed because one or more lines are too long
@ -449,7 +449,7 @@ const TestConfig = {
|
|||||||
XMR_STAGENET: ["1aa111f817b7fdaaec1c8d5281a1837cc71c336db09b87cf23344a0a4e3bb2cb", "6b5a404eb5ff7154f2357126c84c3becfe2e7c59ca3844954ce9476bec2a6228", "fd4ef301a2e4faa3c77bc26393919895fa29b0908f2bbd51f6f6de3e46fb7a6e"],
|
XMR_STAGENET: ["1aa111f817b7fdaaec1c8d5281a1837cc71c336db09b87cf23344a0a4e3bb2cb", "6b5a404eb5ff7154f2357126c84c3becfe2e7c59ca3844954ce9476bec2a6228", "fd4ef301a2e4faa3c77bc26393919895fa29b0908f2bbd51f6f6de3e46fb7a6e"],
|
||||||
XMR_MAINNET: []
|
XMR_MAINNET: []
|
||||||
},
|
},
|
||||||
tradeStepTimeoutMs: 120000,
|
tradeStepTimeoutMs: getBaseCurrencyNetwork() === BaseCurrencyNetwork.XMR_LOCAL ? 45000 : 180000,
|
||||||
testTimeout: getBaseCurrencyNetwork() === BaseCurrencyNetwork.XMR_LOCAL ? 2400000 : 5400000, // timeout in ms for each test to complete (40 minutes for private network, 90 minutes for public network)
|
testTimeout: getBaseCurrencyNetwork() === BaseCurrencyNetwork.XMR_LOCAL ? 2400000 : 5400000, // timeout in ms for each test to complete (40 minutes for private network, 90 minutes for public network)
|
||||||
trade: new TradeContext(defaultTradeConfig)
|
trade: new TradeContext(defaultTradeConfig)
|
||||||
};
|
};
|
||||||
@ -2032,7 +2032,7 @@ test("Can handle unexpected errors during trade initialization", async () => {
|
|||||||
// TODO: test it's unavailable right after taking (taker will know before maker)
|
// TODO: test it's unavailable right after taking (taker will know before maker)
|
||||||
|
|
||||||
// trader 0's offer remains available
|
// trader 0's offer remains available
|
||||||
await wait(10000); // give time for trade initialization to fail and offer to become available
|
await wait(15000); // give time for trade initialization to fail and offer to become available
|
||||||
offer = await traders[0].getMyOffer(offer.getId());
|
offer = await traders[0].getMyOffer(offer.getId());
|
||||||
if (offer.getState() !== "AVAILABLE") {
|
if (offer.getState() !== "AVAILABLE") {
|
||||||
HavenoUtils.log(1, "Offer is not yet available, waiting to become available after timeout..."); // TODO (woodser): fail trade on nack during initialization to save a bunch of time
|
HavenoUtils.log(1, "Offer is not yet available, waiting to become available after timeout..."); // TODO (woodser): fail trade on nack during initialization to save a bunch of time
|
||||||
@ -2359,12 +2359,14 @@ async function executeTrade(ctxP: Partial<TradeContext>): Promise<string> {
|
|||||||
const promises: Promise<void>[] = [];
|
const promises: Promise<void>[] = [];
|
||||||
ctx.buyerAppName = ctx.getBuyer().havenod!.getAppName();
|
ctx.buyerAppName = ctx.getBuyer().havenod!.getAppName();
|
||||||
if (ctx.buyerOfflineAfterTake) {
|
if (ctx.buyerOfflineAfterTake) {
|
||||||
|
HavenoUtils.log(0, "Buyer going offline");
|
||||||
promises.push(releaseHavenoProcess(ctx.getBuyer().havenod!));
|
promises.push(releaseHavenoProcess(ctx.getBuyer().havenod!));
|
||||||
if (ctx.isBuyerMaker()) ctx.maker.havenod = undefined;
|
if (ctx.isBuyerMaker()) ctx.maker.havenod = undefined;
|
||||||
else ctx.taker.havenod = undefined;
|
else ctx.taker.havenod = undefined;
|
||||||
}
|
}
|
||||||
ctx.sellerAppName = ctx.getSeller().havenod!.getAppName();
|
ctx.sellerAppName = ctx.getSeller().havenod!.getAppName();
|
||||||
if (ctx.sellerOfflineAfterTake) {
|
if (ctx.sellerOfflineAfterTake) {
|
||||||
|
HavenoUtils.log(0, "Seller going offline");
|
||||||
promises.push(releaseHavenoProcess(ctx.getSeller().havenod!));
|
promises.push(releaseHavenoProcess(ctx.getSeller().havenod!));
|
||||||
if (ctx.isBuyerMaker()) ctx.taker.havenod = undefined;
|
if (ctx.isBuyerMaker()) ctx.taker.havenod = undefined;
|
||||||
else ctx.maker.havenod = undefined;
|
else ctx.maker.havenod = undefined;
|
||||||
@ -2378,6 +2380,7 @@ async function executeTrade(ctxP: Partial<TradeContext>): Promise<string> {
|
|||||||
// buyer comes online if offline and used
|
// buyer comes online if offline and used
|
||||||
if (ctx.isStopped) return ctx.offerId!;
|
if (ctx.isStopped) return ctx.offerId!;
|
||||||
if (ctx.buyerOfflineAfterTake && ((ctx.buyerSendsPayment && !ctx.isPaymentSent && ctx.sellerDisputeContext !== DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK) || (ctx.buyerDisputeContext === DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK && !ctx.buyerOpenedDispute))) {
|
if (ctx.buyerOfflineAfterTake && ((ctx.buyerSendsPayment && !ctx.isPaymentSent && ctx.sellerDisputeContext !== DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK) || (ctx.buyerDisputeContext === DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK && !ctx.buyerOpenedDispute))) {
|
||||||
|
HavenoUtils.log(0, "Buyer coming online");
|
||||||
const buyer = await initHaveno({appName: ctx.buyerAppName, excludePorts: ctx.usedPorts}); // change buyer's node address
|
const buyer = await initHaveno({appName: ctx.buyerAppName, excludePorts: ctx.usedPorts}); // change buyer's node address
|
||||||
if (ctx.isBuyerMaker()) ctx.maker.havenod = buyer;
|
if (ctx.isBuyerMaker()) ctx.maker.havenod = buyer;
|
||||||
else ctx.taker.havenod = buyer;
|
else ctx.taker.havenod = buyer;
|
||||||
@ -2465,6 +2468,7 @@ async function executeTrade(ctxP: Partial<TradeContext>): Promise<string> {
|
|||||||
// buyer goes offline if configured
|
// buyer goes offline if configured
|
||||||
if (ctx.isStopped) return ctx.offerId!;
|
if (ctx.isStopped) return ctx.offerId!;
|
||||||
if (ctx.buyerOfflineAfterPaymentSent) {
|
if (ctx.buyerOfflineAfterPaymentSent) {
|
||||||
|
HavenoUtils.log(0, "Buyer going offline");
|
||||||
await releaseHavenoProcess(ctx.getBuyer().havenod!);
|
await releaseHavenoProcess(ctx.getBuyer().havenod!);
|
||||||
if (ctx.isBuyerMaker()) ctx.maker.havenod = undefined;
|
if (ctx.isBuyerMaker()) ctx.maker.havenod = undefined;
|
||||||
else ctx.taker.havenod = undefined;
|
else ctx.taker.havenod = undefined;
|
||||||
@ -2473,6 +2477,7 @@ async function executeTrade(ctxP: Partial<TradeContext>): Promise<string> {
|
|||||||
// seller comes online if offline
|
// seller comes online if offline
|
||||||
if (ctx.isStopped) return ctx.offerId!;
|
if (ctx.isStopped) return ctx.offerId!;
|
||||||
if (!ctx.getSeller().havenod) {
|
if (!ctx.getSeller().havenod) {
|
||||||
|
HavenoUtils.log(0, "Seller coming online");
|
||||||
const seller = await initHaveno({appName: ctx.sellerAppName, excludePorts: ctx.usedPorts});
|
const seller = await initHaveno({appName: ctx.sellerAppName, excludePorts: ctx.usedPorts});
|
||||||
if (ctx.isBuyerMaker()) ctx.taker.havenod = seller;
|
if (ctx.isBuyerMaker()) ctx.taker.havenod = seller;
|
||||||
else ctx.maker.havenod = seller;
|
else ctx.maker.havenod = seller;
|
||||||
|
Loading…
Reference in New Issue
Block a user