Updated the erc1155 tests to expect RichErrors
This commit is contained in:
committed by
Amir Bandeali
parent
6e4b6929d2
commit
b3da4bb5b7
32
packages/utils/src/safe_math_revert_errors.ts
Normal file
32
packages/utils/src/safe_math_revert_errors.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { BigNumber } from './configured_bignumber';
|
||||
import { RevertError } from './revert_error';
|
||||
|
||||
// tslint:disable:max-classes-per-file
|
||||
|
||||
export class Uint256OverflowError extends RevertError {
|
||||
constructor(a?: BigNumber | number | string, b?: BigNumber | number | string) {
|
||||
super('Uint256OverflowError', 'Uint256OverflowError(uint256 a, uint256 b)', {
|
||||
a,
|
||||
b,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint256UnderflowError extends RevertError {
|
||||
constructor(a?: BigNumber | number | string, b?: BigNumber | number | string) {
|
||||
super('Uint256UnderflowError', 'Uint256UnderflowError(uint256 a, uint256 b)', {
|
||||
a,
|
||||
b,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const types = [
|
||||
Uint256OverflowError,
|
||||
Uint256UnderflowError,
|
||||
]
|
||||
|
||||
// Register the types we've defined.
|
||||
for (const type of types) {
|
||||
RevertError.registerType(type);
|
||||
}
|
Reference in New Issue
Block a user