Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update simulations contract #404

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions src/rpc/estimation/gasEstimationsV07.ts
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,7 @@ function validateBinarySearchDataResult(
code: ExecutionErrors.UserOperationReverted
} as const
} catch (_e) {
// Check if the result hit eth_call gasLimit.
const simulationOutOfGasSelector = toFunctionSelector(
"SimulationOutOfGas(uint256 optimalGas, uint256 minGas, uint256 maxGas)"
)

if (slice(data, 0, 4) === simulationOutOfGasSelector) {
try {
const res = decodeErrorResult({
abi: EntryPointV07SimulationsAbi,
data: data
Expand All @@ -868,14 +863,20 @@ function validateBinarySearchDataResult(
maxGas
} as const
}
}

// no error we go the result
return {
result: "failed",
data: "Unknown error, could not parse target call data result.",
code: ExecutionErrors.UserOperationReverted
} as const
return {
result: "failed",
data,
code: ExecutionErrors.UserOperationReverted
}
} catch {
// no error we go the result
return {
result: "failed",
data: "Unknown error, could not parse target call data result.",
code: ExecutionErrors.UserOperationReverted
} as const
}
}
}

Expand Down
Loading
Loading