diff --git a/.soliumrc.json b/.soliumrc.json index c3d5711fa..4d3acf036 100644 --- a/.soliumrc.json +++ b/.soliumrc.json @@ -6,7 +6,7 @@ "mixedcase": 0, "no-experimental": 0, "lbrace": 0, - "max-len": ["error", 100], + "max-len": ["warning", 120], "indentation": ["error", 4], "quotes": ["error", "double"], "arg-overflow": ["warning", 3], diff --git a/contracts/core/Core.sol b/contracts/core/Core.sol index 61166ca83..b29b95441 100644 --- a/contracts/core/Core.sol +++ b/contracts/core/Core.sol @@ -1,4 +1,4 @@ -/* + /* Copyright 2018 Set Labs Inc. Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,6 +32,7 @@ import { CoreIssuanceOrder } from "./extensions/CoreIssuanceOrder.sol"; * The Core contract acts as a coordinator handling issuing, redeeming, and * creating Sets, as well as all collateral flows throughout the system. */ + /* solium-disable-next-line no-empty-blocks */ contract Core is CoreExchangeDispatcher, CoreIssuanceOrder, diff --git a/contracts/core/SetToken.sol b/contracts/core/SetToken.sol index 7ea04ee04..80e169805 100644 --- a/contracts/core/SetToken.sol +++ b/contracts/core/SetToken.sol @@ -156,6 +156,7 @@ contract SetToken is ); // Figure out which of the components has the minimum decimal value + /* solium-disable-next-line security/no-low-level-calls */ if (currentComponent.call(bytes4(keccak256("decimals()")))) { currentDecimals = DetailedERC20(currentComponent).decimals(); minDecimals = currentDecimals < minDecimals ? currentDecimals : minDecimals; diff --git a/contracts/core/exchange-wrappers/ZeroExExchangeWrapper.sol b/contracts/core/exchange-wrappers/ZeroExExchangeWrapper.sol index 6128d0f6c..0db4d62b3 100644 --- a/contracts/core/exchange-wrappers/ZeroExExchangeWrapper.sol +++ b/contracts/core/exchange-wrappers/ZeroExExchangeWrapper.sol @@ -58,7 +58,6 @@ contract ZeroExExchangeWrapper SET_PROXY = _setProxy; } - /* ============ Public Functions ============ */ @@ -82,7 +81,7 @@ contract ZeroExExchangeWrapper /* ============ Getters ============ */ /* ============ Private ============ */ - + function fillZeroExOrder( bytes _zeroExOrderData ) @@ -95,14 +94,17 @@ contract ZeroExExchangeWrapper // Ensure the maker token is allowed to be approved to the ZeroEx proxy - - ZeroExFillResults.FillResults memory fillResults = + // TODO: Still being handled in Felix's PR + /* solium-disable-next-line operator-whitespace */ + ZeroExFillResults.FillResults memory fillResults = ZeroExExchange(ZERO_EX_EXCHANGE).fillOrKillOrder( order, fillAmount, signature ); + // Temporary to satisfy Solium + return fillResults; // Ensure the taker token is allowed to be approved to the TransferProxy } } diff --git a/contracts/lib/ERC20Wrapper.sol b/contracts/lib/ERC20Wrapper.sol index fa902094d..f67bcf12e 100644 --- a/contracts/lib/ERC20Wrapper.sol +++ b/contracts/lib/ERC20Wrapper.sol @@ -33,6 +33,7 @@ library ERC20Wrapper { // ============ Constants ============ string constant INVALID_RETURN_TRANSFER = "Transferred token does not return null or true on successful transfer."; + /* solium-disable-next-line max-len */ string constant INVALID_RETURN_TRANSFERFROM = "Transferred token does not return null or true on successful transferFrom."; string constant INVALID_RETURN_APPROVE = "Approved token does not return null or true on successful approve."; diff --git a/package.json b/package.json index 5c545bb9d..3713a41be 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,8 @@ "chain": "yarn clean-chain && ganache-cli --db blockchain --networkId 50 --accounts 20 -l 10000000 -e 1000000 -m 'concert load couple harbor equip island argue ramp clarify fence smart topic'", "coverage-setup": "cp -r transpiled/test/* test/. && cp -r transpiled/types/* types/. && cp -r transpiled/utils/* utils/.", "coverage-cleanup": "find test -name \\*.js* -type f -delete && find types -name \\*.js* -type f -delete && find utils -name \\*.js* -type f -delete", - "coverage": "yarn coverage-setup && ./node_modules/.bin/solidity-coverage && yarn coverage-cleanup" + "coverage": "yarn coverage-setup && ./node_modules/.bin/solidity-coverage && yarn coverage-cleanup", + "precommit": "lint-staged" }, "repository": "git@github.com:SetProtocol/set-protocol-contracts.git", "author": "Felix Feng ", @@ -78,6 +79,8 @@ }, "dependencies": { "fs-extra": "^5.0.0", + "husky": "^0.14.3", + "lint-staged": "^7.2.0", "openzeppelin-zos": "^1.9.1", "sol-trace-set": "^0.0.1", "solium": "^1.1.7", @@ -86,5 +89,24 @@ "tslint-eslint-rules": "^5.3.1", "zeppelin-solidity": "^1.10.0", "zos-lib": "^1.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "contracts/**/*.sol": [ + "yarn lint-sol --fix", + "git add" + ], + "test/**/*.ts": [ + "yarn lint-ts --fix", + "git add" + ], + "utils/**/*.ts": [ + "yarn lint-ts --fix", + "git add" + ] } } diff --git a/test/contracts/core/exchange-wrappers/lib/zeroExOrderDataHandlerMock.spec.ts b/test/contracts/core/exchange-wrappers/lib/zeroExOrderDataHandlerMock.spec.ts index 9b67d9ac6..6050dbdb1 100644 --- a/test/contracts/core/exchange-wrappers/lib/zeroExOrderDataHandlerMock.spec.ts +++ b/test/contracts/core/exchange-wrappers/lib/zeroExOrderDataHandlerMock.spec.ts @@ -1,8 +1,5 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ethUtil from 'ethereumjs-util'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; // Types @@ -32,7 +29,7 @@ import { BigNumberSetup } from '../../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { expectRevertError, diff --git a/test/contracts/core/exchange-wrappers/takerWalletWrapper.spec.ts b/test/contracts/core/exchange-wrappers/takerWalletWrapper.spec.ts index 133c39913..03bacd02e 100644 --- a/test/contracts/core/exchange-wrappers/takerWalletWrapper.spec.ts +++ b/test/contracts/core/exchange-wrappers/takerWalletWrapper.spec.ts @@ -1,8 +1,6 @@ import * as chai from 'chai'; import * as _ from 'lodash'; -import * as ethUtil from 'ethereumjs-util'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; // Types @@ -24,7 +22,7 @@ import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { DEFAULT_GAS, @@ -40,7 +38,6 @@ import { contract('TakerWalletWrapper', accounts => { const [ deployerAccount, - issuerAccount, takerAccount, authorizedAddress, unauthorizedAddress, @@ -116,12 +113,14 @@ contract('TakerWalletWrapper', accounts => { }); it('approves the tokens for transfer to the transferProxy with unlimited allowance', async () => { - const existingAllowance = await componentToken.allowance.callAsync(takerWalletWrapper.address, transferProxy.address); + const existingAllowance = + await componentToken.allowance.callAsync(takerWalletWrapper.address, transferProxy.address); await subject(); const expectedNewAllowance = existingAllowance.add(UNLIMITED_ALLOWANCE_IN_BASE_UNITS); - const newBalance = await componentToken.allowance.callAsync(takerWalletWrapper.address, transferProxy.address); + const newBalance = + await componentToken.allowance.callAsync(takerWalletWrapper.address, transferProxy.address); expect(newBalance).to.be.bignumber.equal(expectedNewAllowance); }); @@ -161,12 +160,15 @@ contract('TakerWalletWrapper', accounts => { }); it('approves the tokens for transfer to the transferProxy with unlimited allowance', async () => { - const existingAllowances = await erc20Wrapper.getTokenAllowances(components, takerWalletWrapper.address, transferProxy.address); + const existingAllowances = + await erc20Wrapper.getTokenAllowances(components, takerWalletWrapper.address, transferProxy.address); await subject(); - const expectedNewAllowances = _.map(existingAllowances, allowance => allowance.add(UNLIMITED_ALLOWANCE_IN_BASE_UNITS)); - const newAllowances = await erc20Wrapper.getTokenAllowances(components, takerWalletWrapper.address, transferProxy.address); + const expectedNewAllowances = + _.map(existingAllowances, allowance => allowance.add(UNLIMITED_ALLOWANCE_IN_BASE_UNITS)); + const newAllowances = + await erc20Wrapper.getTokenAllowances(components, takerWalletWrapper.address, transferProxy.address); expect(newAllowances).to.eql(expectedNewAllowances); }); }); diff --git a/test/contracts/core/exchange-wrappers/zeroExExchangeWrapper.spec.ts b/test/contracts/core/exchange-wrappers/zeroExExchangeWrapper.spec.ts index 3636b3b4b..9769becc1 100644 --- a/test/contracts/core/exchange-wrappers/zeroExExchangeWrapper.spec.ts +++ b/test/contracts/core/exchange-wrappers/zeroExExchangeWrapper.spec.ts @@ -1,36 +1,37 @@ -import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ethUtil from 'ethereumjs-util'; +/* tslint:disable */ +import * as chai from "chai"; +import * as _ from "lodash"; +import * as ethUtil from "ethereumjs-util"; -import * as ABIDecoder from 'abi-decoder'; -import { BigNumber } from 'bignumber.js'; +import * as ABIDecoder from "abi-decoder"; +import { BigNumber } from "bignumber.js"; // Types -import { Address, Bytes32, Log, UInt } from '../../../../types/common.js'; -import { ZeroExOrderHeader, ZeroExOrder } from '../../../../types/zeroEx'; +import { Address, Bytes32, Log, UInt } from "../../../../types/common.js"; +import { ZeroExOrderHeader, ZeroExOrder } from "../../../../types/zeroEx"; // Contract types -import { ZeroExExchangeWrapperContract } from '../../../../types/generated/zero_ex_exchange_wrapper'; +import { ZeroExExchangeWrapperContract } from "../../../../types/generated/zero_ex_exchange_wrapper"; // Artifacts -const ZeroExExchangeWrapper = artifacts.require('ZeroExExchangeWrapper'); +const ZeroExExchangeWrapper = artifacts.require("ZeroExExchangeWrapper"); import { createZeroExOrder, -} from '../../../../utils/zeroExExchangeWrapper'; +} from "../../../../utils/zeroExExchangeWrapper"; // Testing Set up -import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; -import ChaiSetup from '../../../../utils/chaiSetup'; +import { BigNumberSetup } from "../../../../utils/bigNumberSetup"; +import ChaiSetup from "../../../../utils/chaiSetup"; BigNumberSetup.configure(); ChaiSetup.configure(); const { expect, assert } = chai; import { DEFAULT_GAS, -} from '../../../../utils/constants'; +} from "../../../../utils/constants"; -contract('ZeroExExchangeWrapper', accounts => { +contract("ZeroExExchangeWrapper", (accounts) => { const [ownerAccount, takerAddress, feeRecipientAddress, senderAddress] = accounts; let zeroExExchangeWrapper: ZeroExExchangeWrapperContract; @@ -45,7 +46,7 @@ contract('ZeroExExchangeWrapper', accounts => { ); }); - describe('#exchange', async () => { + describe("#exchange", async () => { // Deploy a mock 0x exchange // Deploy a mock 0x proxy }); diff --git a/test/contracts/core/extensions/coreAccounting.spec.ts b/test/contracts/core/extensions/coreAccounting.spec.ts index 8cf89276b..49d98a0d5 100644 --- a/test/contracts/core/extensions/coreAccounting.spec.ts +++ b/test/contracts/core/extensions/coreAccounting.spec.ts @@ -1,16 +1,13 @@ import * as chai from 'chai'; import * as _ from 'lodash'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; // Types import { Address } from '../../../../types/common.js'; // Contract types -import { AuthorizableContract } from '../../../../types/generated/authorizable'; import { CoreContract } from '../../../../types/generated/core'; -import { SetTokenContract } from '../../../../types/generated/set_token'; import { SetTokenFactoryContract } from '../../../../types/generated/set_token_factory'; import { StandardTokenMockContract } from '../../../../types/generated/standard_token_mock'; import { TransferProxyContract } from '../../../../types/generated/transfer_proxy'; @@ -25,7 +22,7 @@ import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { assertTokenBalance, @@ -41,7 +38,6 @@ contract('CoreAccounting', accounts => { const [ ownerAccount, otherAccount, - unauthorizedAccount, ] = accounts; let core: CoreContract; @@ -97,7 +93,7 @@ contract('CoreAccounting', accounts => { await subject(); const newVaultBalance = existingVaultTokenBalance.add(amountToDeposit); - assertTokenBalance(mockToken, amountToDeposit, vault.address); + assertTokenBalance(mockToken, newVaultBalance, vault.address); }); it('increments the vault balance of the token of the owner by the correct amount', async () => { @@ -253,8 +249,8 @@ contract('CoreAccounting', accounts => { }); afterEach(async () => { - tokenAddresses = null; - amountsToDeposit = null; + tokenAddresses = undefined; + amountsToDeposit = undefined; }); let tokenAddresses: Address[]; @@ -389,8 +385,8 @@ contract('CoreAccounting', accounts => { }); afterEach(async () => { - tokenAddresses = null; - amountsToWithdraw = null; + tokenAddresses = undefined; + amountsToWithdraw = undefined; }); let tokenAddresses: Address[]; diff --git a/test/contracts/core/extensions/coreExchangeDispatcher.spec.ts b/test/contracts/core/extensions/coreExchangeDispatcher.spec.ts index 744c97edc..70c878d7d 100644 --- a/test/contracts/core/extensions/coreExchangeDispatcher.spec.ts +++ b/test/contracts/core/extensions/coreExchangeDispatcher.spec.ts @@ -1,12 +1,10 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; -import { ether } from '../../../../utils/units'; // Types -import { Address, Log, UInt } from '../../../../types/common.js'; +import { Address, Log } from '../../../../types/common.js'; // Contract types import { CoreContract } from '../../../../types/generated/core'; @@ -16,7 +14,6 @@ const Core = artifacts.require('Core'); // Core wrapper import { CoreWrapper } from '../../../../utils/coreWrapper'; -import { ERC20Wrapper } from '../../../../utils/erc20Wrapper'; // Testing Set up import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; @@ -64,12 +61,12 @@ contract('CoreExchangeDispatcher', accounts => { describe('#registerExchange', async () => { let subjectCaller: Address; - let subjectExchangeId: UInt; + let subjectExchangeId: BigNumber; let subjectExchangeAddress: Address; beforeEach(async () => { subjectCaller = ownerAccount; - subjectExchangeId = EXCHANGES.ZERO_EX; + subjectExchangeId = new BigNumber(EXCHANGES.ZERO_EX); subjectExchangeAddress = zeroExWrapperAddress; }); @@ -95,7 +92,7 @@ contract('CoreExchangeDispatcher', accounts => { const expectedLogs: Log[] = [ ExchangeRegistered( core.address, - new BigNumber(subjectExchangeId), + subjectExchangeId, subjectExchangeAddress, ), ]; diff --git a/test/contracts/core/extensions/coreFactory.spec.ts b/test/contracts/core/extensions/coreFactory.spec.ts index b1cd6ae7d..70998ac53 100644 --- a/test/contracts/core/extensions/coreFactory.spec.ts +++ b/test/contracts/core/extensions/coreFactory.spec.ts @@ -1,16 +1,13 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; -import { ether } from '../../../../utils/units'; // Types import { Address, Log } from '../../../../types/common.js'; // Contract types import { CoreContract } from '../../../../types/generated/core'; -import { SetTokenContract } from '../../../../types/generated/set_token'; import { SetTokenFactoryContract } from '../../../../types/generated/set_token_factory'; import { StandardTokenMockContract } from '../../../../types/generated/standard_token_mock'; @@ -50,7 +47,6 @@ import { contract('CoreFactory', accounts => { const [ ownerAccount, - otherAccount, ] = accounts; let core: CoreContract; diff --git a/test/contracts/core/extensions/coreInternal.spec.ts b/test/contracts/core/extensions/coreInternal.spec.ts index fa0eb2ae2..b48bd763f 100644 --- a/test/contracts/core/extensions/coreInternal.spec.ts +++ b/test/contracts/core/extensions/coreInternal.spec.ts @@ -2,8 +2,6 @@ import * as chai from 'chai'; import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; -import { BigNumber } from 'bignumber.js'; -import { ether } from '../../../../utils/units'; // Types import { Address } from '../../../../types/common.js'; @@ -12,7 +10,6 @@ import { Address } from '../../../../types/common.js'; import { CoreContract } from '../../../../types/generated/core'; import { SetTokenContract } from '../../../../types/generated/set_token'; import { SetTokenFactoryContract } from '../../../../types/generated/set_token_factory'; -import { StandardTokenMockContract } from '../../../../types/generated/standard_token_mock'; import { TransferProxyContract } from '../../../../types/generated/transfer_proxy'; import { VaultContract } from '../../../../types/generated/vault'; @@ -223,7 +220,6 @@ contract('CoreInternal', accounts => { describe('#disableSet', async () => { let setToken: SetTokenContract; - let setToken2: SetTokenContract; let subjectCaller: Address; beforeEach(async () => { @@ -235,14 +231,17 @@ contract('CoreInternal', accounts => { const components = await erc20Wrapper.deployTokensAsync(2, ownerAccount); const componentAddresses = _.map(components, token => token.address); const componentUnits = _.map(components, () => STANDARD_NATURAL_UNIT); // Multiple of naturalUnit - setToken = await coreWrapper.createSetTokenAsync( + + // Deploy another Set for branch coverage + await coreWrapper.createSetTokenAsync( core, setTokenFactory.address, componentAddresses, componentUnits, STANDARD_NATURAL_UNIT, ); - setToken2 = await coreWrapper.createSetTokenAsync( + + setToken = await coreWrapper.createSetTokenAsync( core, setTokenFactory.address, componentAddresses, @@ -255,7 +254,7 @@ contract('CoreInternal', accounts => { async function subject(): Promise { return core.disableSet.sendTransactionAsync( - setToken2.address, + setToken.address, { from: subjectCaller }, ); } @@ -263,7 +262,7 @@ contract('CoreInternal', accounts => { it('disables set token address correctly', async () => { await subject(); - const isSetValid = await core.validSets.callAsync(setToken2.address); + const isSetValid = await core.validSets.callAsync(setToken.address); expect(isSetValid).to.be.false; }); @@ -271,7 +270,7 @@ contract('CoreInternal', accounts => { await subject(); const approvedSetTokens = await core.setTokens.callAsync(); - expect(approvedSetTokens).to.not.include(setToken2.address); + expect(approvedSetTokens).to.not.include(setToken.address); expect(approvedSetTokens.length).to.equal(1); }); diff --git a/test/contracts/core/extensions/coreIssuance.spec.ts b/test/contracts/core/extensions/coreIssuance.spec.ts index 8a01783e2..e5679f12f 100644 --- a/test/contracts/core/extensions/coreIssuance.spec.ts +++ b/test/contracts/core/extensions/coreIssuance.spec.ts @@ -28,7 +28,7 @@ import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { assertLogEquivalence, @@ -55,7 +55,6 @@ contract('CoreIssuance', accounts => { const [ ownerAccount, otherAccount, - unauthorizedAccount, ] = accounts; let core: CoreContract; @@ -115,7 +114,7 @@ contract('CoreIssuance', accounts => { return core.issue.sendTransactionAsync( subjectSetToIssue, subjectQuantityToIssue, - { from: ownerAccount }, + { from: subjectCaller }, ); } @@ -240,8 +239,6 @@ contract('CoreIssuance', accounts => { }); it('updates the vault balance of the component for the user by the correct amount', async () => { - const existingVaultBalance = await vault.balances.callAsync(alreadyDepositedComponent.address, ownerAccount); - await subject(); const requiredQuantityToIssue = subjectQuantityToIssue.div(naturalUnit).mul(componentUnit); @@ -384,7 +381,7 @@ contract('CoreIssuance', accounts => { return core.redeem.sendTransactionAsync( subjectSetToRedeem, subjectQuantityToRedeem, - { from: ownerAccount }, + { from: subjectCaller }, ); } @@ -514,12 +511,13 @@ contract('CoreIssuance', accounts => { subjectSetToRedeem, subjectQuantityToRedeem, subjectComponentsToWithdrawMask, - { from: ownerAccount }, + { from: subjectCaller }, ); } it('decrements the balance of the tokens owned by set in vault', async () => { - const existingVaultBalances = await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, subjectSetToRedeem); + const existingVaultBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, subjectSetToRedeem); await subject(); @@ -527,7 +525,8 @@ contract('CoreIssuance', accounts => { const requiredQuantityToRedeem = subjectQuantityToRedeem.div(naturalUnit).mul(componentUnits[idx]); return existingVaultBalances[idx].sub(requiredQuantityToRedeem); }); - const newVaultBalances = await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, subjectSetToRedeem); + const newVaultBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, subjectSetToRedeem); expect(newVaultBalances).to.eql(expectedVaultBalances); }); @@ -575,7 +574,8 @@ contract('CoreIssuance', accounts => { it('increments the balances of the remaining tokens back to the user in vault', async () => { const remainingComponents = _.tail(components); - const existingBalances = await coreWrapper.getVaultBalancesForTokensForOwner(remainingComponents, vault, subjectSetToRedeem); + const existingBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(remainingComponents, vault, subjectSetToRedeem); await subject(); @@ -583,7 +583,8 @@ contract('CoreIssuance', accounts => { const requiredQuantityToRedeem = subjectQuantityToRedeem.div(naturalUnit).mul(componentUnits[idx]); return existingBalances[idx].sub(requiredQuantityToRedeem); }); - const newVaultBalances = await coreWrapper.getVaultBalancesForTokensForOwner(remainingComponents, vault, subjectSetToRedeem); + const newVaultBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(remainingComponents, vault, subjectSetToRedeem); expect(newVaultBalances).to.eql(expectedVaultBalances); }); }); @@ -594,7 +595,8 @@ contract('CoreIssuance', accounts => { }); it('increments the balances of the tokens back to the user in vault', async () => { - const existingVaultBalances = await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, ownerAccount); + const existingVaultBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, ownerAccount); await subject(); @@ -602,7 +604,8 @@ contract('CoreIssuance', accounts => { const requiredQuantityToRedeem = subjectQuantityToRedeem.div(naturalUnit).mul(componentUnits[idx]); return existingVaultBalances[idx].add(requiredQuantityToRedeem); }); - const newVaultBalances = await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, ownerAccount); + const newVaultBalances = + await coreWrapper.getVaultBalancesForTokensForOwner(components, vault, ownerAccount); expect(newVaultBalances).to.eql(expectedVaultBalances); }); }); diff --git a/test/contracts/core/extensions/coreIssuanceOrder.spec.ts b/test/contracts/core/extensions/coreIssuanceOrder.spec.ts index 50dfe0786..945794dc0 100644 --- a/test/contracts/core/extensions/coreIssuanceOrder.spec.ts +++ b/test/contracts/core/extensions/coreIssuanceOrder.spec.ts @@ -46,11 +46,7 @@ import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; - -import { - IssuanceComponentDeposited, -} from '../../../../utils/contract_logs/core'; +const { expect } = chai; import { assertTokenBalance, @@ -72,8 +68,6 @@ contract('CoreIssuanceOrder', accounts => { makerAccount, signerAccount, relayerAccount, - mockSetTokenAccount, - mockTokenAccount, ] = accounts; let core: CoreContract; @@ -120,12 +114,9 @@ contract('CoreIssuanceOrder', accounts => { let setAddress: Address; let makerAddress: Address; - let signerAddress: Address; let relayerAddress: Address; let componentAddresses: Address[]; let defaultComponentAmounts: BigNumber[]; - let requiredComponents: Address[]; - let requiredComponentAmounts: BigNumber[]; let orderQuantity: BigNumber; let makerToken: StandardTokenMockContract; let relayerToken: StandardTokenMockContract; @@ -144,9 +135,19 @@ contract('CoreIssuanceOrder', accounts => { await erc20Wrapper.approveTransfersAsync(deployedTokens, transferProxy.address, takerAccount); // Give taker all tokens - await erc20Wrapper.transferTokensAsync(deployedTokens, takerAccount, DEPLOYED_TOKEN_QUANTITY.div(2), ownerAccount); + await erc20Wrapper.transferTokensAsync( + deployedTokens, + takerAccount, + DEPLOYED_TOKEN_QUANTITY.div(2), + ownerAccount + ); // Give maker their maker and relayer tokens - await erc20Wrapper.transferTokensAsync(deployedTokens.slice(2, 4), signerAccount, DEPLOYED_TOKEN_QUANTITY.div(2), ownerAccount); + await erc20Wrapper.transferTokensAsync( + deployedTokens.slice(2, 4), + signerAccount, + DEPLOYED_TOKEN_QUANTITY.div(2), + ownerAccount + ); const componentTokens = deployedTokens.slice(0, 2); componentAddresses = _.map(componentTokens, token => token.address); @@ -168,10 +169,10 @@ contract('CoreIssuanceOrder', accounts => { issuanceOrderParams = await generateFillOrderParameters( setAddress || setToken.address, - signerAddress || signerAccount, + signerAccount, makerAddress || signerAccount, - requiredComponents || componentAddresses, - requiredComponentAmounts || defaultComponentAmounts, + componentAddresses, + defaultComponentAmounts, makerToken.address, relayerAddress, relayerToken.address, @@ -216,7 +217,6 @@ contract('CoreIssuanceOrder', accounts => { await subject(); const fullMakerTokenAmount = ether(10); - const newBalance = await makerToken.balanceOf.callAsync(signerAccount); const expectedNewBalance = existingBalance.sub(fullMakerTokenAmount); await assertTokenBalance(makerToken, expectedNewBalance, signerAccount); }); @@ -233,7 +233,6 @@ contract('CoreIssuanceOrder', accounts => { }); it('transfers the fees to the relayer', async () => { - const existingBalance = await relayerToken.balanceOf.callAsync(relayerAddress); await assertTokenBalance(relayerToken, ZERO, relayerAddress); await subject(); @@ -293,7 +292,6 @@ contract('CoreIssuanceOrder', accounts => { await subject(); const partialMakerTokenAmount = ether(10).mul(subjectQuantityToIssue).div(ether(4)); - const newBalance = await makerToken.balanceOf.callAsync(signerAccount); const expectedNewBalance = existingBalance.sub(partialMakerTokenAmount); await assertTokenBalance(makerToken, expectedNewBalance, signerAccount); }); @@ -310,7 +308,6 @@ contract('CoreIssuanceOrder', accounts => { }); it('transfers the partial fees to the relayer', async () => { - const existingBalance = await relayerToken.balanceOf.callAsync(relayerAddress); await assertTokenBalance(relayerToken, ZERO, relayerAddress); await subject(); @@ -537,17 +534,11 @@ contract('CoreIssuanceOrder', accounts => { describe('#cancelOrder', async () => { let subjectCaller: Address; let subjectQuantityToCancel: BigNumber; - let subjectExchangeOrdersData: Bytes32; let setToken: SetTokenContract; - let setAddress: Address; - let makerAddress: Address; - let signerAddress: Address; let relayerAddress: Address; let componentAddresses: Address[]; let defaultComponentAmounts: BigNumber[]; - let requiredComponents: Address[]; - let requiredComponentAmounts: BigNumber[]; let orderQuantity: BigNumber; let makerTokenAmount: BigNumber; let makerToken: StandardTokenMockContract; @@ -558,11 +549,11 @@ contract('CoreIssuanceOrder', accounts => { beforeEach(async () => { const naturalUnit = ether(2); - signerAddress = signerAccount; relayerAddress = relayerAccount; - const components = await erc20Wrapper.deployTokensAsync(4, signerAddress); //For current purposes issue to maker/signer - await erc20Wrapper.approveTransfersAsync(components, transferProxy.address, signerAddress); + // For current purposes issue to maker/signer + const components = await erc20Wrapper.deployTokensAsync(4, signerAccount); + await erc20Wrapper.approveTransfersAsync(components, transferProxy.address, signerAccount); componentAddresses = _.map(components, token => token.address); const componentUnits = _.map(components, () => ether(4)); // Multiple of naturalUnit @@ -574,7 +565,8 @@ contract('CoreIssuanceOrder', accounts => { naturalUnit, ); - defaultComponentAmounts = _.map(componentUnits, unit => unit.mul(ether(4))); //ether(4) for now but will be orderQuantity + // ether(4) for now but will be orderQuantity + defaultComponentAmounts = _.map(componentUnits, unit => unit.mul(ether(4))); await coreWrapper.registerDefaultExchanges(core); makerToken = components[2]; @@ -583,11 +575,11 @@ contract('CoreIssuanceOrder', accounts => { subjectCaller = signerAccount; subjectQuantityToCancel = ether(2); issuanceOrderParams = await generateFillOrderParameters( - setAddress || setToken.address, - signerAddress || signerAccount, - makerAddress || signerAccount, - requiredComponents || componentAddresses, - requiredComponentAmounts || defaultComponentAmounts, + setToken.address, + signerAccount, + signerAccount, + componentAddresses, + defaultComponentAmounts, makerToken.address, relayerAddress, relayerToken.address, @@ -697,7 +689,7 @@ contract('CoreIssuanceOrder', accounts => { }); }); - describe('when the Set Token quantity in Issuance Order is not a multiple of the natural unit of the set', async () => { + describe('when Set Token quantity in IssuanceOrder not a multiple of natural unit of set', async () => { before(async () => { orderQuantity = ether(5); }); diff --git a/test/contracts/core/lib/orderLibrary.spec.ts b/test/contracts/core/lib/orderLibrary.spec.ts index e30efc128..74fcc3cfa 100644 --- a/test/contracts/core/lib/orderLibrary.spec.ts +++ b/test/contracts/core/lib/orderLibrary.spec.ts @@ -1,7 +1,5 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; import { ether } from '../../../../utils/units'; @@ -11,9 +9,6 @@ import { Address } from '../../../../types/common.js'; // Contract types import { OrderLibraryMockContract } from '../../../../types/generated/order_library_mock'; -// Artifacts -const OrderLibraryMock = artifacts.require('OrderLibraryMock'); - // Core wrapper import { CoreWrapper } from '../../../../utils/coreWrapper'; import { @@ -25,11 +20,7 @@ import { BigNumberSetup } from '../../../../utils/bigNumberSetup'; import ChaiSetup from '../../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; - -import { - expectRevertError, -} from '../../../../utils/tokenAssertions'; +const { expect } = chai; import { ZERO, diff --git a/test/contracts/core/setToken.spec.ts b/test/contracts/core/setToken.spec.ts index 93760dd27..00bfb5a43 100644 --- a/test/contracts/core/setToken.spec.ts +++ b/test/contracts/core/setToken.spec.ts @@ -1,6 +1,5 @@ import * as chai from 'chai'; import * as _ from 'lodash'; -import * as ethUtil from 'ethereumjs-util'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; @@ -11,14 +10,11 @@ import { Address } from '../../../types/common.js'; // Contract types import { StandardTokenMockContract } from '../../../types/generated/standard_token_mock'; -import { StandardTokenWithFeeMockContract } from '../../../types/generated/standard_token_with_fee_mock'; import { SetTokenFactoryContract } from '../../../types/generated/set_token_factory'; import { SetTokenContract } from '../../../types/generated/set_token'; // Artifacts const SetToken = artifacts.require('SetToken'); -const StandardTokenMock = artifacts.require('StandardTokenMock'); -const StandardTokenWithFeeMock = artifacts.require('StandardTokenWithFeeMock'); // Core wrapper import { CoreWrapper } from '../../../utils/coreWrapper'; @@ -29,9 +25,8 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; -import { getFormattedLogsFromTxHash } from '../../../utils/logs'; import { assertTokenBalance, expectRevertError } from '../../../utils/tokenAssertions'; import { diff --git a/test/contracts/core/setTokenFactory.spec.ts b/test/contracts/core/setTokenFactory.spec.ts index cb70353b0..b941543cb 100644 --- a/test/contracts/core/setTokenFactory.spec.ts +++ b/test/contracts/core/setTokenFactory.spec.ts @@ -1,5 +1,4 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; @@ -8,7 +7,6 @@ import { BigNumber } from 'bignumber.js'; import { Address } from '../../../types/common.js'; // Contract types -import { StandardTokenContract } from '../../../types/generated/standard_token'; import { StandardTokenMockContract } from '../../../types/generated/standard_token_mock'; import { SetTokenFactoryContract } from '../../../types/generated/set_token_factory'; @@ -24,7 +22,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { expectRevertError } from '../../../utils/tokenAssertions'; import { ZERO } from '../../../utils/constants'; diff --git a/test/contracts/core/transferProxy.spec.ts b/test/contracts/core/transferProxy.spec.ts index 3682ca979..19a8bcb9f 100644 --- a/test/contracts/core/transferProxy.spec.ts +++ b/test/contracts/core/transferProxy.spec.ts @@ -1,5 +1,4 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; @@ -10,7 +9,6 @@ import { Address } from '../../../types/common.js'; // Contract types import { InvalidReturnTokenMockContract } from '../../../types/generated/invalid_return_token_mock'; import { NoXferReturnTokenMockContract } from '../../../types/generated/no_xfer_return_token_mock'; -import { StandardTokenContract } from '../../../types/generated/standard_token'; import { StandardTokenMockContract } from '../../../types/generated/standard_token_mock'; import { StandardTokenWithFeeMockContract } from '../../../types/generated/standard_token_with_fee_mock'; import { TransferProxyContract } from '../../../types/generated/transfer_proxy'; @@ -27,7 +25,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { assertTokenBalance, diff --git a/test/contracts/core/vault.spec.ts b/test/contracts/core/vault.spec.ts index 0ea2cd9fe..74226de82 100644 --- a/test/contracts/core/vault.spec.ts +++ b/test/contracts/core/vault.spec.ts @@ -1,14 +1,11 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; // Types import { Address } from '../../../types/common.js'; // Contract types -import { BadTokenMockContract } from '../../../types/generated/bad_token_mock'; import { InvalidReturnTokenMockContract } from '../../../types/generated/invalid_return_token_mock'; import { NoXferReturnTokenMockContract } from '../../../types/generated/no_xfer_return_token_mock'; import { StandardTokenMockContract } from '../../../types/generated/standard_token_mock'; @@ -20,7 +17,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { CoreWrapper } from '../../../utils/coreWrapper'; import { ERC20Wrapper } from '../../../utils/erc20Wrapper'; @@ -66,7 +63,7 @@ contract('Vault', accounts => { subjectAmountToWithdraw = DEPLOYED_TOKEN_QUANTITY; subjectCaller = authorizedAccount; subjectReceiver = ownerAccount; - subjectTokenAddress = null; + subjectTokenAddress = undefined; }); async function subject(): Promise { @@ -123,7 +120,7 @@ contract('Vault', accounts => { }); }); - describe('when the receiver is not null address', async () => { + describe('when the receiver is not undefined address', async () => { beforeEach(async () => { subjectReceiver = NULL_ADDRESS; }); @@ -341,7 +338,7 @@ contract('Vault', accounts => { afterEach(async () => { subjectCaller = ownerAccount; - subjectTokenAddress = null; + subjectTokenAddress = undefined; }); async function subject(): Promise { diff --git a/test/contracts/lib/authorizable.spec.ts b/test/contracts/lib/authorizable.spec.ts index f48a34b93..5c2038075 100644 --- a/test/contracts/lib/authorizable.spec.ts +++ b/test/contracts/lib/authorizable.spec.ts @@ -1,5 +1,4 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; @@ -21,7 +20,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { assertLogEquivalence, @@ -49,7 +48,6 @@ contract('Authorizable', accounts => { authAccount1, authAccount2, ] = accounts; - const TX_DEFAULTS = { from: ownerAccount, gas: 7000000 }; let authorizableContract: AuthorizableContract; const coreWrapper = new CoreWrapper(ownerAccount, ownerAccount); diff --git a/test/contracts/lib/commonMath.spec.ts b/test/contracts/lib/commonMath.spec.ts index c7521cd4b..aea997142 100644 --- a/test/contracts/lib/commonMath.spec.ts +++ b/test/contracts/lib/commonMath.spec.ts @@ -1,7 +1,5 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; // Types @@ -18,7 +16,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; contract('CommonMathMock', accounts => { @@ -36,14 +34,15 @@ contract('CommonMathMock', accounts => { async function subject(): Promise { return commonMathLibrary.testMaxUInt256.callAsync( - { from: ownerAccount }, + { from: caller }, ); } it('returns the max allowed integer', async () => { const maxUInt256 = await subject(); - const expectedMaxUInt256 = new BigNumber('1.15792089237316195423570985008687907853269984665640564039457584007913129639935e+77'); + const expectedMaxUInt256 = + new BigNumber('1.15792089237316195423570985008687907853269984665640564039457584007913129639935e+77'); expect(maxUInt256).to.be.bignumber.equal(expectedMaxUInt256); }); }); diff --git a/test/contracts/lib/erc20Wrapper.spec.ts b/test/contracts/lib/erc20Wrapper.spec.ts index 3bf1f9636..0b9f07a54 100644 --- a/test/contracts/lib/erc20Wrapper.spec.ts +++ b/test/contracts/lib/erc20Wrapper.spec.ts @@ -1,7 +1,5 @@ import * as chai from 'chai'; -import * as _ from 'lodash'; -import * as ABIDecoder from 'abi-decoder'; import { BigNumber } from 'bignumber.js'; import { ether } from '../../../utils/units'; @@ -22,7 +20,7 @@ import { BigNumberSetup } from '../../../utils/bigNumberSetup'; import ChaiSetup from '../../../utils/chaiSetup'; BigNumberSetup.configure(); ChaiSetup.configure(); -const { expect, assert } = chai; +const { expect } = chai; import { expectRevertError @@ -64,7 +62,7 @@ contract('ERC20WrapperMock', accounts => { subjectTokenAddress, spenderAccount, subjectTransferAllowance, - { from: ownerAccount }, + { from: caller }, ); } @@ -81,7 +79,7 @@ contract('ERC20WrapperMock', accounts => { erc20WrapperLibrary.address, spenderAccount ); - expect(newSpenderAllowance).to.bignumber.equal(subjectTransferAllowance); + expect(newSpenderAllowance).to.bignumber.equal(expectedNewAllowance); }); describe('#when the token has an invalid return', async () => { @@ -112,7 +110,7 @@ contract('ERC20WrapperMock', accounts => { token.address, ownerAccount, spenderAccount, - { from: ownerAccount }, + { from: caller }, ); } @@ -143,20 +141,36 @@ contract('ERC20WrapperMock', accounts => { it('approves the spender on behalf of the calling contract', async () => { await subject(); - const allowance = await erc20WrapperLibrary.allowance.callAsync(token.address, erc20WrapperLibrary.address, spenderAccount, { from: ownerAccount }); + const allowance = + await erc20WrapperLibrary.allowance.callAsync( + token.address, + erc20WrapperLibrary.address, + spenderAccount, + { from: ownerAccount } + ); expect(allowance).to.bignumber.equal(UNLIMITED_ALLOWANCE_IN_BASE_UNITS); }); describe('#when the token has already been approved', async () => { beforeEach(async () => { - await erc20WrapperLibrary.approve.sendTransactionAsync(token.address, spenderAccount, ether(11), {from: ownerAccount}); + await erc20WrapperLibrary.approve.sendTransactionAsync( + token.address, + spenderAccount, + ether(11), + { from: ownerAccount }); }); it('should not alter the allowance', async () => { await subject(); - const allowance = await erc20WrapperLibrary.allowance.callAsync(token.address, erc20WrapperLibrary.address, spenderAccount, { from: ownerAccount }); + const allowance = + await erc20WrapperLibrary.allowance.callAsync( + token.address, + erc20WrapperLibrary.address, + spenderAccount, + { from: ownerAccount } + ); expect(allowance).to.bignumber.equal(ether(11)); }); }); diff --git a/utils/contract_logs/authorizable.ts b/utils/contract_logs/authorizable.ts index 78b05de2f..0db4bbf9c 100644 --- a/utils/contract_logs/authorizable.ts +++ b/utils/contract_logs/authorizable.ts @@ -1,6 +1,3 @@ -import * as _ from 'lodash'; -import * as LogUtils from '../logs'; - import { Address, Log } from '../../types/common'; diff --git a/utils/contract_logs/core.ts b/utils/contract_logs/core.ts index ce83743ca..3d4ba2330 100644 --- a/utils/contract_logs/core.ts +++ b/utils/contract_logs/core.ts @@ -1,8 +1,6 @@ -import * as _ from 'lodash'; -import * as LogUtils from '../logs'; import { BigNumber } from 'bignumber.js'; -import { Address, Log, UInt } from '../../types/common'; +import { Address, Log } from '../../types/common'; interface CreateLogArgs { _setTokenAddress: Address; @@ -58,7 +56,7 @@ export function IssuanceComponentDeposited( export function ExchangeRegistered( _coreAddress: Address, - _exchangeId: UInt, + _exchangeId: BigNumber, _exchange: Address, ): Log { return { diff --git a/utils/contract_logs/coreIssuanceOrder.ts b/utils/contract_logs/coreIssuanceOrder.ts index 07e175cdf..1588be5cf 100644 --- a/utils/contract_logs/coreIssuanceOrder.ts +++ b/utils/contract_logs/coreIssuanceOrder.ts @@ -1,6 +1,3 @@ -import * as _ from 'lodash'; -import * as LogUtils from '../logs'; - import { Address, Log, Bytes32 } from '../../types/common'; import { BigNumber } from 'bignumber.js'; diff --git a/yarn.lock b/yarn.lock index 59768651b..41fd8cbb6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -65,6 +65,12 @@ lodash "4.17.10" web3 "0.20.6" +"@samverschueren/stream-to-observable@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + dependencies: + any-observable "^0.3.0" + "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -247,7 +253,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.1: +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: @@ -261,6 +267,10 @@ any-observable@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" +any-observable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -275,6 +285,10 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" +app-root-path@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.1.0.tgz#98bf6599327ecea199309866e8140368fd2e646a" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -1446,6 +1460,14 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.3.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.4.0.tgz#5199a3ddcd0c1efe23bc08c1b027b06176e0c64f" @@ -1505,6 +1527,10 @@ chownr@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" +ci-info@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -1674,6 +1700,10 @@ commander@^2.11.0, commander@^2.12.1, commander@^2.9.0: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" +commander@^2.14.1: + version "2.16.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -1734,6 +1764,14 @@ cosmiconfig@^3.1.0: parse-json "^3.0.0" require-from-string "^2.0.1" +cosmiconfig@^5.0.2: + version "5.0.5" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.5.tgz#a809e3c2306891ce17ab70359dc8bdf661fe2cd0" + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + coveralls@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.1.tgz#12e15914eaa29204e56869a5ece7b9e1492d2ae2" @@ -1898,6 +1936,10 @@ decompress-response@^3.2.0, decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + deep-eql@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" @@ -2447,6 +2489,18 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -2610,6 +2664,10 @@ find-line-column@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/find-line-column/-/find-line-column-0.5.2.tgz#db00238ff868551a182e74a103416d295a98c8ca" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + find-root@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -2798,6 +2856,10 @@ get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" +get-own-enumerable-property-symbols@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" + get-stream@3.0.0, get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -3211,6 +3273,14 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" +husky@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" + dependencies: + is-ci "^1.0.10" + normalize-path "^1.0.0" + strip-indent "^2.0.0" + iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.21" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.21.tgz#c47f8733d02171189ebc4a400f3218d348094798" @@ -3432,6 +3502,12 @@ is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" +is-ci@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + dependencies: + ci-info "^1.0.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -3554,6 +3630,10 @@ is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" @@ -3564,6 +3644,12 @@ is-observable@^0.2.0: dependencies: symbol-observable "^0.2.2" +is-observable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + dependencies: + symbol-observable "^1.1.0" + is-odd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" @@ -3614,6 +3700,10 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -3715,6 +3805,19 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-validate@^23.0.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.4.0.tgz#d96eede01ef03ac909c009e9c8e455197d48c201" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.2.0" + js-sha3@0.5.5: version "0.5.5" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.5.tgz#baf0c0e8c54ad5903447df96ade7a4a1bca79a4a" @@ -3978,6 +4081,10 @@ levelup@^1.2.1: semver "~5.4.1" xtend "~4.0.0" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -3985,6 +4092,34 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lint-staged@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.2.0.tgz#bdf4bb7f2f37fe689acfaec9999db288a5b26888" + dependencies: + app-root-path "^2.0.1" + chalk "^2.3.1" + commander "^2.14.1" + cosmiconfig "^5.0.2" + debug "^3.1.0" + dedent "^0.7.0" + execa "^0.9.0" + find-parent-dir "^0.3.0" + is-glob "^4.0.0" + is-windows "^1.0.2" + jest-validate "^23.0.0" + listr "^0.14.1" + lodash "^4.17.5" + log-symbols "^2.2.0" + micromatch "^3.1.8" + npm-which "^3.0.1" + p-map "^1.1.1" + path-is-inside "^1.0.2" + pify "^3.0.0" + please-upgrade-node "^3.0.2" + staged-git-files "1.1.1" + string-argv "^0.0.2" + stringify-object "^3.2.2" + listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" @@ -4033,6 +4168,27 @@ listr@^0.13.0: stream-to-observable "^0.2.0" strip-ansi "^3.0.1" +listr@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.1.tgz#8a7afa4a7135cee4c921d128e0b7dfc6e522d43d" + dependencies: + "@samverschueren/stream-to-observable" "^0.3.0" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-observable "^1.1.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.4.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + p-map "^1.1.1" + rxjs "^6.1.0" + strip-ansi "^3.0.1" + load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" @@ -4258,7 +4414,7 @@ micromatch@^2.1.5, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.4: +micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: @@ -4535,6 +4691,10 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -4560,12 +4720,26 @@ npm-packlist@^1.1.6: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npm-path@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" + dependencies: + which "^1.2.10" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" dependencies: path-key "^2.0.0" +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -4960,6 +5134,12 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" +please-upgrade-node@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + dependencies: + semver-compare "^1.0.0" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" @@ -4992,6 +5172,13 @@ pretty-bytes@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" +pretty-format@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.2.0.tgz#3b0aaa63c018a53583373c1cb3a5d96cc5e83017" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + private@^0.1.6, private@^0.1.7, private@^0.1.8, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -5537,6 +5724,12 @@ rxjs@^5.4.2, rxjs@^5.5.2: dependencies: symbol-observable "1.0.1" +rxjs@^6.1.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" + dependencies: + tslib "^1.9.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -5603,6 +5796,10 @@ semaphore@>=1.0.1, semaphore@^1.0.3: version "1.1.0" resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -5947,6 +6144,10 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +staged-git-files@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -5981,6 +6182,10 @@ strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" +string-argv@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" + string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" @@ -6018,6 +6223,14 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +stringify-object@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" + dependencies: + get-own-enumerable-property-symbols "^2.0.1" + is-obj "^1.0.1" + is-regexp "^1.0.0" + stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -6065,6 +6278,10 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -6099,6 +6316,10 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" +symbol-observable@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -6332,7 +6553,7 @@ tslib@1.9.0, tslib@^1.8.0, tslib@^1.8.1: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" -tslib@^1.7.1: +tslib@^1.7.1, tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" @@ -6764,6 +6985,12 @@ which@^1.1.1, which@^1.2.14, which@^1.2.9: dependencies: isexe "^2.0.0" +which@^1.2.10: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710"