diff options
Diffstat (limited to 'packages/contracts')
4 files changed, 9 insertions, 26 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index 922f9e6dc..4db4eb448 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -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) diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol index fb91cf9d6..e09d93851 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol @@ -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 ) diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 0a9b7b2c9..d8d83711e 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -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 () => { diff --git a/packages/contracts/util/exchange_wrapper.ts b/packages/contracts/util/exchange_wrapper.ts index 14d603f58..90744367a 100644 --- a/packages/contracts/util/exchange_wrapper.ts +++ b/packages/contracts/util/exchange_wrapper.ts @@ -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, |