Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless-eth committed Oct 2, 2024
1 parent 77ee42e commit ad8647b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rpc/validation/UnsafeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export class UnsafeValidator implements InterfaceValidator {
const revertError = errorResult.walk(
(err) => err instanceof ContractFunctionExecutionError
)
this.logger.info("[DEBUG] errorResult instanceof BaseError")
throw new RpcError(
`UserOperation reverted during simulation with reason: ${
// biome-ignore lint/suspicious/noExplicitAny: it's a generic type
Expand All @@ -151,6 +152,7 @@ export class UnsafeValidator implements InterfaceValidator {

if (errorData.errorName === "FailedOp") {
const reason = errorData.args.reason
this.logger.info("[DEBUG] errorData.errorName === FailedOp")
throw new RpcError(
`UserOperation reverted during simulation with reason: ${reason}`,
ValidationErrors.SimulateValidation
Expand Down Expand Up @@ -201,6 +203,7 @@ export class UnsafeValidator implements InterfaceValidator {
)

if (error.result === "failed") {
this.logger.info("[DEBUG] error.result === failed")
throw new RpcError(
`UserOperation reverted during simulation with reason: ${error.data}`,
ExecutionErrors.UserOperationReverted
Expand Down Expand Up @@ -299,6 +302,7 @@ export class UnsafeValidator implements InterfaceValidator {

// validate runtime
if (runtimeValidation.result === "failed") {
this.logger.info("[DEBUG] runtimeValidation.result === failed")
throw new RpcError(
`UserOperation reverted during simulation with reason: ${runtimeValidation.data}`,
ValidationErrors.SimulateValidation
Expand Down

0 comments on commit ad8647b

Please sign in to comment.