added a few fixed and added some comments:

This commit is contained in:
Daniel Pyrathon
2020-09-29 23:07:14 -07:00
parent 708e34602b
commit a24f01c90f
2 changed files with 4 additions and 1 deletions

View File

@@ -622,6 +622,9 @@ export class MarketOperationUtils {
// Re-run optimizer with the new firm quote. This is the second and last time
// we run the optimized in a block of code. In this case, we don't catch a potential `NoOptimalPath` exception
// and we let it bubble up if it happens.
//
// NOTE: as of now, we assume that RFQ orders are 100% fillable because these are trusted market makers, therefore
// we do not perform an extra check to get fillable taker amounts.
optimizerResult = await this._generateOptimizedOrdersAsync({
...marketSideLiquidity,
nativeOrders: marketSideLiquidity.nativeOrders.concat(firmQuotes.map(quote => quote.signedOrder)),

View File

@@ -864,7 +864,7 @@ describe('MarketOperationUtils tests', () => {
expect(hasSecondOptimizationRun).to.eql(true);
});
it.only('getMarketSellOrdersAsync() will raise a NoOptimalPath error if no path was found during on-chain DEX optimization and RFQ optimization', async () => {
it('getMarketSellOrdersAsync() will raise a NoOptimalPath error if no path was found during on-chain DEX optimization and RFQ optimization', async () => {
const mockedMarketOpUtils = TypeMoq.Mock.ofType(MarketOperationUtils, TypeMoq.MockBehavior.Loose, false, MOCK_SAMPLER, contractAddresses, ORDER_DOMAIN);
mockedMarketOpUtils.callBase = true;
mockedMarketOpUtils.setup(