Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Jan 5, 2024
1 parent 1e0dcc5 commit ade3271
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: E2e Test workflow
on: [pull_request, workflow_dispatch]

name: E2E Test workflow
on:
pull_request_review:
types: [submitted]
jobs:
e2e_test:
if: github.event.review.state == 'APPROVED'
name: E2E tests
runs-on: ubuntu-latest
strategy:
Expand Down
6 changes: 1 addition & 5 deletions packages/account/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ import { Bundler, createSmartWalletClient } from "@biconomy/account";
const smartWallet = await createSmartWalletClient({
chainId: 1,
signer, // viem's WalletClientSigner
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

// Send some ETH
Expand Down
7 changes: 0 additions & 7 deletions packages/account/src/aliases.ts

This file was deleted.

10 changes: 9 additions & 1 deletion packages/account/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { BiconomySmartAccountV2 } from "./BiconomySmartAccountV2";
import { BiconomySmartAccountV2Config } from "./utils/Types";

export * from "./utils/Types";
export * from "./utils/Constants";
export * from "./BiconomySmartAccountV2";
export * from "./provider";
export * from "./aliases";

export { WalletClientSigner } from "@alchemy/aa-core";
export { BiconomyPaymaster as Paymaster, IPaymaster } from "@biconomy/paymaster";
export { Bundler, IBundler } from "@biconomy/bundler";
export const createSmartWalletClient = BiconomySmartAccountV2.create;
export type SmartWalletConfig = BiconomySmartAccountV2Config;
37 changes: 6 additions & 31 deletions packages/account/tests/account.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PaymasterMode } from "@biconomy/paymaster";
import { TestData } from ".";
import { createSmartWalletClient } from "../src/index";
import { Bundler } from "../src/aliases";
import { Hex, encodeFunctionData } from "viem";
import { UserOperationStruct } from "@alchemy/aa-core";
import { checkBalance } from "./utils";
Expand All @@ -27,11 +26,7 @@ describe("Account Tests", () => {
const smartWallet = await createSmartWalletClient({
chainId,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const balance = (await checkBalance(publicClient, recipient)) as bigint;
Expand Down Expand Up @@ -61,11 +56,7 @@ describe("Account Tests", () => {
chainId,
signer,
biconomyPaymasterApiKey,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const paymaster = smartWallet.paymaster;
Expand All @@ -88,11 +79,7 @@ describe("Account Tests", () => {
chainId,
signer,
biconomyPaymasterApiKey,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const encodedCall = encodeFunctionData({
Expand Down Expand Up @@ -142,11 +129,7 @@ describe("Account Tests", () => {
chainId,
signer,
biconomyPaymasterApiKey,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const userOp: UserOperationStruct = {
Expand Down Expand Up @@ -216,11 +199,7 @@ describe("Account Tests", () => {
chainId,
signer,
biconomyPaymasterApiKey,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const accountAddress = await smartWallet.getAccountAddress();
Expand All @@ -242,11 +221,7 @@ describe("Account Tests", () => {
const smartWallet = await createSmartWalletClient({
chainId,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const module = (await smartWallet.getAllModules())[0];
Expand Down
33 changes: 6 additions & 27 deletions packages/account/tests/account.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createSmartWalletClient } from "../src/index";
import { Bundler, Paymaster } from "../src/aliases";
import { Paymaster, createSmartWalletClient } from "../";
import { TestData } from ".";

describe("Account Tests", () => {
Expand All @@ -22,11 +21,7 @@ describe("Account Tests", () => {
chainId,
entryPointAddress,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});
const address = await smartWallet.getAccountAddress();
expect(address).toBeTruthy();
Expand All @@ -45,11 +40,7 @@ describe("Account Tests", () => {
chainId,
entryPointAddress,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});
const address = await smartWallet.getAccountAddress();
expect(address).toBeTruthy();
Expand All @@ -71,11 +62,7 @@ describe("Account Tests", () => {
chainId,
entryPointAddress,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const module = smartWallet.activeValidationModule;
Expand All @@ -94,11 +81,7 @@ describe("Account Tests", () => {
const smartWallet = await createSmartWalletClient({
chainId,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
});

const builtUserOp = await smartWallet.buildUserOp([{ to: recipient, value: 1000, data: "0x" }]);
Expand All @@ -120,11 +103,7 @@ describe("Account Tests", () => {
const smartWallet = await createSmartWalletClient({
chainId,
signer,
bundler: new Bundler({
bundlerUrl,
chainId,
entryPointAddress,
}),
bundlerUrl,
paymaster,
});
expect(smartWallet.paymaster).not.toBeNull();
Expand Down

0 comments on commit ade3271

Please sign in to comment.