mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-01-13 08:19:47 -05:00
test resolving dispute with custom winner amount
This commit is contained in:
parent
b5c148f74b
commit
de0e4ab7cd
@ -107,7 +107,7 @@ const defaultTradeConfig: Partial<TradeContext> = {
|
|||||||
takeOffer: true,
|
takeOffer: true,
|
||||||
awaitFundsToMakeOffer: true,
|
awaitFundsToMakeOffer: true,
|
||||||
direction: OfferDirection.BUY, // buy or sell xmr
|
direction: OfferDirection.BUY, // buy or sell xmr
|
||||||
offerAmount: BigInt("200000000000"), // amount of xmr to trade (0.2 XMR)
|
offerAmount: HavenoUtils.xmrToAtomicUnits(.2), // amount of xmr to trade
|
||||||
offerMinAmount: undefined,
|
offerMinAmount: undefined,
|
||||||
assetCode: "usd", // counter asset to trade
|
assetCode: "usd", // counter asset to trade
|
||||||
makerPaymentAccountId: undefined,
|
makerPaymentAccountId: undefined,
|
||||||
@ -1670,14 +1670,13 @@ test("Can resolve a dispute (CI)", async () => {
|
|||||||
assetCode: assetCode,
|
assetCode: assetCode,
|
||||||
buyerDisputeContext: DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK,
|
buyerDisputeContext: DisputeContext.OPEN_AFTER_DEPOSITS_UNLOCK,
|
||||||
disputeWinner: DisputeResult.Winner.SELLER,
|
disputeWinner: DisputeResult.Winner.SELLER,
|
||||||
|
disputeWinnerAmount: HavenoUtils.xmrToAtomicUnits(.767),
|
||||||
disputeReason: DisputeResult.Reason.OTHER,
|
disputeReason: DisputeResult.Reason.OTHER,
|
||||||
disputeSummary: "Payment not completed, so returning trade amount to seller.",
|
disputeSummary: "Payment not completed, so returning trade amount to seller.",
|
||||||
testBalanceChangeEndToEnd: true
|
testBalanceChangeEndToEnd: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: test with fixed price
|
|
||||||
// TODO: test receiver = BUYER
|
// TODO: test receiver = BUYER
|
||||||
// TODO: test with custom amount, or do the big test sequentially
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Can resolve disputes (CI)", async () => {
|
test("Can resolve disputes (CI)", async () => {
|
||||||
@ -1731,6 +1730,7 @@ test("Can resolve disputes (CI)", async () => {
|
|||||||
disputeWinner: DisputeResult.Winner.BUYER,
|
disputeWinner: DisputeResult.Winner.BUYER,
|
||||||
disputeReason: DisputeResult.Reason.TRADE_ALREADY_SETTLED,
|
disputeReason: DisputeResult.Reason.TRADE_ALREADY_SETTLED,
|
||||||
disputeSummary: "Buyer wins dispute after sending payment",
|
disputeSummary: "Buyer wins dispute after sending payment",
|
||||||
|
disputeWinnerAmount: HavenoUtils.xmrToAtomicUnits(.1171),
|
||||||
});
|
});
|
||||||
HavenoUtils.log(1, "Opening disputes");
|
HavenoUtils.log(1, "Opening disputes");
|
||||||
await executeTrades(ctxs.slice(configIdx, configIdx === undefined ? undefined : configIdx + 1));
|
await executeTrades(ctxs.slice(configIdx, configIdx === undefined ? undefined : configIdx + 1));
|
||||||
|
Loading…
Reference in New Issue
Block a user