Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmel2803 committed Feb 3, 2025
1 parent f4e6085 commit a9b0235
Show file tree
Hide file tree
Showing 25 changed files with 93 additions and 93 deletions.
8 changes: 2 additions & 6 deletions src/cli/alto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as sentry from "@sentry/node"
import dotenv from "dotenv"
import { HttpRequestError, InternalRpcError, TimeoutError } from "viem"
import yargs from "yargs"
import { hideBin } from "yargs/helpers"
import {
Expand All @@ -14,11 +15,6 @@ import {
serverOptions
} from "./config"
import { registerCommandToYargs } from "./util"
import {
TimeoutError,
HttpRequestError,
InternalRpcError,
} from "viem"

// Load environment variables from .env file
if (process.env.DOTENV_CONFIG_PATH) {
Expand All @@ -31,7 +27,7 @@ if (process.env.SENTRY_DSN) {
const SENTRY_IGNORE_ERRORS = [
InternalRpcError,
HttpRequestError,
TimeoutError,
TimeoutError
]

sentry.init({
Expand Down
4 changes: 2 additions & 2 deletions src/cli/customTransport.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { Logger } from "@alto/utils"
import {
type Hex,
type HttpTransport,
type HttpTransportConfig,
RpcRequestError,
UrlRequiredError,
createTransport,
toFunctionSelector,
getAbiItem,
isHex,
slice,
Hex
toFunctionSelector
} from "viem"
import { formatAbiItem, rpc } from "viem/utils"
import {
Expand Down
10 changes: 5 additions & 5 deletions src/cli/deploySimulationsContract.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { IOptions } from "@alto/cli"
import {
DETERMINISTIC_DEPLOYER_TRANSACTION,
pimlicoEntrypointSimulationsDeployBytecode,
pimlicoEntrypointSimulationsSalt
} from "@alto/types"
import {
http,
type Chain,
createWalletClient,
getContractAddress,
type Hex,
http,
type PublicClient,
type Transport,
concat
concat,
createWalletClient,
getContractAddress
} from "viem"
import type { CamelCasedProperties } from "./parseArgs"
import type { IOptions } from "@alto/cli"

const isContractDeployed = async ({
publicClient,
Expand Down
14 changes: 7 additions & 7 deletions src/cli/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import {
} from "@alto/utils"
import { Registry } from "prom-client"
import {
type CallParameters,
type Chain,
createPublicClient,
createWalletClient,
formatEther,
fallback,
CallParameters,
formatEther,
publicActions
} from "viem"
import { eip7702Actions } from "viem/experimental"
import { type AltoConfig, createConfig } from "../createConfig"
import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor"
import type { IOptionsInput } from "./config"
import { customTransport } from "./customTransport"
import { setupServer } from "./setupServer"
import { type AltoConfig, createConfig } from "../createConfig"
import { parseArgs } from "./parseArgs"
import { deploySimulationsContract } from "./deploySimulationsContract"
import { eip7702Actions } from "viem/experimental"
import { parseArgs } from "./parseArgs"
import { setupServer } from "./setupServer"

const preFlightChecks = async (config: AltoConfig): Promise<void> => {
for (const entrypoint of config.entrypoints) {
Expand Down Expand Up @@ -83,7 +83,7 @@ export async function bundlerHandler(args_: IOptionsInput): Promise<void> {

const chain: Chain = {
id: chainId,
name: 'chain-name', // isn't important, never used
name: "chain-name", // isn't important, never used
nativeCurrency: {
name: "ETH",
symbol: "ETH",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/parseArgs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IOptions, optionArgsSchema, type IOptionsInput } from "@alto/cli"
import { type IOptions, type IOptionsInput, optionArgsSchema } from "@alto/cli"
import { fromZodError } from "zod-validation-error"

type CamelCase<S extends string> =
Expand Down
2 changes: 1 addition & 1 deletion src/createConfig.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IOptions } from "@alto/cli"
import type { CamelCasedProperties } from "./cli/parseArgs"
import type { Bindings, ChildLoggerOptions, Logger } from "pino"
import type { Chain, PublicClient, Transport, WalletClient } from "viem"
import type { CamelCasedProperties } from "./cli/parseArgs"

export type AltoConfig = Readonly<CamelCasedProperties<IOptions>> & {
getLogger: <ChildCustomLevels extends string = never>(
Expand Down
26 changes: 13 additions & 13 deletions src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
type BundleResult,
EntryPointV06Abi,
EntryPointV07Abi,
type GasPriceParameters,
type HexData32,
type PackedUserOperation,
type TransactionInfo,
type UserOperation,
type UserOperationV07,
type GasPriceParameters
type UserOperationV07
} from "@alto/types"
import type { Logger, Metrics } from "@alto/utils"
import {
Expand All @@ -26,29 +26,29 @@ import {
import * as sentry from "@sentry/node"
import { Mutex } from "async-mutex"
import {
type Account,
BaseError,
FeeCapTooLowError,
type Hex,
InsufficientFundsError,
IntrinsicGasTooLowError,
NonceTooHighError,
NonceTooLowError,
TransactionExecutionError,
encodeFunctionData,
getContract,
type Account,
type Hex,
BaseError,
NonceTooHighError
getContract
} from "viem"
import type { SendTransactionErrorType } from "viem"
import type { AltoConfig } from "../createConfig"
import { sendPflConditional } from "./fastlane"
import type { SendTransactionOptions } from "./types"
import {
filterOpsAndEstimateGas,
flushStuckTransaction,
simulatedOpsToResults,
getAuthorizationList,
isTransactionUnderpricedError,
getAuthorizationList
simulatedOpsToResults
} from "./utils"
import type { SendTransactionErrorType } from "viem"
import type { AltoConfig } from "../createConfig"
import type { SendTransactionOptions } from "./types"
import { sendPflConditional } from "./fastlane"

export interface GasEstimateResult {
preverificationGas: bigint
Expand Down
4 changes: 2 additions & 2 deletions src/executor/executorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
type BundlingMode,
EntryPointV06Abi,
type HexData32,
type UserOperation,
type SubmittedUserOperation,
type TransactionInfo,
type UserOperation,
type UserOperationInfo
} from "@alto/types"
import type { BundlingStatus, Logger, Metrics } from "@alto/utils"
Expand All @@ -30,8 +30,8 @@ import {
type WatchBlocksReturnType,
getAbiItem
} from "viem"
import type { Executor, ReplaceTransactionResult } from "./executor"
import type { AltoConfig } from "../createConfig"
import type { Executor, ReplaceTransactionResult } from "./executor"

function getTransactionsFromUserOperationEntries(
entries: SubmittedUserOperation[]
Expand Down
18 changes: 9 additions & 9 deletions src/executor/fastlane.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Logger } from "@alto/utils"
import type { Logger } from "@alto/utils"
import {
Hex,
createClient,
http,
SendRawTransactionReturnType,
Hash,
WalletClient,
PublicClient,
toHex,
BaseError
BaseError,
type Hash,
type Hex,
type PublicClient,
type SendRawTransactionReturnType,
type WalletClient,
createClient,
toHex
} from "viem"

const pflClient = createClient({
Expand Down
4 changes: 2 additions & 2 deletions src/executor/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Account } from "viem"
import { SignedAuthorizationList } from "viem/experimental"
import type { Account } from "viem"
import type { SignedAuthorizationList } from "viem/experimental"

export type SendTransactionOptions =
| {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/utilityWalletMonitor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Logger, Metrics } from "@alto/utils"
import type { Address } from "abitype"
import { type Hex, formatEther } from "viem"
import type { AltoConfig } from "../createConfig"
import type { Address } from "abitype"

export class UtilityWalletMonitor {
private config: AltoConfig
Expand Down
6 changes: 3 additions & 3 deletions src/executor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import * as sentry from "@sentry/node"
import {
type Account,
type Address,
type BaseError,
type Chain,
ContractFunctionRevertedError,
EstimateGasExecutionError,
Expand All @@ -34,10 +35,9 @@ import {
type PublicClient,
type Transport,
type WalletClient,
decodeErrorResult,
BaseError
decodeErrorResult
} from "viem"
import { SignedAuthorizationList } from "viem/experimental"
import type { SignedAuthorizationList } from "viem/experimental"

export const isTransactionUnderpricedError = (e: BaseError) => {
return e?.details
Expand Down
6 changes: 3 additions & 3 deletions src/handlers/arbitrumGasPriceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ export class ArbitrumManager {
}

public getMinL1BaseFee() {
let minL1BaseFee = this.l1BaseFeeQueue.getMinValue() || 1n
const minL1BaseFee = this.l1BaseFeeQueue.getMinValue() || 1n
return minL1BaseFee
}

public getMaxL1BaseFee() {
let maxL1BaseFee = this.l1BaseFeeQueue.getMaxValue() || maxUint128
const maxL1BaseFee = this.l1BaseFeeQueue.getMaxValue() || maxUint128
return maxL1BaseFee
}

public getMaxL2BaseFee() {
let maxL2BaseFee = this.l2BaseFeeQueue.getMaxValue() || maxUint128
const maxL2BaseFee = this.l2BaseFeeQueue.getMaxValue() || maxUint128
return maxL2BaseFee
}
}
4 changes: 2 additions & 2 deletions src/handlers/eventManager.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Logger, Metrics } from "@alto/utils"
import * as sentry from "@sentry/node"
import Queue, { type Queue as QueueType } from "bull"
import Redis from "ioredis"
import type { Hex } from "viem"
import type { OpEventType } from "../types/schemas"
import type { AltoConfig } from "../createConfig"
import Queue, { type Queue as QueueType } from "bull"
import type { OpEventType } from "../types/schemas"

type QueueMessage = OpEventType & {
userOperationHash: Hex
Expand Down
2 changes: 1 addition & 1 deletion src/mempool/mempool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import {
isVersion07
} from "@alto/utils"
import { type Address, getAddress, getContract } from "viem"
import type { AltoConfig } from "../createConfig"
import type { Monitor } from "./monitoring"
import {
type InterfaceReputationManager,
ReputationStatuses
} from "./reputationManager"
import { MemoryStore } from "./store"
import type { AltoConfig } from "../createConfig"

export class MemoryMempool {
private config: AltoConfig
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/estimation/gasEstimationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { UserOperation } from "@alto/types"
import type { StateOverrides, UserOperationV07 } from "@alto/types"
import { deepHexlify, isVersion06 } from "@alto/utils"
import type { Hex } from "viem"
import { toHex, type Address, parseEther } from "viem"
import { type Address, parseEther, toHex } from "viem"
import type { AltoConfig } from "../../createConfig"
import { GasEstimatorV06 } from "./gasEstimationsV06"
import { GasEstimatorV07 } from "./gasEstimationsV07"
import type { SimulateHandleOpResult } from "./types"
import type { AltoConfig } from "../../createConfig"

function getStateOverrides({
addSenderBalanceOverride,
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/estimation/gasEstimationsV06.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import {
hexDataSchema
} from "@alto/types"
import type { StateOverrides, UserOperationV06 } from "@alto/types"
import { addAuthorizationStateOverrides, deepHexlify } from "@alto/utils"
import type { Hex, RpcRequestErrorType } from "viem"
import {
type Address,
RpcRequestError,
decodeErrorResult,
encodeFunctionData,
toHex,
RpcRequestError
toHex
} from "viem"
import { z } from "zod"
import type { SimulateHandleOpResult } from "./types"
import type { AltoConfig } from "../../createConfig"
import { parseFailedOpWithRevert } from "./gasEstimationsV07"
import { deepHexlify, addAuthorizationStateOverrides } from "@alto/utils"
import type { SimulateHandleOpResult } from "./types"

export class GasEstimatorV06 {
private config: AltoConfig
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/estimation/gasEstimationsV07.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
type BinarySearchCallResult,
EntryPointV07Abi,
EntryPointV07SimulationsAbi,
ExecutionErrors,
type ExecutionResult,
PimlicoEntryPointSimulationsAbi,
RpcError,
type StateOverrides,
type BinarySearchCallResult,
type UserOperationV07,
ValidationErrors,
type ValidationResultV07,
Expand All @@ -29,14 +29,14 @@ import {
toHex,
zeroAddress
} from "viem"
import type { SignedAuthorizationList } from "viem/experimental"
import type { AltoConfig } from "../../createConfig"
import { AccountExecuteAbi } from "../../types/contracts/IAccountExecute"
import {
type SimulateBinarySearchRetryResult,
type SimulateHandleOpResult,
simulationValidationResultStruct
} from "./types"
import type { AltoConfig } from "../../createConfig"
import type { SignedAuthorizationList } from "viem/experimental"

export class GasEstimatorV07 {
private config: AltoConfig
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/estimation/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {
Address,
BinarySearchCallResult,
ExecutionResult,
PackedUserOperation,
BinarySearchCallResult
PackedUserOperation
} from "@alto/types"
import type { Hex } from "viem"

Expand Down
Loading

0 comments on commit a9b0235

Please sign in to comment.