Collapse on-chain sources into DexForwarderBridge (#2560)
* Collapse on-chain sources into DexForwarderBridge * Fix tests. CHANGELOG
This commit is contained in:
parent
07acc9529e
commit
cac6f5234f
@ -49,6 +49,10 @@
|
|||||||
{
|
{
|
||||||
"note": "Add support for indicative (non-committal) quotes via RFQ-T",
|
"note": "Add support for indicative (non-committal) quotes via RFQ-T",
|
||||||
"pr": 2555
|
"pr": 2555
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Collapse `LiquidityProvider` into `DexForwarderBridge`",
|
||||||
|
"pr": 2560
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -153,19 +153,10 @@ export function createOrdersFromPath(path: Fill[], opts: CreateOrderFromPathOpts
|
|||||||
++i;
|
++i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Liquidity Provider must be called by ERC20BridgeProxy
|
|
||||||
if (collapsedPath[i].source === ERC20BridgeSource.LiquidityProvider) {
|
|
||||||
orders.push(createBridgeOrder(collapsedPath[i], opts));
|
|
||||||
++i;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// If there are contiguous bridge orders, we can batch them together.
|
// If there are contiguous bridge orders, we can batch them together.
|
||||||
const contiguousBridgeFills = [collapsedPath[i]];
|
const contiguousBridgeFills = [collapsedPath[i]];
|
||||||
for (let j = i + 1; j < collapsedPath.length; ++j) {
|
for (let j = i + 1; j < collapsedPath.length; ++j) {
|
||||||
if (
|
if (collapsedPath[j].source === ERC20BridgeSource.Native) {
|
||||||
collapsedPath[j].source === ERC20BridgeSource.Native ||
|
|
||||||
collapsedPath[j].source === ERC20BridgeSource.LiquidityProvider
|
|
||||||
) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
contiguousBridgeFills.push(collapsedPath[j]);
|
contiguousBridgeFills.push(collapsedPath[j]);
|
||||||
|
@ -659,7 +659,7 @@ describe('MarketOperationUtils tests', () => {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
Web3Wrapper.toBaseUnitAmount(10, 18),
|
Web3Wrapper.toBaseUnitAmount(10, 18),
|
||||||
{ excludedSources: SELL_SOURCES, numSamples: 4, bridgeSlippage: 0 },
|
{ excludedSources: SELL_SOURCES, numSamples: 4, bridgeSlippage: 0, shouldBatchBridgeOrders: false },
|
||||||
);
|
);
|
||||||
expect(result.length).to.eql(1);
|
expect(result.length).to.eql(1);
|
||||||
expect(result[0].makerAddress).to.eql(liquidityProviderAddress);
|
expect(result[0].makerAddress).to.eql(liquidityProviderAddress);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user