Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mock: MockContract = vm._smockState.mocks[target]
const {
resolve,
functionName,
rawReturnValue,
returnValue,
gasUsed,
} = await mock._smockit(message.data)
// Set the mock return data, potentially set the `exceptionError` field if the user requested
// a revert.
result.gasUsed = new BN(gasUsed)
result.execResult.returnValue = returnValue
result.execResult.gasUsed = new BN(gasUsed)
result.execResult.exceptionError =
resolve === 'revert' ? new VmError('smocked revert' as any) : undefined
})