diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-04-16 22:38:55 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-04-16 23:43:59 +0800 |
commit | d8ef76fd5efe63ec8f6205a73494ce388e64391f (patch) | |
tree | 22a5740584029830e37961136e229938b8f735f4 /packages | |
parent | e5cf41b3134d6cd5fdda995aa81ec23e51bb5145 (diff) | |
download | dexon-0x-contracts-d8ef76fd5efe63ec8f6205a73494ce388e64391f.tar.gz dexon-0x-contracts-d8ef76fd5efe63ec8f6205a73494ce388e64391f.tar.zst dexon-0x-contracts-d8ef76fd5efe63ec8f6205a73494ce388e64391f.zip |
Rename resolver to sol-resolver
Diffstat (limited to 'packages')
-rw-r--r-- | packages/deployer/package.json | 2 | ||||
-rw-r--r-- | packages/deployer/src/compiler.ts | 2 | ||||
-rw-r--r-- | packages/deployer/src/utils/compiler.ts | 2 | ||||
-rw-r--r-- | packages/deployer/test/compiler_utils_test.ts | 29 | ||||
-rw-r--r-- | packages/deployer/test/fixtures/contracts/Exchange.sol | 2 | ||||
-rw-r--r-- | packages/deployer/test/fixtures/contracts/TokenTransferProxy.sol | 2 | ||||
-rw-r--r-- | packages/sol-cov/src/collect_contract_data.ts | 1 | ||||
-rw-r--r-- | packages/sol-resolver/package.json (renamed from packages/resolver/package.json) | 2 | ||||
-rw-r--r-- | packages/sol-resolver/src/index.ts (renamed from packages/resolver/src/index.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/enumerable_resolver.ts (renamed from packages/resolver/src/resolvers/enumerable_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/fallthrough_resolver.ts (renamed from packages/resolver/src/resolvers/fallthrough_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/fs_resolver.ts (renamed from packages/resolver/src/resolvers/fs_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/name_resolver.ts (renamed from packages/resolver/src/resolvers/name_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/npm_resolver.ts (renamed from packages/resolver/src/resolvers/npm_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/resolver.ts (renamed from packages/resolver/src/resolvers/resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/resolvers/url_resolver.ts (renamed from packages/resolver/src/resolvers/url_resolver.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/src/types.ts (renamed from packages/resolver/src/types.ts) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/tsconfig.json (renamed from packages/resolver/tsconfig.json) | 0 | ||||
-rw-r--r-- | packages/sol-resolver/tslint.json (renamed from packages/resolver/tslint.json) | 0 |
19 files changed, 25 insertions, 17 deletions
diff --git a/packages/deployer/package.json b/packages/deployer/package.json index d9f2a4a4f..d529382ac 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -68,7 +68,7 @@ "zeppelin-solidity": "1.8.0" }, "dependencies": { - "@0xproject/resolver": "^0.0.1", + "@0xproject/sol-resolver": "^0.0.1", "@0xproject/json-schemas": "^0.7.20", "@0xproject/types": "^0.6.0", "@0xproject/typescript-typings": "^0.1.0", diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts index dfbe469a7..a3c8004ec 100644 --- a/packages/deployer/src/compiler.ts +++ b/packages/deployer/src/compiler.ts @@ -8,7 +8,7 @@ import { NPMResolver, Resolver, URLResolver, -} from '@0xproject/resolver'; +} from '@0xproject/sol-resolver'; import { ContractAbi } from '@0xproject/types'; import { logUtils, promisify } from '@0xproject/utils'; import chalk from 'chalk'; diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts index 79dce5d73..c571b2581 100644 --- a/packages/deployer/src/utils/compiler.ts +++ b/packages/deployer/src/utils/compiler.ts @@ -1,4 +1,4 @@ -import { ContractSource, ContractSources } from '@0xproject/resolver'; +import { ContractSource, ContractSources } from '@0xproject/sol-resolver'; import { logUtils } from '@0xproject/utils'; import * as _ from 'lodash'; import * as path from 'path'; diff --git a/packages/deployer/test/compiler_utils_test.ts b/packages/deployer/test/compiler_utils_test.ts index 7e7ae1200..e2b95f289 100644 --- a/packages/deployer/test/compiler_utils_test.ts +++ b/packages/deployer/test/compiler_utils_test.ts @@ -47,24 +47,31 @@ describe('Compiler utils', () => { }); describe('#parseDependencies', () => { it('correctly parses Exchange dependencies', async () => { - const exchangeSource = await fsWrapper.readFileAsync(`${__dirname}/fixtures/contracts/Exchange.sol`, { + const path = `${__dirname}/fixtures/contracts/Exchange.sol`; + const source = await fsWrapper.readFileAsync(path, { encoding: 'utf8', }); - expect(parseDependencies(exchangeSource)).to.be.deep.equal(['ERC20', 'TokenTransferProxy', 'SafeMath']); + expect(parseDependencies({ source, path })).to.be.deep.equal([ + 'zeppelin-solidity/contracts/token/ERC20/ERC20.sol', + '/home/circleci/repo/packages/deployer/lib/test/fixtures/contracts/TokenTransferProxy.sol', + '/home/circleci/repo/packages/deployer/lib/test/fixtures/contracts/base/SafeMath.sol', + ]); }); it('correctly parses TokenTransferProxy dependencies', async () => { - const exchangeSource = await fsWrapper.readFileAsync( - `${__dirname}/fixtures/contracts/TokenTransferProxy.sol`, - { - encoding: 'utf8', - }, - ); - expect(parseDependencies(exchangeSource)).to.be.deep.equal(['Ownable', 'ERC20']); + const path = `${__dirname}/fixtures/contracts/TokenTransferProxy.sol`; + const source = await fsWrapper.readFileAsync(path, { + encoding: 'utf8', + }); + expect(parseDependencies({ source, path })).to.be.deep.equal([ + 'zeppelin-solidity/contracts/ownership/Ownable.sol', + 'zeppelin-solidity/contracts/token/ERC20/ERC20.sol', + ]); }); // TODO: For now that doesn't work. This will work after we switch to a grammar-based parser it.skip('correctly parses commented out dependencies', async () => { - const contractWithCommentedOutDependencies = `// import "./TokenTransferProxy.sol";`; - expect(parseDependencies(contractWithCommentedOutDependencies)).to.be.deep.equal([]); + const path = ''; + const source = `// import "./TokenTransferProxy.sol";`; + expect(parseDependencies({ path, source })).to.be.deep.equal([]); }); }); }); diff --git a/packages/deployer/test/fixtures/contracts/Exchange.sol b/packages/deployer/test/fixtures/contracts/Exchange.sol index 1249d21ed..e3725335b 100644 --- a/packages/deployer/test/fixtures/contracts/Exchange.sol +++ b/packages/deployer/test/fixtures/contracts/Exchange.sol @@ -1,6 +1,6 @@ /* - Copyright 2017 ZeroEx Intl. + Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/deployer/test/fixtures/contracts/TokenTransferProxy.sol b/packages/deployer/test/fixtures/contracts/TokenTransferProxy.sol index 1ba8a96de..44570d459 100644 --- a/packages/deployer/test/fixtures/contracts/TokenTransferProxy.sol +++ b/packages/deployer/test/fixtures/contracts/TokenTransferProxy.sol @@ -1,6 +1,6 @@ /* - Copyright 2017 ZeroEx Intl. + Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/sol-cov/src/collect_contract_data.ts b/packages/sol-cov/src/collect_contract_data.ts index da56e8d0d..1d8bc7178 100644 --- a/packages/sol-cov/src/collect_contract_data.ts +++ b/packages/sol-cov/src/collect_contract_data.ts @@ -12,6 +12,7 @@ export const collectContractsData = (artifactsPath: string, sourcesPath: string, const artifact = JSON.parse(fs.readFileSync(artifactFileName).toString()); const sources = artifact.networks[networkId].sources; const contractName = artifact.contract_name; + // We don't compute coverage for dependencies const sourceCodes = _.map(sources, (source: string) => fs.readFileSync(source).toString()); if (_.isUndefined(artifact.networks[networkId])) { throw new Error(`No ${contractName} artifacts found for networkId ${networkId}`); diff --git a/packages/resolver/package.json b/packages/sol-resolver/package.json index 107405cf8..ae1a94f3e 100644 --- a/packages/resolver/package.json +++ b/packages/sol-resolver/package.json @@ -1,5 +1,5 @@ { - "name": "@0xproject/resolver", + "name": "@0xproject/sol-resolver", "version": "0.0.1", "description": "Import resolver for smart contracts dependencies", "main": "lib/index.js", diff --git a/packages/resolver/src/index.ts b/packages/sol-resolver/src/index.ts index cd6ec42ec..cd6ec42ec 100644 --- a/packages/resolver/src/index.ts +++ b/packages/sol-resolver/src/index.ts diff --git a/packages/resolver/src/resolvers/enumerable_resolver.ts b/packages/sol-resolver/src/resolvers/enumerable_resolver.ts index 0efa43e7c..0efa43e7c 100644 --- a/packages/resolver/src/resolvers/enumerable_resolver.ts +++ b/packages/sol-resolver/src/resolvers/enumerable_resolver.ts diff --git a/packages/resolver/src/resolvers/fallthrough_resolver.ts b/packages/sol-resolver/src/resolvers/fallthrough_resolver.ts index 8f6af9be0..8f6af9be0 100644 --- a/packages/resolver/src/resolvers/fallthrough_resolver.ts +++ b/packages/sol-resolver/src/resolvers/fallthrough_resolver.ts diff --git a/packages/resolver/src/resolvers/fs_resolver.ts b/packages/sol-resolver/src/resolvers/fs_resolver.ts index 4f05fba88..4f05fba88 100644 --- a/packages/resolver/src/resolvers/fs_resolver.ts +++ b/packages/sol-resolver/src/resolvers/fs_resolver.ts diff --git a/packages/resolver/src/resolvers/name_resolver.ts b/packages/sol-resolver/src/resolvers/name_resolver.ts index 6849b7610..6849b7610 100644 --- a/packages/resolver/src/resolvers/name_resolver.ts +++ b/packages/sol-resolver/src/resolvers/name_resolver.ts diff --git a/packages/resolver/src/resolvers/npm_resolver.ts b/packages/sol-resolver/src/resolvers/npm_resolver.ts index 2c0a44aad..2c0a44aad 100644 --- a/packages/resolver/src/resolvers/npm_resolver.ts +++ b/packages/sol-resolver/src/resolvers/npm_resolver.ts diff --git a/packages/resolver/src/resolvers/resolver.ts b/packages/sol-resolver/src/resolvers/resolver.ts index 7edc9a85d..7edc9a85d 100644 --- a/packages/resolver/src/resolvers/resolver.ts +++ b/packages/sol-resolver/src/resolvers/resolver.ts diff --git a/packages/resolver/src/resolvers/url_resolver.ts b/packages/sol-resolver/src/resolvers/url_resolver.ts index 180b0c9f6..180b0c9f6 100644 --- a/packages/resolver/src/resolvers/url_resolver.ts +++ b/packages/sol-resolver/src/resolvers/url_resolver.ts diff --git a/packages/resolver/src/types.ts b/packages/sol-resolver/src/types.ts index 41492622d..41492622d 100644 --- a/packages/resolver/src/types.ts +++ b/packages/sol-resolver/src/types.ts diff --git a/packages/resolver/tsconfig.json b/packages/sol-resolver/tsconfig.json index f5f4b37c2..f5f4b37c2 100644 --- a/packages/resolver/tsconfig.json +++ b/packages/sol-resolver/tsconfig.json diff --git a/packages/resolver/tslint.json b/packages/sol-resolver/tslint.json index ffaefe83a..ffaefe83a 100644 --- a/packages/resolver/tslint.json +++ b/packages/sol-resolver/tslint.json |