@0x/utils: Fix FixedMathRevertError.FixedMathBinOpError type.

`@0x/utils`: Have Ganache `Error` -> `RevertError` coercion fail if it can't look up the selector.
This commit is contained in:
Lawrence Forman
2019-08-27 18:41:00 -04:00
committed by Lawrence Forman
parent 1a3da4b363
commit 018bcf273f
3 changed files with 6 additions and 2 deletions

View File

@@ -6,6 +6,10 @@
"note": "Allow for array types in `RevertError`s.",
"pr": 2075
},
{
"note": "Have Ganache `Error` -> `RevertError` coercion fail if it can't look up the selector.",
"pr": "TODO"
},
{
"note": "Add `LibFixedMath` `RevertError` types.",
"pr": "TODO"

View File

@@ -35,7 +35,7 @@ export class FixedMathUnsignedValueError extends RevertError {
export class FixedMathBinOpError extends RevertError {
constructor(error?: BinOpErrorCodes, a?: BigNumber | number | string, b?: BigNumber | number | string) {
super('FixedMathBinOpError', 'FixedMathBinOpError(uint8 error, uint256 a, uint256 b)', {
super('FixedMathBinOpError', 'FixedMathBinOpError(uint8 error, int256 a, int256 b)', {
error,
a,
b,

View File

@@ -67,7 +67,7 @@ export function coerceThrownErrorAsRevertError(error: Error): RevertError {
return decodeThrownErrorAsRevertError(error);
} catch (err) {
if (isGanacheTransactionRevertError(error)) {
return new AnyRevertError();
return err;
}
// Handle geth transaction reverts.
if (isGethTransactionRevertError(error)) {