mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-02-05 09:15:19 -05:00
expect trade amount adjustment
This commit is contained in:
parent
3264765f91
commit
8b235f0182
@ -3062,13 +3062,8 @@ async function takeOffer(ctxP: Partial<TradeContext>): Promise<TradeInfo> {
|
|||||||
// test getting trade for all parties
|
// test getting trade for all parties
|
||||||
await testGetTrade(ctx);
|
await testGetTrade(ctx);
|
||||||
|
|
||||||
// market-priced offer amounts are unadjusted, fixed-priced offer amounts are adjusted (e.g. cash at atm is $10 increments)
|
// offer amounts are adjusted to 4 decimals
|
||||||
// TODO: adjustments are based on payment method, not fixed-price
|
expect(Math.abs(HavenoUtils.percentageDiff(ctx.tradeAmount!, BigInt(takerTrade.getAmount())))).toBeLessThan(TestConfig.maxAdjustmentPct);
|
||||||
if (takerTrade.getOffer()!.getUseMarketBasedPrice()) {
|
|
||||||
assert.equal(ctx.tradeAmount, BigInt(takerTrade.getAmount()));
|
|
||||||
} else {
|
|
||||||
expect(Math.abs(HavenoUtils.percentageDiff(ctx.tradeAmount!, BigInt(takerTrade.getAmount())))).toBeLessThan(TestConfig.maxAdjustmentPct);
|
|
||||||
}
|
|
||||||
|
|
||||||
// maker is notified of balance change
|
// maker is notified of balance change
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user