Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmel2803 committed Oct 10, 2024
1 parent 2eb5934 commit b3a0882
Show file tree
Hide file tree
Showing 49 changed files with 2,076 additions and 300 deletions.
1 change: 1 addition & 0 deletions contracts/lib/account-abstraction
Submodule account-abstraction added at abff2a
1 change: 1 addition & 0 deletions contracts/lib/forge-std
Submodule forge-std added at f73c73
1 change: 1 addition & 0 deletions contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at fd81a9
36 changes: 18 additions & 18 deletions scripts/localDeployer/index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import {
http,
createTestClient,
createWalletClient,
createPublicClient,
type Address,
type Hex
type Hex,
createPublicClient,
createTestClient,
createWalletClient
} from "viem"
import { mnemonicToAccount } from "viem/accounts"
import { foundry } from "viem/chains"
import {
MULTICALL3_BYTECODE,
BICONOMY_ACCOUNT_V2_LOGIC_CREATECALL,
BICONOMY_DEFAULT_FALLBACK_HANDLER_CREATECALL,
BICONOMY_ECDSA_OWNERSHIP_REGISTRY_MOUDULE_CREATECALL,
BICONOMY_FACTORY_CREATECALL,
BICONOMY_SINGLETON_FACTORY_BYTECODE,
ENTRY_POINT_SIMULATIONS_CREATECALL,
ENTRY_POINT_V06_CREATECALL,
ENTRY_POINT_V07_CREATECALL,
KERNEL_ACCOUNT_V2_2_LOGIC_CREATECALL,
KERNEL_ECDSA_VALIDATOR_CREATECALL,
KERNEL_FACTORY_CREATECALL,
MULTICALL3_BYTECODE,
SAFE_MULTI_SEND_CALL_ONLY_CREATECALL,
SAFE_MULTI_SEND_CREATECALL,
SAFE_V06_MODULE_CREATECALL,
SAFE_V07_MODULE_SETUP_CREATECALL,
SAFE_PROXY_FACTORY_CREATECALL,
SAFE_SINGLETON_CREATECALL,
SAFE_SINGLETON_FACTORY_BYTECODE,
SIMPLE_ACCOUNT_FACTORY_V06_CREATECALL,
SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL,
SAFE_V06_MODULE_CREATECALL,
SAFE_V06_MODULE_SETUP_CREATECALL,
SAFE_V07_MODULE_CREATECALL,
BICONOMY_SINGLETON_FACTORY_BYTECODE,
BICONOMY_ECDSA_OWNERSHIP_REGISTRY_MOUDULE_CREATECALL,
BICONOMY_ACCOUNT_V2_LOGIC_CREATECALL,
BICONOMY_FACTORY_CREATECALL,
KERNEL_ACCOUNT_V2_2_LOGIC_CREATECALL,
KERNEL_ECDSA_VALIDATOR_CREATECALL,
KERNEL_FACTORY_CREATECALL,
BICONOMY_DEFAULT_FALLBACK_HANDLER_CREATECALL,
SAFE_MULTI_SEND_CALL_ONLY_CREATECALL
SAFE_V07_MODULE_SETUP_CREATECALL,
SIMPLE_ACCOUNT_FACTORY_V06_CREATECALL,
SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL
} from "./constants"

const DETERMINISTIC_DEPLOYER = "0x4e59b44847b379578588920ca78fbf26c0b4956c"
Expand Down
4 changes: 2 additions & 2 deletions src/cli/config/bundler.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
type ApiVersion,
addressSchema,
bundlerRequestSchema,
commaSeperatedAddressPattern,
hexData32Schema,
bundlerRequestSchema
hexData32Schema
} from "@alto/types"
import type { Hex } from "viem"
import { type Account, privateKeyToAccount } from "viem/accounts"
Expand Down
6 changes: 5 additions & 1 deletion src/cli/customTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export function customTransport(
error: {
...error,
// 24 Aug 2024, etherlink throws -32003 error code for eth_call
code: (method === 'eth_call' && error.code === -32003) ? 3 : error.code,
code:
method === "eth_call" &&
error.code === -32003
? 3
: error.code
},
url: url
})
Expand Down
20 changes: 10 additions & 10 deletions src/cli/handler.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { SenderManager } from "@alto/executor"
import { GasPriceManager } from "@alto/handlers"
import {
type Logger,
createMetrics,
initDebugLogger,
initProductionLogger,
type Logger
initProductionLogger
} from "@alto/utils"
import { Registry } from "prom-client"
import {
createPublicClient,
createWalletClient,
http,
type Chain,
type PublicClient,
type Transport,
http,
createPublicClient,
createWalletClient,
formatEther
} from "viem"
import { fromZodError } from "zod-validation-error"
import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor"
import { PimlicoEntryPointSimulationsDeployBytecode } from "../types/contracts"
import {
optionArgsSchema,
type IBundlerArgs,
type IOptions,
type IOptionsInput
type IOptionsInput,
optionArgsSchema
} from "./config"
import { customTransport } from "./customTransport"
import { setupServer } from "./setupServer"
import { PimlicoEntryPointSimulationsDeployBytecode } from "../types/contracts"
import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor"
import { GasPriceManager } from "@alto/handlers"

const parseArgs = (args: IOptionsInput): IOptions => {
// validate every arg, make type safe so if i add a new arg i have to validate it
Expand Down
2 changes: 1 addition & 1 deletion src/cli/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto"
import { FastifyInstrumentation } from "@opentelemetry/instrumentation-fastify"
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"
import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino"
import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici"
import { NodeSDK } from "@opentelemetry/sdk-node"
import {
ParentBasedSampler,
type Sampler,
SamplingDecision
} from "@opentelemetry/sdk-trace-base"
import { SemanticAttributes } from "@opentelemetry/semantic-conventions"
import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici"

class CustomSampler implements Sampler {
shouldSample(
Expand Down
8 changes: 4 additions & 4 deletions src/cli/setupServer.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { SenderManager } from "@alto/executor"
import { Executor, ExecutorManager } from "@alto/executor"
import {
type GasPriceManager,
CompressionHandler,
EventManager
EventManager,
type GasPriceManager
} from "@alto/handlers"
import {
type InterfaceReputationManager,
MemoryMempool,
Monitor,
NullReputationManager,
ReputationManager,
type InterfaceReputationManager
ReputationManager
} from "@alto/mempool"
import {
NonceQueuer,
Expand Down
36 changes: 18 additions & 18 deletions src/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ import type {
DefaultFilterOpsAndEstimateGasParams,
SenderManager
} from "@alto/executor"
import type {
CompressionHandler,
EventManager,
GasPriceManager
} from "@alto/handlers"
import type { InterfaceReputationManager } from "@alto/mempool"
import {
type TransactionInfo,
type Address,
type UserOperation,
type BundleResult,
type CompressedUserOperation,
type HexData32,
deriveUserOperation,
EntryPointV06Abi,
EntryPointV07Abi,
type HexData32,
type PackedUserOperation,
type TransactionInfo,
type UserOperation,
type UserOperationV06,
type UserOperationV07,
type PackedUserOperation,
type UserOperationWithHash
type UserOperationWithHash,
deriveUserOperation
} from "@alto/types"
import type { Logger, Metrics } from "@alto/utils"
import type {
GasPriceManager,
CompressionHandler,
EventManager
} from "@alto/handlers"
import {
getRequiredPrefund,
getUserOperationHash,
Expand All @@ -36,24 +36,24 @@ import {
import * as sentry from "@sentry/node"
import { Mutex } from "async-mutex"
import {
type Account,
type Chain,
FeeCapTooLowError,
InsufficientFundsError,
IntrinsicGasTooLowError,
NonceTooLowError,
encodeFunctionData,
getContract,
type Account,
type Chain,
type PublicClient,
type Transport,
type WalletClient
type WalletClient,
encodeFunctionData,
getContract
} from "viem"
import {
type CompressedFilterOpsAndEstimateGasParams,
createCompressedCalldata,
filterOpsAndEstimateGas,
flushStuckTransaction,
simulatedOpsToResults,
type CompressedFilterOpsAndEstimateGasParams
simulatedOpsToResults
} from "./utils"

export interface GasEstimateResult {
Expand Down
18 changes: 9 additions & 9 deletions src/executor/executorManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { Metrics, Logger, BundlingStatus } from "@alto/utils"
import type { EventManager, GasPriceManager } from "@alto/handlers"
import type {
InterfaceReputationManager,
Expand All @@ -8,33 +7,34 @@ import type {
import {
type BundleResult,
type BundlingMode,
type CompressedUserOperation,
EntryPointV06Abi,
type HexData32,
type MempoolUserOperation,
type SubmittedUserOperation,
type TransactionInfo,
deriveUserOperation,
isCompressedType,
type UserOperation,
type CompressedUserOperation,
type UserOperationInfo,
EntryPointV06Abi
deriveUserOperation,
isCompressedType
} from "@alto/types"
import type { BundlingStatus, Logger, Metrics } from "@alto/utils"
import {
getAAError,
getBundleStatus,
parseUserOperationReceipt
} from "@alto/utils"
import {
getAbiItem,
type TransactionReceipt,
TransactionReceiptNotFoundError,
type Address,
type Block,
type Chain,
type Hash,
type PublicClient,
type TransactionReceipt,
TransactionReceiptNotFoundError,
type Transport,
type WatchBlocksReturnType
type WatchBlocksReturnType,
getAbiItem
} from "viem"
import type { Executor, ReplaceTransactionResult } from "./executor"

Expand Down
10 changes: 5 additions & 5 deletions src/executor/senderManager.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import type { GasPriceManager } from "@alto/handlers"
import {
CallEngineAbi,
type Address,
CallEngineAbi,
type HexData,
type HexData32
} from "@alto/types"
import type { Logger, Metrics } from "@alto/utils"
import type { GasPriceManager } from "@alto/handlers"
import { Semaphore } from "async-mutex"
import {
formatEther,
getContract,
type Account,
type Chain,
type PublicClient,
type TransactionReceipt,
type Transport,
type WalletClient
type WalletClient,
formatEther,
getContract
} from "viem"

const waitForTransactionReceipt = async (
Expand Down
2 changes: 1 addition & 1 deletion src/executor/utilityWalletMonitor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Logger, Metrics } from "@alto/utils"
import { formatEther, type Hex, type PublicClient } from "viem"
import { type Hex, type PublicClient, formatEther } from "viem"

export class UtilityWalletMonitor {
private publicClient: PublicClient
Expand Down
6 changes: 3 additions & 3 deletions src/executor/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used
import * as sentry from "@sentry/node"
import type { InterfaceReputationManager } from "@alto/mempool"
import {
type BundleResult,
Expand All @@ -19,11 +17,13 @@ import {
import type { Logger } from "@alto/utils"
import {
getRevertErrorData,
scaleBigIntByPercent,
isVersion06,
parseViemError,
scaleBigIntByPercent,
toPackedUserOperation
} from "@alto/utils"
// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used
import * as sentry from "@sentry/node"
import {
type Account,
type Address,
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/eventManager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Logger, Metrics } from "@alto/utils"
// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used
import * as sentry from "@sentry/node"
import Redis from "ioredis"
import type { Hex } from "viem"
import type { OpEventType } from "../types/schemas"
import type { Logger, Metrics } from "@alto/utils"

export class EventManager {
private redis: Redis | undefined
Expand Down
12 changes: 6 additions & 6 deletions src/handlers/gasPriceManager.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
RpcError,
gasStationResult,
type ChainType,
type GasPriceParameters,
type ChainType
RpcError,
gasStationResult
} from "@alto/types"
import { maxBigInt, minBigInt, type Logger } from "@alto/utils"
import { type Logger, maxBigInt, minBigInt } from "@alto/utils"
import * as sentry from "@sentry/node"
import { parseGwei, type Chain, type PublicClient, maxUint128 } from "viem"
import { type Chain, type PublicClient, maxUint128, parseGwei } from "viem"
import {
avalanche,
celo,
celoAlfajores,
dfk,
avalanche,
polygon,
polygonMumbai
} from "viem/chains"
Expand Down
Loading

0 comments on commit b3a0882

Please sign in to comment.