Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
case "send": {
const result = await operation;
return { txHash: result.tx, method, result };
}
case "call": {
// replays as send
const { contract, fn, abi, args, address } = method;
// get the result of the call
const result = await operation;
// and replay it as a transaction so we can debug
// bit of a HACK: properly making a call act like a tx requires forking
const { tx: txHash } = await execute.send.call(
contract,
fn,
abi,
address
)(...args);
return { txHash, method, result };
}
default: {
throw new Error(`Unsupported action for debugging: ${action}`);
}
}
}