@0x/contracts-asset-proxy: Remove only modifier on uniswap tests.

This commit is contained in:
Lawrence Forman
2019-10-08 09:27:53 +09:00
parent dbf22583b5
commit 53df2130ea
4 changed files with 32 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ import {
TestUniswapBridgeWethWithdrawEventArgs as WethWithdrawArgs,
} from '../src';
blockchainTests.resets.only('UniswapBridge unit tests', env => {
blockchainTests.resets('UniswapBridge unit tests', env => {
const txHelper = new TransactionHelper(env.web3Wrapper, artifacts);
let testContract: TestUniswapBridgeContract;
let wethTokenAddress: string;

View File

@@ -40,6 +40,7 @@ const SEPARATOR = ',';
contractsDir: argv.contractsDir,
artifactsDir: argv.artifactsDir,
contracts,
isOfflineMode: process.env.SOLC_OFFLINE ? true : undefined,
};
const compiler = new Compiler(opts);
if (argv.watch) {

View File

@@ -28,7 +28,10 @@ import {
createDirIfDoesNotExistAsync,
getContractArtifactIfExistsAsync,
getDependencyNameToPackagePath,
getSolcJSAsync,
getSolcJSFromPath,
getSolcJSReleasesAsync,
getSolcJSVersionFromPath,
getSourcesWithDependencies,
getSourceTreeHash,
makeContractPathsRelative,
@@ -106,7 +109,10 @@ export class Compiler {
: {};
assert.doesConformToSchema('compiler.json', config, compilerOptionsSchema);
this._contractsDir = path.resolve(passedOpts.contractsDir || config.contractsDir || DEFAULT_CONTRACTS_DIR);
this._solcVersionIfExists = passedOpts.solcVersion || config.solcVersion;
this._solcVersionIfExists =
process.env.SOLCJS_PATH !== undefined
? getSolcJSVersionFromPath(process.env.SOLCJS_PATH)
: passedOpts.solcVersion || config.solcVersion;
this._compilerSettings = {
...DEFAULT_COMPILER_SETTINGS,
...config.compilerSettings,
@@ -292,7 +298,11 @@ export class Compiler {
compilerOutput = await compileDockerAsync(solcVersion, input.standardInput);
} else {
fullSolcVersion = solcJSReleases[solcVersion];
compilerOutput = await compileSolcJSAsync(solcVersion, input.standardInput, this._isOfflineMode);
const solcInstance =
process.env.SOLCJS_PATH !== undefined
? getSolcJSFromPath(process.env.SOLCJS_PATH)
: await getSolcJSAsync(solcVersion, this._isOfflineMode);
compilerOutput = await compileSolcJSAsync(solcInstance, input.standardInput);
}
if (compilerOutput.errors !== undefined) {
printCompilationErrorsAndWarnings(compilerOutput.errors);

View File

@@ -136,16 +136,14 @@ export async function getSolcJSReleasesAsync(isOfflineMode: boolean): Promise<Bi
/**
* Compiles the contracts and prints errors/warnings
* @param solcVersion Version of a solc compiler
* @param solcInstance Instance of a solc compiler
* @param standardInput Solidity standard JSON input
* @param isOfflineMode Offline mode flag
*/
export async function compileSolcJSAsync(
solcVersion: string,
solcInstance: solc.SolcInstance,
standardInput: solc.StandardInput,
isOfflineMode: boolean,
): Promise<solc.StandardOutput> {
const solcInstance = await getSolcJSAsync(solcVersion, isOfflineMode);
const standardInputStr = JSON.stringify(standardInput);
const standardOutputStr = solcInstance.compileStandardWrapper(standardInputStr);
const compiled: solc.StandardOutput = JSON.parse(standardOutputStr);
@@ -364,6 +362,22 @@ export async function getSolcJSAsync(solcVersion: string, isOfflineMode: boolean
return solcInstance;
}
/**
* Gets the solidity compiler instance from a module path.
* @param path The path to the solc module.
*/
export function getSolcJSFromPath(modulePath: string): solc.SolcInstance {
return require(modulePath);
}
/**
* Gets the solidity compiler version from a module path.
* @param path The path to the solc module.
*/
export function getSolcJSVersionFromPath(modulePath: string): string {
return require(modulePath).version();
}
/**
* Solidity compiler emits the bytecode without a 0x prefix for a hex. This function fixes it if bytecode is present.
* @param compiledContract The standard JSON output section for a contract. Geth modified in place.