Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Collapse on-chain sources into DexForwarderBridge #2560

Merged
merged 2 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/asset-swapper/CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
{
"note": "Add support for indicative (non-committal) quotes via RFQ-T",
"pr": 2555
},
{
"note": "Collapse `LiquidityProvider` into `DexForwarderBridge`",
"pr": 2560
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,10 @@ export function createOrdersFromPath(path: Fill[], opts: CreateOrderFromPathOpts
++i;
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.
const contiguousBridgeFills = [collapsedPath[i]];
for (let j = i + 1; j < collapsedPath.length; ++j) {
if (
collapsedPath[j].source === ERC20BridgeSource.Native ||
collapsedPath[j].source === ERC20BridgeSource.LiquidityProvider
) {
if (collapsedPath[j].source === ERC20BridgeSource.Native) {
break;
}
contiguousBridgeFills.push(collapsedPath[j]);
Expand Down
2 changes: 1 addition & 1 deletion packages/asset-swapper/test/market_operation_utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ describe('MarketOperationUtils tests', () => {
}),
],
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[0].makerAddress).to.eql(liquidityProviderAddress);
Expand Down