Remove moved RevertErrors

This commit is contained in:
Jacob Evans
2019-11-22 13:14:25 +11:00
parent 9c42241269
commit ad8caa2b51
55 changed files with 67 additions and 1086 deletions

View File

@@ -8,7 +8,7 @@ export {
LibOrderContract,
LibZeroExTransactionContract,
} from './wrappers';
export import LibMathRevertErrors = require('./lib_math_revert_errors');
export { LibMathRevertErrors } from '@0x/utils';
import * as ReferenceFunctionsToExport from './reference_functions';
export import ReferenceFunctions = ReferenceFunctionsToExport;

View File

@@ -1,31 +0,0 @@
import { BigNumber, RevertError } from '@0x/utils';
import * as _ from 'lodash';
// tslint:disable:max-classes-per-file
export class DivisionByZeroError extends RevertError {
constructor() {
super('DivisionByZeroError', 'DivisionByZeroError()', {});
}
}
export class RoundingError extends RevertError {
constructor(
numerator?: BigNumber | number | string,
denominator?: BigNumber | number | string,
target?: BigNumber | number | string,
) {
super('RoundingError', 'RoundingError(uint256 numerator, uint256 denominator, uint256 target)', {
numerator,
denominator,
target,
});
}
}
const types = [DivisionByZeroError, RoundingError];
// Register the types we've defined.
for (const type of types) {
RevertError.registerType(type);
}

View File

@@ -1,8 +1,6 @@
import { ReferenceFunctions } from '@0x/contracts-utils';
import { FillResults, Order } from '@0x/types';
import { BigNumber } from '@0x/utils';
import LibMathRevertErrors = require('./lib_math_revert_errors');
import { BigNumber, LibMathRevertErrors } from '@0x/utils';
const { safeAdd, safeSub, safeMul, safeDiv } = ReferenceFunctions;

View File

@@ -9,11 +9,10 @@ import {
} from '@0x/contracts-test-utils';
import { SafeMathRevertErrors } from '@0x/contracts-utils';
import { FillResults, MatchedFillResults, Order } from '@0x/types';
import { BigNumber } from '@0x/utils';
import { BigNumber, LibMathRevertErrors } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import LibMathRevertErrors = require('../src/lib_math_revert_errors');
import { addFillResults, calculateFillResults, getPartialAmountFloor } from '../src/reference_functions';
import { artifacts } from './artifacts';

View File

@@ -7,9 +7,8 @@ import {
uint256Values,
} from '@0x/contracts-test-utils';
import { SafeMathRevertErrors } from '@0x/contracts-utils';
import { BigNumber } from '@0x/utils';
import { BigNumber, LibMathRevertErrors } from '@0x/utils';
import LibMathRevertErrors = require('../src/lib_math_revert_errors');
import {
getPartialAmountCeil,
getPartialAmountFloor,

View File

@@ -1,9 +1,8 @@
import { constants, describe, expect } from '@0x/contracts-test-utils';
import { SafeMathRevertErrors } from '@0x/contracts-utils';
import { BigNumber } from '@0x/utils';
import { BigNumber, LibMathRevertErrors } from '@0x/utils';
import * as _ from 'lodash';
import LibMathRevertErrors = require('../src/lib_math_revert_errors');
import {
addFillResults,
getPartialAmountCeil,