Commit 88bee890 authored by yann300's avatar yann300

linting

parent 521ab4af
...@@ -91,14 +91,14 @@ export function checkVMError (txResult, abi) { ...@@ -91,14 +91,14 @@ export function checkVMError (txResult, abi) {
const returnData = txResult.result.execResult.returnValue const returnData = txResult.result.execResult.returnValue
const returnDataHex = returnData.slice(0, 4).toString('hex') const returnDataHex = returnData.slice(0, 4).toString('hex')
let customError let customError
if (abi) { if (abi) {
let decodedCustomErrorInputs let decodedCustomErrorInputs
for (const item of abi) { for (const item of abi) {
if (item.type === 'error') { if (item.type === 'error') {
// ethers doesn't crash anymore if "error" type is specified, but it doesn't extract the errors. see: // ethers doesn't crash anymore if "error" type is specified, but it doesn't extract the errors. see:
// https://github.com/ethers-io/ethers.js/commit/bd05aed070ac9e1421a3e2bff2ceea150bedf9b7 // https://github.com/ethers-io/ethers.js/commit/bd05aed070ac9e1421a3e2bff2ceea150bedf9b7
// we need here to fake the type, so the "getSighash" function works properly // we need here to fake the type, so the "getSighash" function works properly
const fn = getFunctionFragment({ ...item, type: 'function', stateMutability: "nonpayable" }) const fn = getFunctionFragment({ ...item, type: 'function', stateMutability: 'nonpayable' })
if (!fn) continue if (!fn) continue
const sign = fn.getSighash(item.name) const sign = fn.getSighash(item.name)
if (!sign) continue if (!sign) continue
...@@ -110,9 +110,9 @@ export function checkVMError (txResult, abi) { ...@@ -110,9 +110,9 @@ export function checkVMError (txResult, abi) {
} }
} }
if (decodedCustomErrorInputs) { if (decodedCustomErrorInputs) {
msg = `\tThe transaction has been reverted to the initial state.\nError provided by the contract:` msg = '\tThe transaction has been reverted to the initial state.\nError provided by the contract:'
msg += `\n${customError}` msg += `\n${customError}`
msg += `\nParameters:` msg += '\nParameters:'
msg += `\n${decodedCustomErrorInputs}` msg += `\n${decodedCustomErrorInputs}`
} }
} }
......
...@@ -40,7 +40,7 @@ export function encodeFunctionId (funABI) { ...@@ -40,7 +40,7 @@ export function encodeFunctionId (funABI) {
export function getFunctionFragment (funABI): ethers.utils.Interface { export function getFunctionFragment (funABI): ethers.utils.Interface {
if (funABI.type === 'fallback' || funABI.type === 'receive') return null if (funABI.type === 'fallback' || funABI.type === 'receive') return null
return new ethers.utils.Interface([funABI]) return new ethers.utils.Interface([funABI])
} }
export function sortAbiFunction (contractabi) { export function sortAbiFunction (contractabi) {
...@@ -120,10 +120,9 @@ export function getFromInterface (abi, fnName, type) { ...@@ -120,10 +120,9 @@ export function getFromInterface (abi, fnName, type) {
return fn return fn
} }
} }
return null return null
} }
export function getFunction (abi, fnName) { export function getFunction (abi, fnName) {
return getFromInterface(abi, fnName, 'function') return getFromInterface(abi, fnName, 'function')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment