Commit e67551c3 authored by elenadimitrova's avatar elenadimitrova

Fix smockit for a change in hardhat ^2.4.0

which changes the way it parses errors from returndata
Fix provided by @smartcontracts
parent 4435bece
...@@ -14,7 +14,12 @@ try { ...@@ -14,7 +14,12 @@ try {
ReturnData, ReturnData,
} = require('hardhat/internal/hardhat-network/provider/return-data') } = require('hardhat/internal/hardhat-network/provider/return-data')
decodeRevertReason = (value: Buffer) => { decodeRevertReason = (value: Buffer) => {
return new ReturnData(value).decodeError() const returnData = new ReturnData(value)
if (returnData.isErrorReturnData()) {
return returnData.decodeError()
} else {
return ''
}
} }
} }
// Handle hardhat ^2.2.0 // Handle hardhat ^2.2.0
......
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