From c6dece6bd1e5f5afa56b290557eb7a6245c76cb6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 30 Jan 2018 13:26:46 +0100 Subject: Add config file specifically in prettier command and fix files --- packages/deployer/test/deploy_test.ts | 122 +++++++++++++++++----------------- 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'packages/deployer/test/deploy_test.ts') diff --git a/packages/deployer/test/deploy_test.ts b/packages/deployer/test/deploy_test.ts index 583601154..5df729a04 100644 --- a/packages/deployer/test/deploy_test.ts +++ b/packages/deployer/test/deploy_test.ts @@ -13,79 +13,79 @@ const artifactsDir = `${__dirname}/fixtures/artifacts`; const contractsDir = `${__dirname}/fixtures/contracts`; const exchangeArtifactPath = `${artifactsDir}/Exchange.json`; const compilerOpts: CompilerOptions = { - artifactsDir, - contractsDir, - networkId: constants.networkId, - optimizerEnabled: constants.optimizerEnabled, + artifactsDir, + contractsDir, + networkId: constants.networkId, + optimizerEnabled: constants.optimizerEnabled, }; const compiler = new Compiler(compilerOpts); const deployerOpts = { - artifactsDir, - networkId: constants.networkId, - jsonrpcPort: constants.jsonrpcPort, - defaults: { - gasPrice: constants.gasPrice, - }, + artifactsDir, + networkId: constants.networkId, + jsonrpcPort: constants.jsonrpcPort, + defaults: { + gasPrice: constants.gasPrice, + }, }; const deployer = new Deployer(deployerOpts); /* tslint:disable */ beforeEach(function(done: DoneCallback) { - this.timeout(constants.timeoutMs); - (async () => { - if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { - await fsWrapper.removeFileAsync(exchangeArtifactPath); - } - await compiler.compileAllAsync(); - done(); - })().catch(done); + this.timeout(constants.timeoutMs); + (async () => { + if (fsWrapper.doesPathExistSync(exchangeArtifactPath)) { + await fsWrapper.removeFileAsync(exchangeArtifactPath); + } + await compiler.compileAllAsync(); + done(); + })().catch(done); }); /* tslint:enable */ describe('#Compiler', () => { - it('should create an Exchange artifact with the correct unlinked binary', async () => { - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; - // The last 43 bytes of the binaries are metadata which may not be equivalent - const unlinkedBinaryWithoutMetadata = exchangeContractData.unlinked_binary.slice(0, -86); - const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86); - expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); - }); + it('should create an Exchange artifact with the correct unlinked binary', async () => { + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; + // The last 43 bytes of the binaries are metadata which may not be equivalent + const unlinkedBinaryWithoutMetadata = exchangeContractData.unlinked_binary.slice(0, -86); + const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86); + expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata); + }); }); describe('#Deployer', () => { - describe('#deployAsync', () => { - it('should deploy the Exchange contract without updating the Exchange artifact', async () => { - const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; - const exchangeContractInstance = await deployer.deployAsync('Exchange', exchangeConstructorArgs); - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; - const exchangeAddress = exchangeContractInstance.address; - expect(exchangeAddress).to.not.equal(undefined); - expect(exchangeContractData.address).to.equal(undefined); - expect(exchangeContractData.constructor_args).to.equal(undefined); - }); - }); - describe('#deployAndSaveAsync', () => { - it('should save the correct contract address and constructor arguments to the Exchange artifact', async () => { - const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; - const exchangeContractInstance = await deployer.deployAndSaveAsync('Exchange', exchangeConstructorArgs); - const opts = { - encoding: 'utf8', - }; - const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); - const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); - const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; - const exchangeAddress = exchangeContractInstance.address; - expect(exchangeAddress).to.be.equal(exchangeContractData.address); - expect(constructor_args).to.be.equal(exchangeContractData.constructor_args); - }); - }); + describe('#deployAsync', () => { + it('should deploy the Exchange contract without updating the Exchange artifact', async () => { + const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; + const exchangeContractInstance = await deployer.deployAsync('Exchange', exchangeConstructorArgs); + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; + const exchangeAddress = exchangeContractInstance.address; + expect(exchangeAddress).to.not.equal(undefined); + expect(exchangeContractData.address).to.equal(undefined); + expect(exchangeContractData.constructor_args).to.equal(undefined); + }); + }); + describe('#deployAndSaveAsync', () => { + it('should save the correct contract address and constructor arguments to the Exchange artifact', async () => { + const exchangeConstructorArgs = [constants.zrxTokenAddress, constants.tokenTransferProxyAddress]; + const exchangeContractInstance = await deployer.deployAndSaveAsync('Exchange', exchangeConstructorArgs); + const opts = { + encoding: 'utf8', + }; + const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts); + const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString); + const exchangeContractData: ContractData = exchangeArtifact.networks[constants.networkId]; + const exchangeAddress = exchangeContractInstance.address; + expect(exchangeAddress).to.be.equal(exchangeContractData.address); + expect(constructor_args).to.be.equal(exchangeContractData.constructor_args); + }); + }); }); -- cgit v1.2.3