Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless-eth committed Oct 4, 2024
1 parent fde6a08 commit d3c1fce
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 203 deletions.
29 changes: 4 additions & 25 deletions src/rpc/estimation/gasEstimation.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import {
type ExecutionResult,
type UserOperation,
RpcError,
ValidationErrors
} from "@alto/types"
import type {
StateOverrides,
TargetCallResult,
UserOperationV07
} from "@alto/types"
import { deepHexlify, isVersion06 } from "@alto/utils"
import { type UserOperation, RpcError, ValidationErrors } from "@alto/types"
import type { StateOverrides, UserOperationV07 } from "@alto/types"
import type { Hex } from "viem"
import type { SimulateHandleOpResult } from "./types"
import { deepHexlify, isVersion06 } from "@alto/utils"
import { type Address, type PublicClient, toHex } from "viem"
import { simulateHandleOpV07 } from "./gasEstimationsV07"
import { simulateHandleOpV06 } from "./gasEstimationsV06"
Expand Down Expand Up @@ -53,19 +45,6 @@ function getStateOverrides({
}
}

export type SimulateHandleOpResult<
TypeResult extends "failed" | "execution" = "failed" | "execution"
> = {
result: TypeResult
data: TypeResult extends "failed"
? string
: {
callDataResult?: TargetCallResult
executionResult: ExecutionResult
}
code?: TypeResult extends "failed" ? number : undefined
}

export function simulateHandleOp(
userOperation: UserOperation,
queuedUserOperations: UserOperation[],
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/estimation/gasEstimationsV06.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
toHex
} from "viem"
import { z } from "zod"
import type { SimulateHandleOpResult } from "./gasEstimation"
import type { SimulateHandleOpResult } from "./types"

export async function simulateHandleOpV06(
userOperation: UserOperationV06,
Expand Down
Loading

0 comments on commit d3c1fce

Please sign in to comment.