From 34945230627a81d0b6c27a86f11ce4496178dd9a Mon Sep 17 00:00:00 2001 From: Albert Folch Date: Thu, 23 May 2024 17:47:14 +0200 Subject: [PATCH] fix: tests --- test/protocol/FundsHandlerTest.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/protocol/FundsHandlerTest.js b/test/protocol/FundsHandlerTest.js index eab747ba3..848609c11 100644 --- a/test/protocol/FundsHandlerTest.js +++ b/test/protocol/FundsHandlerTest.js @@ -1,4 +1,3 @@ -/* eslint-disable no-only-tests/no-only-tests */ const { ethers } = require("hardhat"); const { ZeroAddress, getSigners, provider, parseUnits, getContractAt, getContractFactory, MaxUint256 } = ethers; const { expect, assert } = require("chai"); @@ -5921,7 +5920,7 @@ describe("IBosonFundsHandler", function () { exchangeToken: offerPriceDiscovery.exchangeToken, price: orderPrice, }; - priceDiscoveryProtocolFee = applyPercentage(order.price, protocolFeePercentage); + priceDiscoveryProtocolFee = applyPercentage(order.price, "200"); const priceDiscoveryData = priceDiscoveryContract.interface.encodeFunctionData("fulfilBuyOrder", [order]); @@ -6871,7 +6870,7 @@ describe("IBosonFundsHandler", function () { // expected payoffs // buyer: (price + sellerDeposit + buyerEscalationDeposit)*buyerPercentage buyerPayoff = - ((BigInt(orderPrice) + BigInt(offerPriceDiscovery.sellerDeposit)) * BigInt(buyerPercentBasisPoints)) / + ((BigInt(order.price) + BigInt(offerPriceDiscovery.sellerDeposit)) * BigInt(buyerPercentBasisPoints)) / 10000n; const sellerPercentBasisPoints = 10000n - BigInt(buyerPercentBasisPoints); @@ -6879,9 +6878,9 @@ describe("IBosonFundsHandler", function () { sellerPayoff = (BigInt(offerPriceDiscovery.sellerDeposit) * (10000n - BigInt(buyerPercentBasisPoints))) / 10000n; - const sellerPricePart = BigInt(orderPrice) - (BigInt(orderPrice) * sellerPercentBasisPoints) / 10000n; + const sellerPricePart = BigInt(order.price) - (BigInt(order.price) * sellerPercentBasisPoints) / 10000n; const sellerProtocolFeePart = (BigInt(priceDiscoveryProtocolFee) * sellerPercentBasisPoints) / 10000n; - sellerPayoff2 = BigInt(orderPrice) - sellerPricePart - sellerProtocolFeePart; + sellerPayoff2 = BigInt(order.price) - sellerPricePart - sellerProtocolFeePart; protocolPayoff = sellerProtocolFeePart;