* move orderParsingUtils from order-utils to connect * Remove many functions from signatureUtils Removed from the exported object, that is. All of them are used in other existing code, so they were all moved to be as local to their usage as possible. * remove orderHashUtils.isValidOrderHash() * Move all *RevertErrors from order-utils... ...into their respective @0x/contracts- packages. * Refactor @0x/order-utils' orderHashUtils away - Move existing routines into @0x/contracts-test-utils - Migrate non-contract-test callers to a newly-exposed getOrderHash() method in DevUtils. * Move all *RevertErrors from @0x/utils... ...into their respective @0x/contracts- packages. * rm transactionHashUtils.isValidTransactionHash() * DevUtils.sol: Fail yarn test if too big to deploy * Refactor @0x/order-utils transactionHashUtils away - Move existing routines into @0x/contracts-test-utils - Migrate non-contract-test callers to a newly-exposed getTransactionHash() method in DevUtils. * Consolidate `Removed export...` CHANGELOG entries * Rm EthBalanceChecker from devutils wrapper exports * Stop importing from '.' or '.../src' * fix builds * fix prettier; dangling promise * increase max bundle size
56 lines
1.7 KiB
TypeScript
56 lines
1.7 KiB
TypeScript
import { BigNumber, RevertError } from '@0x/utils';
|
|
|
|
// tslint:disable:max-classes-per-file
|
|
export class AuthorizedAddressMismatchError extends RevertError {
|
|
constructor(authorized?: string, target?: string) {
|
|
super('AuthorizedAddressMismatchError', 'AuthorizedAddressMismatchError(address authorized, address target)', {
|
|
authorized,
|
|
target,
|
|
});
|
|
}
|
|
}
|
|
|
|
export class IndexOutOfBoundsError extends RevertError {
|
|
constructor(index?: BigNumber, len?: BigNumber) {
|
|
super('IndexOutOfBoundsError', 'IndexOutOfBoundsError(uint256 index, uint256 len)', { index, len });
|
|
}
|
|
}
|
|
|
|
export class SenderNotAuthorizedError extends RevertError {
|
|
constructor(sender?: string) {
|
|
super('SenderNotAuthorizedError', 'SenderNotAuthorizedError(address sender)', { sender });
|
|
}
|
|
}
|
|
|
|
export class TargetAlreadyAuthorizedError extends RevertError {
|
|
constructor(target?: string) {
|
|
super('TargetAlreadyAuthorizedError', 'TargetAlreadyAuthorizedError(address target)', { target });
|
|
}
|
|
}
|
|
|
|
export class TargetNotAuthorizedError extends RevertError {
|
|
constructor(target?: string) {
|
|
super('TargetNotAuthorizedError', 'TargetNotAuthorizedError(address target)', { target });
|
|
}
|
|
}
|
|
|
|
export class ZeroCantBeAuthorizedError extends RevertError {
|
|
constructor() {
|
|
super('ZeroCantBeAuthorizedError', 'ZeroCantBeAuthorizedError()', {});
|
|
}
|
|
}
|
|
|
|
const types = [
|
|
AuthorizedAddressMismatchError,
|
|
IndexOutOfBoundsError,
|
|
SenderNotAuthorizedError,
|
|
TargetAlreadyAuthorizedError,
|
|
TargetNotAuthorizedError,
|
|
ZeroCantBeAuthorizedError,
|
|
];
|
|
|
|
// Register the types we've defined.
|
|
for (const type of types) {
|
|
RevertError.registerType(type);
|
|
}
|