Skip to content

Commit

Permalink
pass state overrides when retrying
Browse files Browse the repository at this point in the history
  • Loading branch information
plusminushalf committed Oct 19, 2024
1 parent e6d99a0 commit 0d87e56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "pnpm -r run build",
"build:esm": "pnpm -r run build:esm",
"start": "node src/lib/cli/alto.js run",
"dev": "pnpm -r run dev",
"dev": "nodemon --ext ts,js,json --watch src --exec DOTENV_CONFIG_PATH=$(pwd)/.env ts-node --project src/tsconfig.json -r tsconfig-paths/register src/cli/alto.ts run",
"test": "pnpm -r --workspace-concurrency 1 test --verbose=true",
"test:spec": "./test/spec-tests/run-spec-tests.sh",
"lint": "biome check .",
Expand Down
10 changes: 7 additions & 3 deletions src/rpc/estimation/gasEstimationsV07.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ export class GasEstimatorV07 {
minGas,
targetOp,
queuedOps,
stateOverrides,
simulateHandleOpLastResult
}: {
entryPoint: Address
optimalGas: bigint
minGas: bigint
targetOp: UserOperationV07
queuedOps: UserOperationV07[]
stateOverrides: StateOverrides
simulateHandleOpLastResult: SimulateHandleOpResult<"execution">
}): Promise<SimulateHandleOpResult> {
const maxRetries = 3
Expand All @@ -211,7 +213,8 @@ export class GasEstimatorV07 {

let cause = await this.callPimlicoEntryPointSimulations({
entryPoint,
entryPointSimulationsCallData: [simulateCallData]
entryPointSimulationsCallData: [simulateCallData],
stateOverrides
})

cause = cause.map((data: Hex) => {
Expand Down Expand Up @@ -283,7 +286,7 @@ export class GasEstimatorV07 {
queuedUserOperations
})

let cause
let cause: readonly Hex[]

if (this.config.chainType === "hedera") {
// due to Hedera specific restrictions, we can't combine these two calls.
Expand Down Expand Up @@ -355,7 +358,8 @@ export class GasEstimatorV07 {
targetOp: userOperation,
queuedOps: queuedUserOperations,
simulateHandleOpLastResult:
simulateHandleOpLastResult as SimulateHandleOpResult<"execution">
simulateHandleOpLastResult as SimulateHandleOpResult<"execution">,
stateOverrides
})
}

Expand Down

0 comments on commit 0d87e56

Please sign in to comment.