Run prettier

This commit is contained in:
Amir Bandeali
2018-02-08 12:09:07 -08:00
parent 6b897f6fd2
commit 942867179c
4 changed files with 9 additions and 26 deletions

View File

@@ -229,7 +229,7 @@ contract MixinExchangeCore is
return isError;
}
/// @dev Calculates the sum of values already filled and cancelled for a given order.
/// @dev Calculates the sum of values already filled and cancelled for a given order.
/// @param orderHash The Keccak-256 hash of the given order.
/// @return Sum of values already filled and cancelled.
function getUnavailableTakerTokenAmount(bytes32 orderHash)

View File

@@ -78,7 +78,7 @@ contract MixinWrapperFunctions is
let x := mload(0x40) // free memory pointer
mstore(x, FILL_ORDER_FUNCTION_SIGNATURE)
// first 32 bytes of an array contains length
// first 32 bytes of a dynamic in-memory array contains length
mstore(add(x, 4), add(orderAddresses, 32)) // maker
mstore(add(x, 36), add(orderAddresses, 64)) // taker
mstore(add(x, 68), add(orderAddresses, 96)) // makerToken
@@ -99,7 +99,7 @@ contract MixinWrapperFunctions is
gas, // TODO: don't send all gas, save some for returning is case of throw
address, // call this contract
x, // inputs start at x
484, // inputs are 484 bytes long (4 + 15*32)
484, // inputs are 484 bytes long (4 + 15 * 32)
x, // store output over input
32 // output is 32 bytes
)

View File

@@ -393,7 +393,7 @@ describe('Exchange', () => {
takerTokenFillAmount: signedOrder.takerTokenAmount,
});
const log = res.logs[0] as LogWithDecodedArgs<LogFillContractEventArgs>;
expect(log.args.filledTakerTokenAmount).to.be.bignumber.equal(
expect(log.args.takerTokenFilledAmount).to.be.bignumber.equal(
signedOrder.takerTokenAmount.minus(takerTokenFillAmount),
);
const newBalances = await dmyBalances.getAsync();
@@ -543,11 +543,7 @@ describe('Exchange', () => {
makerTokenAmount: ZeroEx.toBaseUnitAmount(new BigNumber(100000), 18),
});
return expect(
exWrapper.fillOrderAsync(signedOrder, taker, {
shouldThrowOnInsufficientBalanceOrAllowance: true,
}),
).to.be.rejectedWith(constants.REVERT);
return expect(exWrapper.fillOrderAsync(signedOrder, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should not change balances if taker balances are too low to fill order and \
@@ -675,11 +671,7 @@ describe('Exchange', () => {
takerTokenAddress: maliciousToken.address,
});
return expect(
exWrapper.fillOrderAsync(signedOrder, taker, {
shouldThrowOnInsufficientBalanceOrAllowance: false,
}),
).to.be.rejectedWith(constants.REVERT);
return expect(exWrapper.fillOrderAsync(signedOrder, taker)).to.be.rejectedWith(constants.REVERT);
});
it('should not change balances if an order is expired', async () => {

View File

@@ -86,10 +86,7 @@ export class ExchangeWrapper {
shouldThrowOnInsufficientBalanceOrAllowance?: boolean;
} = {},
): Promise<TransactionReceiptWithDecodedLogs> {
const params = formatters.createBatchFill(
orders,
opts.takerTokenFillAmounts,
);
const params = formatters.createBatchFill(orders, opts.takerTokenFillAmounts);
const txHash = await this._exchange.batchFillOrders.sendTransactionAsync(
params.orderAddresses,
params.orderValues,
@@ -109,10 +106,7 @@ export class ExchangeWrapper {
from: string,
opts: { takerTokenFillAmounts?: BigNumber[] } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
const params = formatters.createBatchFill(
orders,
opts.takerTokenFillAmounts,
);
const params = formatters.createBatchFill(orders, opts.takerTokenFillAmounts);
const txHash = await this._exchange.batchFillOrKillOrders.sendTransactionAsync(
params.orderAddresses,
params.orderValues,
@@ -132,10 +126,7 @@ export class ExchangeWrapper {
from: string,
opts: { takerTokenFillAmount: BigNumber },
): Promise<TransactionReceiptWithDecodedLogs> {
const params = formatters.createMarketFillOrders(
orders,
opts.takerTokenFillAmount,
);
const params = formatters.createMarketFillOrders(orders, opts.takerTokenFillAmount);
const txHash = await this._exchange.marketFillOrders.sendTransactionAsync(
params.orderAddresses,
params.orderValues,