Skip to content

Commit

Permalink
chore: fix paymaster tests in cicd (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler authored Dec 13, 2024
1 parent da16034 commit 0c7940d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PIMLICO_API_KEY: ${{ secrets.PIMLICO_API_KEY }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
PAYMASTER_URL: ${{ secrets.PAYMASTER_URL }}
BUNDLER_URL: ${{ secrets.BUNDLER_URL }}
CHAIN_ID: 84532
CI: true
35 changes: 13 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@ The Biconomy SDK is your all-in-one toolkit for building decentralized applicati

### Installation

1. **Add the package and install dependencies:**

1. **Add the package:**
```bash
bun add @biconomy/sdk viem @rhinestone/module-sdk
```

2. **Install dependencies:**

```bash
bun i
```

2. **Basic Usage:**
```typescript
import { createNexusClient } from "@biconomy/sdk";
import { http } from "viem";
Expand All @@ -48,35 +42,32 @@ const nexusClient = await createNexusClient({
bundlerTransport: http(bundlerUrl),
});

const hash = await nexusClient.sendTransaction({ calls: [to: "0x...", value: 1] });
const { status, transactionHash } = await nexusClient.waitForTransactionReceipt({ hash });
const hash = await nexusClient.sendTransaction({
calls: [{ to: "0x...", value: 1 }]
});

const { status, transactionHash } = await nexusClient.waitForTransactionReceipt({ hash });
```

3. Testing

To run the tests, ensure you have the following prerequisites installed:
### Testing

**Prerequisites:**
- Node.js v22 or higher
- [Bun](https://bun.sh/) package manager
- [Foundry](https://book.getfoundry.sh/getting-started/installation)

Install the dependencies:

**Setup:**
```bash
bun install --frozen-lockfile
```

### Run all tests

**Running Tests:**
```bash
# Run all tests
bun run test
```

### Run tests for a specific module

```bash
bun run test -t=smartSessions
# Run tests for a specific module
bun run test -t=smartSessions
```

For detailed information about the testing framework, network configurations, and debugging guidelines, please refer to our [Testing Documentation](./src/test/README.md).
Expand Down
10 changes: 0 additions & 10 deletions src/sdk/clients/createBicoPaymasterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import { paymasterTruthy, toNetwork } from "../../test/testSetup"
import { getTestParamsForTestnet, killNetwork } from "../../test/testUtils"
import type { NetworkConfig, TestnetParams } from "../../test/testUtils"
import { type NexusAccount, toNexusAccount } from "../account/toNexusAccount"
import {
type BicoBundlerClient,
createBicoBundlerClient
} from "./createBicoBundlerClient"
import {
type BicoPaymasterClient,
createBicoPaymasterClient
Expand All @@ -37,7 +33,6 @@ describe.runIf(paymasterTruthy())("bico.paymaster", async () => {
let publicClient: PublicClient // testClient not available on public testnets
let account: PrivateKeyAccount
let recipientAddress: Address
let bicoBundler: BicoBundlerClient
let nexusAccountAddress: Address
let paymaster: BicoPaymasterClient
let nexusAccount: NexusAccount
Expand Down Expand Up @@ -77,11 +72,6 @@ describe.runIf(paymasterTruthy())("bico.paymaster", async () => {
...testParams
})

bicoBundler = createBicoBundlerClient({
bundlerUrl,
chain,
account: nexusAccount
})
nexusAccountAddress = await nexusAccount.getCounterFactualAddress()

nexusClient = await createNexusClient({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ describe("modules.smartSessions.decorators", async () => {
test("should test use smart session decorators", async () => {
const usePermissionsModule = toSmartSessionsValidator({
account: nexusClient.account,
signer: sessionKeyAccount,
moduleData: {
permissionIds: []
}
signer: sessionKeyAccount
})

const smartSessionNexusClient = await createNexusSessionClient({
Expand Down

0 comments on commit 0c7940d

Please sign in to comment.