From c9ac2831ee90862738894ec814ac8bbc0ac94317 Mon Sep 17 00:00:00 2001 From: Vladimir Borovik Date: Fri, 22 Mar 2024 16:35:57 +0300 Subject: [PATCH] fix(fusion-order): correct handle for default values --- src/fusion-order/fusion-order.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/fusion-order/fusion-order.ts b/src/fusion-order/fusion-order.ts index b17f5b1..aafde97 100644 --- a/src/fusion-order/fusion-order.ts +++ b/src/fusion-order/fusion-order.ts @@ -70,18 +70,21 @@ export class FusionOrder { enablePermit2?: boolean } = FusionOrder.defaultExtra ) { - const { - allowPartialFills, - allowMultipleFills, - unwrapWETH, - enablePermit2, - orderExpirationDelay, - nonce, - permit - } = { - ...FusionOrder.defaultExtra, - ...extra - } + const allowPartialFills = + extra.allowPartialFills ?? + FusionOrder.defaultExtra.allowPartialFills + const allowMultipleFills = + extra.allowMultipleFills ?? + FusionOrder.defaultExtra.allowMultipleFills + const unwrapWETH = + extra.unwrapWETH ?? FusionOrder.defaultExtra.unwrapWETH + const enablePermit2 = + extra.enablePermit2 ?? FusionOrder.defaultExtra.enablePermit2 + const orderExpirationDelay = + extra.orderExpirationDelay ?? + FusionOrder.defaultExtra.orderExpirationDelay + + const {nonce, permit} = extra const deadline = auctionDetails.startTime +