aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/test/deploy_test.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-01-30 20:26:46 +0800
committerFabio Berger <me@fabioberger.com>2018-01-30 20:26:46 +0800
commitc6dece6bd1e5f5afa56b290557eb7a6245c76cb6 (patch)
treead7a33ffe5d80c0eb41ae10fbc8314f193e52383 /packages/deployer/test/deploy_test.ts
parent93a5b3f457c1211676296840c285759007a55500 (diff)
downloaddexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.gz
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.bz2
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.lz
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.xz
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.zst
dexon-sol-tools-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.zip
Add config file specifically in prettier command and fix files
Diffstat (limited to 'packages/deployer/test/deploy_test.ts')
-rw-r--r--packages/deployer/test/deploy_test.ts122
1 files changed, 61 insertions, 61 deletions
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);
+ });
+ });
});