Skip to content
This repository was archived by the owner on Jul 9, 2021. It is now read-only.

Commit f9814b0

Browse files
@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.
1 parent 5f772e6 commit f9814b0

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

contracts/dev-utils/test/lib_transaction_decoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ describe('LibTransactionDecoder', () => {
9797
});
9898
}
9999

100-
for (const func of ['marketBuyOrders', 'marketSellOrders', ]) {
100+
for (const func of ['marketBuyOrders', 'marketSellOrders']) {
101101
const input = (exchangeInterface as any)[func].getABIEncodedTransactionData(
102102
[order, order],
103103
takerAssetFillAmount,

contracts/exchange/test/reentrancy_tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ blockchainTests.resets('Reentrancy Tests', env => {
1919
!method.constant &&
2020
!_.includes(['view', 'pure'], method.stateMutability)
2121
) {
22-
if (_.includes(TestConstants.REENTRANT_FUNCTIONS, method.name)) {
22+
if (_.includes(TestConstants.REENTRANT_FUNCTIONS as string[], method.name)) {
2323
reentrantFunctions.push(method);
2424
} else {
2525
nonReentrantFunctions.push(method);

contracts/exchange/test/utils/constants.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ export const constants = {
44
// These are functions not secured by the `nonReentrant`, directly or
55
// indirectly (by calling a function that has the modifier).
66
REENTRANT_FUNCTIONS: [
7-
'batchExecuteTransactions',
8-
'executeTransaction',
9-
'registerAssetProxy',
10-
'simulateDispatchTransferFromCalls',
11-
'transferOwnership',
7+
ExchangeFunctionName.BatchExecuteTransactions,
8+
ExchangeFunctionName.ExecuteTransaction,
9+
ExchangeFunctionName.RegisterAssetProxy,
10+
ExchangeFunctionName.SimulateDispatchTransferFromCalls,
11+
ExchangeFunctionName.TransferOwnership,
1212
],
1313
SINGLE_FILL_FN_NAMES: [
1414
ExchangeFunctionName.FillOrder,

contracts/exchange/test/utils/types.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,26 @@ export interface AbiDecodedFillOrderData {
88
}
99

1010
export enum ExchangeFunctionName {
11-
FillOrder = 'fillOrder',
12-
FillOrKillOrder = 'fillOrKillOrder',
13-
FillOrderNoThrow = 'fillOrderNoThrow',
14-
BatchFillOrders = 'batchFillOrders',
11+
BatchCancelOrders = 'batchCancelOrders',
12+
BatchExecuteTransactions = 'batchExecuteTransactions',
1513
BatchFillOrKillOrders = 'batchFillOrKillOrders',
14+
BatchFillOrders = 'batchFillOrders',
1615
BatchFillOrdersNoThrow = 'batchFillOrdersNoThrow',
16+
BatchMatchOrders = 'batchMatchOrders',
17+
BatchMatchordersWithMaximalFill = 'batchMatchOrdersWithMaximalFill',
18+
CancelOrder = 'cancelOrder',
19+
CancelOrdersUpTo = 'cancelOrdersUpTo',
20+
ExecuteTransaction = 'executeTransaction',
21+
FillOrKillOrder = 'fillOrKillOrder',
22+
FillOrder = 'fillOrder',
23+
FillOrderNoThrow = 'fillOrderNoThrow',
1724
MarketBuyOrders = 'marketBuyOrders',
1825
MarketSellOrders = 'marketSellOrders',
1926
MatchOrders = 'matchOrders',
20-
CancelOrder = 'cancelOrder',
21-
BatchCancelOrders = 'batchCancelOrders',
22-
CancelOrdersUpTo = 'cancelOrdersUpTo',
27+
MatchOrdersWithMaximalfill = 'matchOrdersWithMaximalFill',
2328
PreSign = 'preSign',
29+
RegisterAssetProxy = 'registerAssetProxy',
2430
SetSignatureValidatorApproval = 'setSignatureValidatorApproval',
31+
SimulateDispatchTransferFromCalls = 'simulateDispatchTransferFromCalls',
32+
TransferOwnership = 'transferOwnership',
2533
}

contracts/test-utils/src/log_decoder.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {
1212
} from 'ethereum-types';
1313
import * as _ from 'lodash';
1414

15-
import { constants } from './constants';
16-
1715
export class LogDecoder {
1816
private readonly _web3Wrapper: Web3Wrapper;
1917
private readonly _abiDecoder: AbiDecoder;

0 commit comments

Comments
 (0)