diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 03:30:18 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-15 23:25:25 +0800 |
commit | 61c88455f49c86041263e48e99ca80ab4f2a9a6e (patch) | |
tree | a55f26cb8c687fae0b5446a1f9779806d9a4a410 | |
parent | a084bbbed833caf8318ae68c9c71edcb543676f1 (diff) | |
download | dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar.gz dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar.bz2 dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar.lz dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar.xz dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.tar.zst dexon-sol-tools-61c88455f49c86041263e48e99ca80ab4f2a9a6e.zip |
Apply prettier
-rw-r--r-- | contracts/protocol/test/exchange/wrapper.ts | 48 | ||||
-rw-r--r-- | packages/asset-buyer/src/utils/buy_quote_calculator.ts | 4 | ||||
-rw-r--r-- | packages/instant/src/util/asset.ts | 5 | ||||
-rw-r--r-- | packages/testnet-faucets/src/ts/handler.ts | 4 |
4 files changed, 32 insertions, 29 deletions
diff --git a/contracts/protocol/test/exchange/wrapper.ts b/contracts/protocol/test/exchange/wrapper.ts index 32ec64716..49ba5a2e5 100644 --- a/contracts/protocol/test/exchange/wrapper.ts +++ b/contracts/protocol/test/exchange/wrapper.ts @@ -493,15 +493,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -562,15 +562,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -647,15 +647,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); @@ -706,15 +706,15 @@ describe('Exchange wrappers', () => { erc20Balances[makerAddress][makerAssetAddress] = erc20Balances[makerAddress][ makerAssetAddress ].minus(makerAssetFilledAmount); - erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][takerAssetAddress].plus( - takerAssetFillAmount, - ); + erc20Balances[makerAddress][takerAssetAddress] = erc20Balances[makerAddress][ + takerAssetAddress + ].plus(takerAssetFillAmount); erc20Balances[makerAddress][zrxToken.address] = erc20Balances[makerAddress][zrxToken.address].minus( makerFee, ); - erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][makerAssetAddress].plus( - makerAssetFilledAmount, - ); + erc20Balances[takerAddress][makerAssetAddress] = erc20Balances[takerAddress][ + makerAssetAddress + ].plus(makerAssetFilledAmount); erc20Balances[takerAddress][takerAssetAddress] = erc20Balances[takerAddress][ takerAssetAddress ].minus(takerAssetFillAmount); diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts index 9205678e7..125841094 100644 --- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts +++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts @@ -43,7 +43,9 @@ export const buyQuoteCalculator = { const multiplierNeededWithSlippage = new BigNumber(1).plus(slippagePercentage); // Given amountAvailableToFillConsideringSlippage * multiplierNeededWithSlippage = amountAbleToFill // We divide amountUnableToFill by multiplierNeededWithSlippage to determine amountAvailableToFillConsideringSlippage - const amountAvailableToFillConsideringSlippage = amountAbleToFill.div(multiplierNeededWithSlippage).integerValue(BigNumber.ROUND_FLOOR); + const amountAvailableToFillConsideringSlippage = amountAbleToFill + .div(multiplierNeededWithSlippage) + .integerValue(BigNumber.ROUND_FLOOR); throw new InsufficientAssetLiquidityError(amountAvailableToFillConsideringSlippage); } diff --git a/packages/instant/src/util/asset.ts b/packages/instant/src/util/asset.ts index 9e509edf9..b5c97913d 100644 --- a/packages/instant/src/util/asset.ts +++ b/packages/instant/src/util/asset.ts @@ -104,9 +104,8 @@ export const assetUtils = { return assetDataGroupIfExists[Network.Mainnet]; }, getERC20AssetsFromAssets: (assets: Asset[]): ERC20Asset[] => { - const erc20sOrUndefined = _.map( - assets, - asset => (asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined), + const erc20sOrUndefined = _.map(assets, asset => + asset.metaData.assetProxyId === AssetProxyId.ERC20 ? (asset as ERC20Asset) : undefined, ); return _.compact(erc20sOrUndefined); }, diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts index 54387749f..d4166ae91 100644 --- a/packages/testnet-faucets/src/ts/handler.ts +++ b/packages/testnet-faucets/src/ts/handler.ts @@ -179,7 +179,9 @@ export class Handler { feeRecipientAddress: NULL_ADDRESS, senderAddress: NULL_ADDRESS, // tslint:disable-next-line:custom-no-magic-numbers - expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS).div(1000).integerValue(BigNumber.ROUND_FLOOR), + expirationTimeSeconds: new BigNumber(Date.now() + FIVE_DAYS_IN_MS) + .div(1000) + .integerValue(BigNumber.ROUND_FLOOR), }; const orderHash = orderHashUtils.getOrderHashHex(order); const signature = await signatureUtils.ecSignHashAsync( |