Skip to content

Commit

Permalink
modify NoSpecifiedOrdersAvailable behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Mar 6, 2024
1 parent 8d42251 commit 63b4fff
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 223 deletions.
20 changes: 14 additions & 6 deletions reference/lib/ReferenceOrderCombiner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,13 @@ contract ReferenceOrderCombiner is
}

// Apply criteria resolvers to each order as applicable.
_applyCriteriaResolvers(advancedOrders, ordersToExecute, criteriaResolvers);
_applyCriteriaResolvers(
advancedOrders,
ordersToExecute,
criteriaResolvers
);

bool someOrderAvailable;

// Iterate over each order to check authorization status (for restricted
// orders), generate orders (for contract orders), and emit events (for
Expand Down Expand Up @@ -500,6 +506,13 @@ contract ReferenceOrderCombiner is
spentItems,
receivedItems
);

someOrderAvailable = true;
}

// Revert if no orders are available.
if (!someOrderAvailable) {
revert NoSpecifiedOrdersAvailable();
}
}

Expand Down Expand Up @@ -625,11 +638,6 @@ contract ReferenceOrderCombiner is
);
}

// Revert if no orders are available.
if (executions.length == 0) {
revert NoSpecifiedOrdersAvailable();
}

// Perform final checks and compress executions into standard and batch.
availableOrders = _performFinalChecksAndExecuteOrders(
advancedOrders,
Expand Down
Loading

0 comments on commit 63b4fff

Please sign in to comment.