diff --git a/contracts/utils/test/lib_address.ts b/contracts/utils/test/lib_address.ts index f5d3cd9302..a6a53c2252 100644 --- a/contracts/utils/test/lib_address.ts +++ b/contracts/utils/test/lib_address.ts @@ -16,11 +16,7 @@ describe('LibAddress', () => { await blockchainLifecycle.startAsync(); nonContract = (await web3Wrapper.getAvailableAddressesAsync())[0]; // Deploy LibAddress - lib = await TestLibAddressContract.deployFrom0xArtifactAsync( - artifacts.TestLibAddress, - provider, - txDefaults, - ); + lib = await TestLibAddressContract.deployFrom0xArtifactAsync(artifacts.TestLibAddress, provider, txDefaults); }); after(async () => { diff --git a/contracts/utils/test/lib_eip712.ts b/contracts/utils/test/lib_eip712.ts index 8aac0495b7..07bc5b9e96 100644 --- a/contracts/utils/test/lib_eip712.ts +++ b/contracts/utils/test/lib_eip712.ts @@ -52,12 +52,11 @@ async function testHashEIP712MessageAsync( domainHash: string, hashStruct: string, ): Promise { - const input = '0x1901'.concat(domainHash.slice(2, domainHash.length).concat(hashStruct.slice(2, hashStruct.length))); - const expectedHash = '0x'.concat(ethUtil.sha3(input).toString('hex')); - const actualHash = await lib.externalHashEIP712Message.callAsync( - domainHash, - hashStruct, + const input = '0x1901'.concat( + domainHash.slice(2, domainHash.length).concat(hashStruct.slice(2, hashStruct.length)), ); + const expectedHash = '0x'.concat(ethUtil.sha3(input).toString('hex')); + const actualHash = await lib.externalHashEIP712Message.callAsync(domainHash, hashStruct); expect(actualHash).to.be.eq(expectedHash); } @@ -67,11 +66,7 @@ describe('LibEIP712', () => { before(async () => { await blockchainLifecycle.startAsync(); // Deploy SafeMath - lib = await TestLibEIP712Contract.deployFrom0xArtifactAsync( - artifacts.TestLibEIP712, - provider, - txDefaults, - ); + lib = await TestLibEIP712Contract.deployFrom0xArtifactAsync(artifacts.TestLibEIP712, provider, txDefaults); }); after(async () => { @@ -80,13 +75,7 @@ describe('LibEIP712', () => { describe('_hashEIP712Domain', async () => { it('should correctly hash empty input', async () => { - await testHashEIP712DomainAsync( - lib, - '', - '', - 0, - constants.NULL_ADDRESS, - ); + await testHashEIP712DomainAsync(lib, '', '', 0, constants.NULL_ADDRESS); }); }); @@ -97,11 +86,7 @@ describe('LibEIP712', () => { const actualHash = await lib.externalHashEIP712Message.callAsync(constants.NULL_BYTES32, constants.NULL_BYTES32); expect(actualHash).to.be.eq(expectedHash); */ - await testHashEIP712MessageAsync( - lib, - constants.NULL_BYTES32, - constants.NULL_BYTES32, - ); + await testHashEIP712MessageAsync(lib, constants.NULL_BYTES32, constants.NULL_BYTES32); }); }); }); diff --git a/contracts/utils/test/ownable.ts b/contracts/utils/test/ownable.ts index 451f9632bc..8b7cafa754 100644 --- a/contracts/utils/test/ownable.ts +++ b/contracts/utils/test/ownable.ts @@ -22,11 +22,7 @@ describe('Ownable', () => { await blockchainLifecycle.startAsync(); // Deploy SafeMath from the owner address txDefaults.from = owner; - ownable = await TestOwnableContract.deployFrom0xArtifactAsync( - artifacts.TestOwnable, - provider, - txDefaults, - ); + ownable = await TestOwnableContract.deployFrom0xArtifactAsync(artifacts.TestOwnable, provider, txDefaults); }); after(async () => { @@ -36,10 +32,7 @@ describe('Ownable', () => { // tslint:disable:no-unused-expression describe('onlyOwner', () => { it('should throw if sender is not owner', async () => { - const expectedError = new OwnableRevertErrors.OnlyOwnerError( - nonOwner, - owner, - ); + const expectedError = new OwnableRevertErrors.OnlyOwnerError(nonOwner, owner); return expect(ownable.externalOnlyOwner.callAsync({ from: nonOwner })).to.revertWith(expectedError); }); @@ -50,7 +43,8 @@ describe('Ownable', () => { describe('transferOwnership', () => { it('should not transfer ownership if the specified new owner is the zero address', async () => { - expect(ownable.transferOwnership.sendTransactionAsync(constants.NULL_ADDRESS, { from: owner })).to.be.fulfilled; + expect(ownable.transferOwnership.sendTransactionAsync(constants.NULL_ADDRESS, { from: owner })).to.be + .fulfilled; const updatedOwner = await ownable.owner.callAsync(); expect(updatedOwner).to.be.eq(owner); }); diff --git a/contracts/utils/test/safe_math.ts b/contracts/utils/test/safe_math.ts index ccbf0117e3..b5ae65b737 100644 --- a/contracts/utils/test/safe_math.ts +++ b/contracts/utils/test/safe_math.ts @@ -20,11 +20,7 @@ describe('SafeMath', () => { before(async () => { await blockchainLifecycle.startAsync(); // Deploy SafeMath - safeMath = await TestSafeMathContract.deployFrom0xArtifactAsync( - artifacts.TestSafeMath, - provider, - txDefaults, - ); + safeMath = await TestSafeMathContract.deployFrom0xArtifactAsync(artifacts.TestSafeMath, provider, txDefaults); }); after(async () => { @@ -53,7 +49,7 @@ describe('SafeMath', () => { return expect(safeMath.externalSafeMul.callAsync(a, b)).to.revertWith(expectedError); }); - it('should calculate correct value for values that don\'t overflow', async () => { + it("should calculate correct value for values that don't overflow", async () => { const result = await safeMath.externalSafeMul.callAsync(toBN(15), toBN(13)); expect(result).bignumber.to.be.eq(toBN(195)); }); diff --git a/packages/utils/src/sign_typed_data_utils.ts b/packages/utils/src/sign_typed_data_utils.ts index 824d8f8cc8..f923ec640d 100644 --- a/packages/utils/src/sign_typed_data_utils.ts +++ b/packages/utils/src/sign_typed_data_utils.ts @@ -1,11 +1,16 @@ -import { EIP712DomainWithDefaultSchema, EIP712Object, EIP712ObjectValue, EIP712TypedData, EIP712Types } from '@0x/types'; +import { + EIP712DomainWithDefaultSchema, + EIP712Object, + EIP712ObjectValue, + EIP712TypedData, + EIP712Types, +} from '@0x/types'; import * as ethUtil from 'ethereumjs-util'; import * as ethers from 'ethers'; import * as _ from 'lodash'; import { BigNumber } from './configured_bignumber'; - export const signTypedDataUtils = { /** * Generates the EIP712 Typed Data hash for signing @@ -39,7 +44,7 @@ export const signTypedDataUtils = { { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContractAddress', type: 'address' }, - ] + ], } as EIP712Types, ); },