Skip to content

Commit

Permalink
chore: tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Aug 26, 2024
1 parent 4b883cc commit 050f79c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: playground
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
playground:
name: playground
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"sideEffects": false,
"name": "@biconomy/sdk",
"author": "Biconomy",
"version": "0.1.0",
"version": "0.0.1",
"description": "SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.",
"keywords": [
"erc-7579",
Expand Down
11 changes: 4 additions & 7 deletions src/account/NexusSmartAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1421,14 +1421,11 @@ export class NexusSmartAccount extends BaseSmartContractAccount {

userOp.signature = dummySignature

if (!buildUseropDto?.skipBundler) {
const gasFeeValues: GetUserOperationGasPriceReturnType | undefined =
await this.bundler?.getGasFeeValues()
const gasFeeValues: GetUserOperationGasPriceReturnType | undefined =
await this.bundler?.getGasFeeValues()

userOp.maxFeePerGas = gasFeeValues?.fast.maxFeePerGas ?? 0n
userOp.maxPriorityFeePerGas =
gasFeeValues?.fast.maxPriorityFeePerGas ?? 0n
}
userOp.maxFeePerGas = gasFeeValues?.fast.maxFeePerGas ?? 0n
userOp.maxPriorityFeePerGas = gasFeeValues?.fast.maxPriorityFeePerGas ?? 0n

userOp = await this.estimateUserOpGas(userOp)

Expand Down
3 changes: 0 additions & 3 deletions src/account/utils/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ export type BuildUserOpOptions = {
dummyPndOverride?: BytesLike
useEmptyDeployCallData?: boolean
useExecutor?: boolean
skipBundler?: boolean
}

export type NonceOptions = {
Expand Down Expand Up @@ -285,8 +284,6 @@ export type InitializeV2Data = {

export type EstimateUserOpGasParams = {
userOp: Partial<UserOperationStruct>
/** Currrently has no effect */
// skipBundlerGasEstimation?: boolean;
/** paymasterServiceData: Options specific to transactions that involve a paymaster */
paymasterServiceData?: SponsorUserOperationDto
}
Expand Down
6 changes: 4 additions & 2 deletions src/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { Hex } from "viem"
import { K1ValidatorAbi, MockExecutorAbi } from "./abi"
import { EntrypointAbi } from "./abi/EntryPointABI"
import { K1ValidatorFactoryAbi } from "./abi/K1ValidatorFactoryAbi"
import { deployedContracts } from "./addresses"

export const ENTRYPOINT_SIMULATIONS =
export const ENTRYPOINT_SIMULATIONS: Hex =
"0x74Cb5e4eE81b86e70f9045036a1C5477de69eE87"
export const ENTRYPOINT_ADDRESS = "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
export const ENTRYPOINT_ADDRESS: Hex =
"0x0000000071727De22E5E9d8BAf0edAc6f37da032"

const EntryPoint = {
address: ENTRYPOINT_ADDRESS,
Expand Down
4 changes: 2 additions & 2 deletions src/modules/base/BaseModule.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Address, type Hex, encodeFunctionData, parseAbi } from "viem"
import type { SmartAccountSigner } from "../../account/index.js"
import { ENTRYPOINT_ADDRESS } from "../../contracts/index.js"
import contracts from "../../contracts"
import {
type Module,
type ModuleType,
Expand All @@ -15,7 +15,7 @@ export abstract class BaseModule {
type: ModuleType
hook?: Address
version: ModuleVersion = "1.0.0-beta"
entryPoint: Address = ENTRYPOINT_ADDRESS
entryPoint: Address = contracts.EntryPoint.address
signer: SmartAccountSigner

constructor(module: Module, signer: SmartAccountSigner) {
Expand Down
6 changes: 6 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Testing Setup

> **Note**:
> - Tests now must be run with node version >= v22
### Network Agnostic Tests
- Tests are executed against locally deployed ephemeral Anvil chains (chain ID: 31337) with relevant contracts pre-deployed for each test.
- Bundlers for testing are instantiated using [prool](https://github.com/wevm/prool), currently utilizing alto instances. We plan to switch to Biconomy's bundlers when they become available via `prool`.
Expand Down Expand Up @@ -56,3 +59,6 @@ scopedTest("should be used in the following way", async({ config: { bundlerUrl,
## Debugging and Client Issues
It is recommended to use the playground for debugging issues with clients. Please refer to the following guidelines for escalation and handover: [Debugging Client Issues](https://www.notion.so/biconomy/Debugging-Client-Issues-cc01c1cab0224c87b37a4d283370165b)

## Testing Helpers
A [testClient](https://viem.sh/docs/clients/test#extending-with-public--wallet-actions) Was made available (funded and extended with walletActions and publicActions) during testing. Please use it as a master Client for all things network related.

8 changes: 4 additions & 4 deletions tests/test.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from "../src"
import { getCustomChain } from "../src/account/utils"
import { Logger } from "../src/account/utils/Logger"
import { ENTRYPOINT_ADDRESS, ENTRYPOINT_SIMULATIONS } from "../src/contracts"
import { K1ValidatorAbi, NexusAbi } from "../src/contracts/abi"
import { K1ValidatorFactoryAbi } from "../src/contracts/abi/K1ValidatorFactoryAbi"
import deployedContracts from "./contracts/deployment.json"
Expand All @@ -35,6 +34,7 @@ import {
ENTRY_POINT_V07_CREATECALL
} from "./create.config"

import contracts from "../src/contracts"
import {
BiconomyMetaFactoryAbi,
BootstrapAbi,
Expand Down Expand Up @@ -128,10 +128,10 @@ export const toBundlerInstance = async ({
bundlerPort: number
}): Promise<BundlerInstance> => {
const instance = alto({
entrypoints: [ENTRYPOINT_ADDRESS],
entrypoints: [contracts.EntryPoint.address],
rpcUrl: rpcUrl,
executorPrivateKeys: [pKey],
entrypointSimulationContract: ENTRYPOINT_SIMULATIONS,
entrypointSimulationContract: contracts.EntryPointSimulations.address,
safeMode: false,
port: bundlerPort
})
Expand Down Expand Up @@ -426,7 +426,7 @@ const deploy = async (rpcPort: number): Promise<Deployment> => {
const nexusHash = await testClient.deployContract({
bytecode: deployedContracts.Nexus.bytecode as Hex,
abi: NexusAbi,
args: [ENTRYPOINT_ADDRESS]
args: [contracts.EntryPoint.address]
})

const bootstrapLibHash = await testClient.deployContract({
Expand Down

0 comments on commit 050f79c

Please sign in to comment.