diff options
-rw-r--r-- | packages/base-contract/src/index.ts | 4 | ||||
-rw-r--r-- | packages/utils/test/abi_encoder/return_values_test.ts | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index f14b9a96a..c2b7b943b 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -90,7 +90,9 @@ export class BaseContract { ethers.utils.hexDataSlice(rawCallResult, REVERT_ERROR_SELECTOR_BYTES_LENGTH), ); if (revertReasonArray.length !== 1) { - throw new Error(`Cannot safely decode revert reason: Expected an array with one element, got ${revertReasonArray}`); + throw new Error( + `Cannot safely decode revert reason: Expected an array with one element, got ${revertReasonArray}`, + ); } const revertReason = revertReasonArray[0]; throw new Error(revertReason); diff --git a/packages/utils/test/abi_encoder/return_values_test.ts b/packages/utils/test/abi_encoder/return_values_test.ts index a745ed814..308d11ee5 100644 --- a/packages/utils/test/abi_encoder/return_values_test.ts +++ b/packages/utils/test/abi_encoder/return_values_test.ts @@ -24,7 +24,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.singleStaticReturnValue); const returnValue = ['0x01020304']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { shouldConvertStructsToObjects: false }); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -33,7 +35,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.multipleStaticReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { shouldConvertStructsToObjects: false }); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -42,7 +46,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.singleDynamicReturnValue); const returnValue = ['0x01020304']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { shouldConvertStructsToObjects: false }); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -51,7 +57,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.multipleDynamicReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { shouldConvertStructsToObjects: false }); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); @@ -60,7 +68,9 @@ describe('ABI Encoder: Return Value Encoding/Decoding', () => { const method = new AbiEncoder.Method(ReturnValueAbis.mixedStaticAndDynamicReturnValues); const returnValue = ['0x01020304', '0x05060708']; const encodedReturnValue = method.encodeReturnValues(returnValue, encodingRules); - const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { shouldConvertStructsToObjects: false }); + const decodedReturnValue = method.decodeReturnValues(encodedReturnValue, { + shouldConvertStructsToObjects: false, + }); // Validate decoded return value expect(decodedReturnValue).to.be.deep.equal(returnValue); }); |