aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-07 09:07:22 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-07 09:07:22 +0800
commit2af6d3f6bc03932f53d199971694c3c0d9441ba8 (patch)
treeb17f3343a635aa72a917b89f278f63924e25da3e /packages/sol-compiler
parentcbe5438a31a54a92a198b2cc5ad8a5d5feb033b4 (diff)
parent67c4ad128c405692e471274148c9a2ef7cd8b6ca (diff)
downloaddexon-0x-contracts-2af6d3f6bc03932f53d199971694c3c0d9441ba8.tar.gz
dexon-0x-contracts-2af6d3f6bc03932f53d199971694c3c0d9441ba8.tar.zst
dexon-0x-contracts-2af6d3f6bc03932f53d199971694c3c0d9441ba8.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances
Diffstat (limited to 'packages/sol-compiler')
-rw-r--r--packages/sol-compiler/package.json8
-rw-r--r--packages/sol-compiler/src/cli.ts7
-rw-r--r--packages/sol-compiler/src/compiler.ts17
-rw-r--r--packages/sol-compiler/src/utils/compiler.ts4
-rw-r--r--packages/sol-compiler/src/utils/types.ts3
-rw-r--r--packages/sol-compiler/test/compiler_test.ts2
-rw-r--r--packages/sol-compiler/test/util/provider.ts1
7 files changed, 10 insertions, 32 deletions
diff --git a/packages/sol-compiler/package.json b/packages/sol-compiler/package.json
index 8d26179b5..0bd51972d 100644
--- a/packages/sol-compiler/package.json
+++ b/packages/sol-compiler/package.json
@@ -8,10 +8,12 @@
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
- "watch": "tsc -w",
- "build": "yarn clean && copyfiles 'test/fixtures/contracts/**/*' ./lib && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
+ "watch_without_deps": "yarn pre_build && tsc -w",
+ "build": "yarn pre_build && tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
+ "pre_build": "run-s update_contract_fixtures",
+ "update_contract_fixtures": "copyfiles 'test/fixtures/contracts/**/*' ./lib",
"test": "yarn run_mocha",
- "rebuild-and-test": "run-s build test",
+ "rebuild_and_test": "run-s build test",
"run_mocha": "mocha lib/test/*_test.js --bail --exit",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
diff --git a/packages/sol-compiler/src/cli.ts b/packages/sol-compiler/src/cli.ts
index b97cf4cab..8901c0a31 100644
--- a/packages/sol-compiler/src/cli.ts
+++ b/packages/sol-compiler/src/cli.ts
@@ -1,16 +1,11 @@
#!/usr/bin/env node
// We need the above pragma since this script will be run as a command-line tool.
-import { BigNumber, logUtils } from '@0xproject/utils';
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { logUtils } from '@0xproject/utils';
import * as _ from 'lodash';
-import * as path from 'path';
-import * as Web3 from 'web3';
import * as yargs from 'yargs';
import { Compiler } from './compiler';
-import { constants } from './utils/constants';
-import { CompilerOptions } from './utils/types';
const DEFAULT_CONTRACTS_LIST = '*';
const SEPARATOR = ',';
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index d2dda75ea..bb701a8ce 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -1,8 +1,5 @@
import { assert } from '@0xproject/assert';
import {
- ContractSource,
- ContractSources,
- EnumerableResolver,
FallthroughResolver,
FSResolver,
NameResolver,
@@ -11,9 +8,8 @@ import {
Resolver,
URLResolver,
} from '@0xproject/sol-resolver';
-import { logUtils, promisify } from '@0xproject/utils';
+import { logUtils } from '@0xproject/utils';
import chalk from 'chalk';
-import { ContractAbi } from 'ethereum-types';
import * as ethUtil from 'ethereumjs-util';
import * as fs from 'fs';
import 'isomorphic-fetch';
@@ -34,15 +30,7 @@ import {
} from './utils/compiler';
import { constants } from './utils/constants';
import { fsWrapper } from './utils/fs_wrapper';
-import {
- CompilerOptions,
- ContractArtifact,
- ContractNetworkData,
- ContractNetworks,
- ContractSourceData,
- ContractSpecificSourceData,
- ContractVersionData,
-} from './utils/types';
+import { CompilerOptions, ContractArtifact, ContractVersionData } from './utils/types';
import { utils } from './utils/utils';
type TYPE_ALL_FILES_IDENTIFIER = '*';
@@ -172,7 +160,6 @@ export class Compiler {
const solcInstance = solc.setupMethods(requireFromString(solcjs, compilerBinFilename));
logUtils.log(`Compiling ${contractName} with Solidity v${solcVersion}...`);
- const source = contractSource.source;
const standardInput: solc.StandardInput = {
language: 'Solidity',
sources: {
diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts
index 715ecd6f0..08e2d999a 100644
--- a/packages/sol-compiler/src/utils/compiler.ts
+++ b/packages/sol-compiler/src/utils/compiler.ts
@@ -1,10 +1,8 @@
-import { ContractSource, ContractSources } from '@0xproject/sol-resolver';
+import { ContractSource } from '@0xproject/sol-resolver';
import { logUtils } from '@0xproject/utils';
import * as _ from 'lodash';
import * as path from 'path';
-import * as solc from 'solc';
-import { constants } from './constants';
import { fsWrapper } from './fs_wrapper';
import { ContractArtifact } from './types';
diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts
index 759a7a555..4321a2235 100644
--- a/packages/sol-compiler/src/utils/types.ts
+++ b/packages/sol-compiler/src/utils/types.ts
@@ -1,7 +1,4 @@
-import { ContractAbi, Provider, TxData } from 'ethereum-types';
import * as solc from 'solc';
-import * as Web3 from 'web3';
-import * as yargs from 'yargs';
export enum AbiType {
Function = 'function',
diff --git a/packages/sol-compiler/test/compiler_test.ts b/packages/sol-compiler/test/compiler_test.ts
index 991965caa..54a117c5a 100644
--- a/packages/sol-compiler/test/compiler_test.ts
+++ b/packages/sol-compiler/test/compiler_test.ts
@@ -5,7 +5,7 @@ import 'mocha';
import { Compiler } from '../src/compiler';
import { fsWrapper } from '../src/utils/fs_wrapper';
-import { CompilerOptions, ContractArtifact, ContractNetworkData } from '../src/utils/types';
+import { CompilerOptions, ContractArtifact } from '../src/utils/types';
import { exchange_binary } from './fixtures/exchange_bin';
import { constants } from './util/constants';
diff --git a/packages/sol-compiler/test/util/provider.ts b/packages/sol-compiler/test/util/provider.ts
index 7215ffae7..cc372b2eb 100644
--- a/packages/sol-compiler/test/util/provider.ts
+++ b/packages/sol-compiler/test/util/provider.ts
@@ -1,6 +1,5 @@
import { web3Factory } from '@0xproject/dev-utils';
import { Provider } from 'ethereum-types';
-import * as Web3 from 'web3';
const providerConfigs = { shouldUseInProcessGanache: true };
const provider: Provider = web3Factory.getRpcProvider(providerConfigs);