diff --git a/packages/orderbook/src/seaport/seaport.ts b/packages/orderbook/src/seaport/seaport.ts index c7f065a02e..1f68c40b21 100644 --- a/packages/orderbook/src/seaport/seaport.ts +++ b/packages/orderbook/src/seaport/seaport.ts @@ -268,6 +268,7 @@ export class Seaport { ): Promise { const { orderComponents, tips } = mapImmutableOrderToSeaportOrderComponents(order); const seaportLib = this.getSeaportLib(order); + const chainID = (await this.provider.getNetwork()).chainId; const { actions: seaportActions } = await seaportLib.fulfillOrders({ accountAddress: account, @@ -286,19 +287,21 @@ export class Seaport { const fulfillmentActions: TransactionAction[] = []; - const approvalAction = seaportActions.find( + const approvalActions = seaportActions.filter( (action) => action.type === 'approval', ); - if (approvalAction) { - fulfillmentActions.push({ - type: ActionType.TRANSACTION, - buildTransaction: prepareTransaction( - approvalAction.transactionMethods, - (await this.provider.getNetwork()).chainId, - account, - ), - purpose: TransactionPurpose.APPROVAL, + if (approvalActions.length > 0) { + approvalActions.forEach((approvalAction) => { + fulfillmentActions.push({ + type: ActionType.TRANSACTION, + buildTransaction: prepareTransaction( + approvalAction.transactionMethods, + chainID, + account, + ), + purpose: TransactionPurpose.APPROVAL, + }); }); } @@ -314,7 +317,7 @@ export class Seaport { type: ActionType.TRANSACTION, buildTransaction: prepareTransaction( fulfilOrderAction.transactionMethods, - (await this.provider.getNetwork()).chainId, + chainID, account, ), purpose: TransactionPurpose.FULFILL_ORDER, diff --git a/tests/func-tests/zkevm/specs/orderbook.spec.ts b/tests/func-tests/zkevm/specs/orderbook.spec.ts index c75e0ffe77..0fc296f2a9 100644 --- a/tests/func-tests/zkevm/specs/orderbook.spec.ts +++ b/tests/func-tests/zkevm/specs/orderbook.spec.ts @@ -128,7 +128,7 @@ describe.skip("Orderbook", () => { await ( await banker.sendTransaction({ to: maker.address, - value: imxForApproval, + value: `${imxForApproval}`, ...GAS_OVERRIDES, }) ).wait(1); @@ -144,7 +144,7 @@ describe.skip("Orderbook", () => { await ( await banker.sendTransaction({ to: taker.address, - value: imxForApproval + imxForFulfillment, + value: `${imxForApproval + imxForFulfillment}`, ...GAS_OVERRIDES, }) ).wait(1); @@ -166,9 +166,11 @@ describe.skip("Orderbook", () => { contractAddress: erc721Contract.address, tokenId: erc721TokenId, }, + orderStart: new Date(2000, 1, 15), }); const signatures = await actionAll(bidCreateActions, maker); + const { result } = await orderBookSdk.createBid({ orderComponents, orderHash, @@ -209,7 +211,7 @@ describe.skip("Orderbook", () => { await ( await banker.sendTransaction({ to: maker.address, - value: imxForApproval, + value: `${imxForApproval}`, ...GAS_OVERRIDES, }) ).wait(1); @@ -231,7 +233,7 @@ describe.skip("Orderbook", () => { await ( await banker.sendTransaction({ to: taker.address, - value: imxForApproval + imxForFulfillment, + value: `${imxForApproval + imxForFulfillment}`, ...GAS_OVERRIDES, }) ).wait(1); @@ -367,7 +369,7 @@ describe.skip("Orderbook", () => { await ( await banker.sendTransaction({ to: maker.address, - value: imxForApproval * 2, + value: `${imxForApproval * 2}`, ...GAS_OVERRIDES, }) ).wait(1); diff --git a/tests/func-tests/zkevm/step-definitions/shared.ts b/tests/func-tests/zkevm/step-definitions/shared.ts index 5d10bf8acd..f078e78a6e 100644 --- a/tests/func-tests/zkevm/step-definitions/shared.ts +++ b/tests/func-tests/zkevm/step-definitions/shared.ts @@ -142,6 +142,7 @@ export const whenICreateAListing = ( type: 'NATIVE', }, sell: sellItem, + orderStart: new Date(2000, 1, 15), }); const signatures = await actionAll(listing.actions, offerer); @@ -190,6 +191,7 @@ export const whenICreateABulkListing = ( }, sell: sellItem, makerFees: [], + orderStart: new Date(2000, 1, 15), }); }