@0x/contracts-dev-utils: Prettier.

`@0x/contracts-exchange`: Update reentrancy tests.
`@0x/contracts-exchange`: Add all mutator functions to
`ExchangeFunctions` type.
`@0x/contracts-tes-utils`: Remove unused import.
This commit is contained in:
Lawrence Forman 2019-08-08 03:18:32 -04:00
parent d4e300d0a4
commit 370df0d495
5 changed files with 22 additions and 16 deletions

View File

@ -97,7 +97,7 @@ describe('LibTransactionDecoder', () => {
});
}
for (const func of ['marketBuyOrders', 'marketSellOrders', ]) {
for (const func of ['marketBuyOrders', 'marketSellOrders']) {
const input = (exchangeInterface as any)[func].getABIEncodedTransactionData(
[order, order],
takerAssetFillAmount,

View File

@ -19,7 +19,7 @@ blockchainTests.resets('Reentrancy Tests', env => {
!method.constant &&
!_.includes(['view', 'pure'], method.stateMutability)
) {
if (_.includes(TestConstants.REENTRANT_FUNCTIONS, method.name)) {
if (_.includes(TestConstants.REENTRANT_FUNCTIONS as string[], method.name)) {
reentrantFunctions.push(method);
} else {
nonReentrantFunctions.push(method);

View File

@ -4,11 +4,11 @@ export const constants = {
// These are functions not secured by the `nonReentrant`, directly or
// indirectly (by calling a function that has the modifier).
REENTRANT_FUNCTIONS: [
'batchExecuteTransactions',
'executeTransaction',
'registerAssetProxy',
'simulateDispatchTransferFromCalls',
'transferOwnership',
ExchangeFunctionName.BatchExecuteTransactions,
ExchangeFunctionName.ExecuteTransaction,
ExchangeFunctionName.RegisterAssetProxy,
ExchangeFunctionName.SimulateDispatchTransferFromCalls,
ExchangeFunctionName.TransferOwnership,
],
SINGLE_FILL_FN_NAMES: [
ExchangeFunctionName.FillOrder,

View File

@ -8,18 +8,26 @@ export interface AbiDecodedFillOrderData {
}
export enum ExchangeFunctionName {
FillOrder = 'fillOrder',
FillOrKillOrder = 'fillOrKillOrder',
FillOrderNoThrow = 'fillOrderNoThrow',
BatchFillOrders = 'batchFillOrders',
BatchCancelOrders = 'batchCancelOrders',
BatchExecuteTransactions = 'batchExecuteTransactions',
BatchFillOrKillOrders = 'batchFillOrKillOrders',
BatchFillOrders = 'batchFillOrders',
BatchFillOrdersNoThrow = 'batchFillOrdersNoThrow',
BatchMatchOrders = 'batchMatchOrders',
BatchMatchordersWithMaximalFill = 'batchMatchOrdersWithMaximalFill',
CancelOrder = 'cancelOrder',
CancelOrdersUpTo = 'cancelOrdersUpTo',
ExecuteTransaction = 'executeTransaction',
FillOrKillOrder = 'fillOrKillOrder',
FillOrder = 'fillOrder',
FillOrderNoThrow = 'fillOrderNoThrow',
MarketBuyOrders = 'marketBuyOrders',
MarketSellOrders = 'marketSellOrders',
MatchOrders = 'matchOrders',
CancelOrder = 'cancelOrder',
BatchCancelOrders = 'batchCancelOrders',
CancelOrdersUpTo = 'cancelOrdersUpTo',
MatchOrdersWithMaximalfill = 'matchOrdersWithMaximalFill',
PreSign = 'preSign',
RegisterAssetProxy = 'registerAssetProxy',
SetSignatureValidatorApproval = 'setSignatureValidatorApproval',
SimulateDispatchTransferFromCalls = 'simulateDispatchTransferFromCalls',
TransferOwnership = 'transferOwnership',
}

View File

@ -12,8 +12,6 @@ import {
} from 'ethereum-types';
import * as _ from 'lodash';
import { constants } from './constants';
export class LogDecoder {
private readonly _web3Wrapper: Web3Wrapper;
private readonly _abiDecoder: AbiDecoder;