All glory to the linter gods.

This commit is contained in:
Lawrence Forman 2019-03-25 22:38:48 -04:00 committed by Amir Bandeali
parent f77823ee24
commit c096eae644
14 changed files with 20 additions and 56 deletions

View File

@ -113,21 +113,9 @@ describe('Coordinator tests', () => {
const takerPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)]; const takerPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)];
const feeRecipientPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(feeRecipientAddress)]; const feeRecipientPrivateKey = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(feeRecipientAddress)];
orderFactory = new OrderFactory(makerPrivateKey, defaultOrderParams); orderFactory = new OrderFactory(makerPrivateKey, defaultOrderParams);
makerTransactionFactory = new TransactionFactory( makerTransactionFactory = new TransactionFactory(makerPrivateKey, exchange.address, chainId);
makerPrivateKey, takerTransactionFactory = new TransactionFactory(takerPrivateKey, exchange.address, chainId);
exchange.address, approvalFactory = new ApprovalFactory(feeRecipientPrivateKey, coordinatorContract.address, chainId);
chainId,
);
takerTransactionFactory = new TransactionFactory(
takerPrivateKey,
exchange.address,
chainId,
);
approvalFactory = new ApprovalFactory(
feeRecipientPrivateKey,
coordinatorContract.address,
chainId,
);
}); });
beforeEach(async () => { beforeEach(async () => {
await blockchainLifecycle.startAsync(); await blockchainLifecycle.startAsync();

View File

@ -72,21 +72,9 @@ describe('Mixins tests', () => {
devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(transactionSignerAddress)]; devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(transactionSignerAddress)];
const approvalSignerPrivateKey1 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress1)]; const approvalSignerPrivateKey1 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress1)];
const approvalSignerPrivateKey2 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress2)]; const approvalSignerPrivateKey2 = devConstants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(approvalSignerAddress2)];
transactionFactory = new TransactionFactory( transactionFactory = new TransactionFactory(transactionSignerPrivateKey, exchangeAddress, chainId);
transactionSignerPrivateKey, approvalFactory1 = new ApprovalFactory(approvalSignerPrivateKey1, mixins.address, chainId);
exchangeAddress, approvalFactory2 = new ApprovalFactory(approvalSignerPrivateKey2, mixins.address, chainId);
chainId,
);
approvalFactory1 = new ApprovalFactory(
approvalSignerPrivateKey1,
mixins.address,
chainId,
);
approvalFactory2 = new ApprovalFactory(
approvalSignerPrivateKey2,
mixins.address,
chainId,
);
}); });
beforeEach(async () => { beforeEach(async () => {
await blockchainLifecycle.startAsync(); await blockchainLifecycle.startAsync();

View File

@ -10,11 +10,7 @@ export class ApprovalFactory {
private readonly _verifyingContractAddress: string; private readonly _verifyingContractAddress: string;
private readonly _chainId: number; private readonly _chainId: number;
constructor( constructor(privateKey: Buffer, verifyingContractAddress: string, chainId: number) {
privateKey: Buffer,
verifyingContractAddress: string,
chainId: number,
) {
this._privateKey = privateKey; this._privateKey = privateKey;
this._verifyingContractAddress = verifyingContractAddress; this._verifyingContractAddress = verifyingContractAddress;
this._chainId = chainId; this._chainId = chainId;

View File

@ -30,7 +30,8 @@ export const hashUtils = {
transaction, transaction,
verifyingContractAddress, verifyingContractAddress,
txOrigin, txOrigin,
approvalExpirationTimeSeconds) approvalExpirationTimeSeconds,
)
.toString('hex')}`; .toString('hex')}`;
return hashHex; return hashHex;
}, },

View File

@ -38,7 +38,6 @@ contract LibConstants {
bytes public ZRX_ASSET_DATA; bytes public ZRX_ASSET_DATA;
/// @param zrxAssetData Asset data for ZRX token. Used for fee transfers. /// @param zrxAssetData Asset data for ZRX token. Used for fee transfers.
constructor (bytes memory zrxAssetData) constructor (bytes memory zrxAssetData)
public public

View File

@ -40,7 +40,6 @@ contract LibEIP712ExchangeDomain is
); );
} }
/// @dev Calculates EIP712 encoding for a hash struct in the EIP712 domain /// @dev Calculates EIP712 encoding for a hash struct in the EIP712 domain
/// of the Exchange contract. /// of the Exchange contract.
/// @param hashStruct The EIP712 hash struct. /// @param hashStruct The EIP712 hash struct.

View File

@ -26,6 +26,7 @@ import "../src/LibFillResults.sol";
import "../src/LibAbiEncoder.sol"; import "../src/LibAbiEncoder.sol";
// solhint-disable no-empty-blocks
contract TestLibs is contract TestLibs is
LibEIP712, LibEIP712,
LibMath, LibMath,

View File

@ -62,8 +62,7 @@ contract MixinTransactions is
salt, salt,
signerAddress, signerAddress,
data data
) ));
);
// Validate transaction has not been executed // Validate transaction has not been executed
require( require(

View File

@ -29,6 +29,7 @@ contract TestSignatureValidator is
MixinTransactions MixinTransactions
{ {
// solhint-disable no-empty-blocks
constructor (uint256 chainId) constructor (uint256 chainId)
public public
LibEIP712(chainId) LibEIP712(chainId)

View File

@ -122,7 +122,7 @@ describe('matchOrders', () => {
provider, provider,
txDefaults, txDefaults,
assetDataUtils.encodeERC20AssetData(zrxToken.address), assetDataUtils.encodeERC20AssetData(zrxToken.address),
new BigNumber(chainId) new BigNumber(chainId),
); );
exchangeWrapper = new ExchangeWrapper(exchange, provider); exchangeWrapper = new ExchangeWrapper(exchange, provider);
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);

View File

@ -90,7 +90,7 @@ describe('Exchange transactions', () => {
provider, provider,
txDefaults, txDefaults,
assetDataUtils.encodeERC20AssetData(zrxToken.address), assetDataUtils.encodeERC20AssetData(zrxToken.address),
new BigNumber(chainId) new BigNumber(chainId),
); );
exchangeWrapper = new ExchangeWrapper(exchange, provider); exchangeWrapper = new ExchangeWrapper(exchange, provider);
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);
@ -116,16 +116,8 @@ describe('Exchange transactions', () => {
makerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)]; makerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(makerAddress)];
takerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)]; takerPrivateKey = constants.TESTRPC_PRIVATE_KEYS[accounts.indexOf(takerAddress)];
orderFactory = new OrderFactory(makerPrivateKey, defaultOrderParams); orderFactory = new OrderFactory(makerPrivateKey, defaultOrderParams);
makerTransactionFactory = new TransactionFactory( makerTransactionFactory = new TransactionFactory(makerPrivateKey, exchange.address, chainId);
makerPrivateKey, takerTransactionFactory = new TransactionFactory(takerPrivateKey, exchange.address, chainId);
exchange.address,
chainId,
);
takerTransactionFactory = new TransactionFactory(
takerPrivateKey,
exchange.address,
chainId,
);
}); });
describe('executeTransaction', () => { describe('executeTransaction', () => {
describe('fillOrder', () => { describe('fillOrder', () => {

View File

@ -103,7 +103,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
provider, provider,
txDefaults, txDefaults,
zrxAssetData, zrxAssetData,
new BigNumber(chainId) new BigNumber(chainId),
); );
const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider); const exchangeWrapper = new ExchangeWrapper(exchangeContract, provider);
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, ownerAddress); await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, ownerAddress);
@ -131,7 +131,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
erc721Token, erc721Token,
erc721Balances, erc721Balances,
exchangeContract.address, exchangeContract.address,
chainId chainId,
); );
const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync( const testLibsContract = await TestLibsContract.deployFrom0xArtifactAsync(

View File

@ -42,7 +42,7 @@ export class OrderFactoryFromScenario {
erc721Token: DummyERC721TokenContract, erc721Token: DummyERC721TokenContract,
erc721Balances: ERC721TokenIdsByOwner, erc721Balances: ERC721TokenIdsByOwner,
exchangeAddress: string, exchangeAddress: string,
chainId: number chainId: number,
) { ) {
this._userAddresses = userAddresses; this._userAddresses = userAddresses;
this._zrxAddress = zrxAddress; this._zrxAddress = zrxAddress;

View File

@ -90,7 +90,7 @@ describe('Exchange wrappers', () => {
provider, provider,
txDefaults, txDefaults,
assetDataUtils.encodeERC20AssetData(zrxToken.address), assetDataUtils.encodeERC20AssetData(zrxToken.address),
new BigNumber(chainId) new BigNumber(chainId),
); );
exchangeWrapper = new ExchangeWrapper(exchange, provider); exchangeWrapper = new ExchangeWrapper(exchange, provider);
await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner); await exchangeWrapper.registerAssetProxyAsync(erc20Proxy.address, owner);