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

Commit

Permalink
Always use DFB in asset-swapper (#2542)
Browse files Browse the repository at this point in the history
* Always use DFB in asset-swapper

* Clean up
  • Loading branch information
dekz authored Apr 9, 2020
1 parent a80d1f8 commit 0e196a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ export function createOrdersFromPath(path: Fill[], opts: CreateOrderFromPathOpts
}
contiguousBridgeFills.push(collapsedPath[j]);
}
if (contiguousBridgeFills.length === 1 || !opts.shouldBatchBridgeOrders) {
// Always use DexForwarderBridge unless configured not to
if (!opts.shouldBatchBridgeOrders) {
orders.push(createBridgeOrder(contiguousBridgeFills[0], opts));
i += 1;
} else {
Expand Down
6 changes: 5 additions & 1 deletion packages/asset-swapper/test/market_operation_utils_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ describe('MarketOperationUtils tests', () => {
if (assetData.length === 74) {
return ERC20BridgeSource.Native;
}
const bridgeAddress = hexUtils.slice(assetData, 48, 68).toLowerCase();
const bridgeData = assetDataUtils.decodeAssetDataOrThrow(assetData);
if (!assetDataUtils.isERC20BridgeAssetData(bridgeData)) {
throw new Error('AssetData is not ERC20BridgeAssetData');
}
const { bridgeAddress } = bridgeData;
switch (bridgeAddress) {
case KYBER_BRIDGE_ADDRESS.toLowerCase():
return ERC20BridgeSource.Kyber;
Expand Down

0 comments on commit 0e196a5

Please sign in to comment.