diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-12-24 12:00:23 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2019-01-15 02:49:44 +0800 |
commit | 6d832deb62cdef38c5fa69169986ef00dbc6e1eb (patch) | |
tree | a8f6eac5dbf5573ef17a5a603beaff7e2ba9c4fd | |
parent | 0b6c9c84688b565a9000b2c4e889c682ccaa7e51 (diff) | |
download | dexon-0x-contracts-6d832deb62cdef38c5fa69169986ef00dbc6e1eb.tar.gz dexon-0x-contracts-6d832deb62cdef38c5fa69169986ef00dbc6e1eb.tar.zst dexon-0x-contracts-6d832deb62cdef38c5fa69169986ef00dbc6e1eb.zip |
Decodes revert reason as array to appease Geth
-rw-r--r-- | packages/base-contract/src/index.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 814b052b0..9723dc9c8 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -82,7 +82,7 @@ export class BaseContract { } protected static _throwIfRevertWithReasonCallResult(rawCallResult: string): void { if (rawCallResult.slice(REVERT_ERROR_SELECTOR_OFFSET, REVERT_ERROR_SELECTOR_END) === REVERT_ERROR_SELECTOR) { - const revertReason = AbiEncoder.create('(string)').decode( + const revertReason = AbiEncoder.create('(string)').decodeAsArray( ethers.utils.hexDataSlice(rawCallResult, REVERT_ERROR_SELECTOR_BYTES_LENGTH), ); throw new Error(revertReason); |