Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk committed Jan 24, 2025
1 parent d7177e3 commit f6e4737
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/fusion-order/fusion-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ export class FusionOrder {
* */
public calcTakingAmount(
taker: Address,
makingAmount: bigint,
time: bigint,
blockBaseFee = 0n,
makingAmount = this.makingAmount
blockBaseFee = 0n
): bigint {
const takingAmount = calcTakingAmount(
makingAmount,
Expand Down
29 changes: 25 additions & 4 deletions tests/fusion-order/fusion-order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ describe('SettlementExtension', () => {
)
})

// eslint-disable-next-line max-lines-per-function
describe('Fees', () => {
it('only integrator fee', async () => {
const integratorAddress = Address.fromBigInt(1337n)
Expand Down Expand Up @@ -216,7 +217,12 @@ describe('SettlementExtension', () => {
order.makingAmount
)
expect(initBalances.usdc.taker - finalBalances.usdc.taker).toBe(
order.calcTakingAmount(takerAddress, now(), 0n)
order.calcTakingAmount(
takerAddress,
order.makingAmount,
now(),
0n
)
)

expect(
Expand Down Expand Up @@ -319,7 +325,12 @@ describe('SettlementExtension', () => {
order.makingAmount
)
expect(initBalances.usdc.taker - finalBalances.usdc.taker).toBe(
order.calcTakingAmount(takerAddress, now(), 0n)
order.calcTakingAmount(
takerAddress,
order.makingAmount,
now(),
0n
)
)

expect(
Expand Down Expand Up @@ -431,7 +442,12 @@ describe('SettlementExtension', () => {
order.makingAmount
)
expect(initBalances.usdc.taker - finalBalances.usdc.taker).toBe(
order.calcTakingAmount(takerAddress, now(), 0n)
order.calcTakingAmount(
takerAddress,
order.makingAmount,
now(),
0n
)
)

expect(
Expand Down Expand Up @@ -566,7 +582,12 @@ describe('SettlementExtension', () => {
order.makingAmount
)
expect(initBalances.usdc.taker - finalBalances.usdc.taker).toBe(
order.calcTakingAmount(takerAddress, now(), 0n)
order.calcTakingAmount(
takerAddress,
order.makingAmount,
now(),
0n
)
)

expect(
Expand Down

0 comments on commit f6e4737

Please sign in to comment.