Skip to content

Commit b156cee

Browse files
committed
test: fix test to match new permission builder flow
1 parent a04cdc6 commit b156cee

File tree

2 files changed

+12
-35
lines changed

2 files changed

+12
-35
lines changed

account-kit/smart-contracts/src/ma-v2/actions/deferralActions.test.ts

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import {
33
LocalAccountSigner,
44
type SmartAccountSigner,
55
} from "@aa-sdk/core";
6-
import {
7-
custom,
8-
parseEther,
9-
publicActions,
10-
testActions,
11-
type TestActions,
12-
} from "viem";
6+
import { custom, parseEther } from "viem";
137
import {
148
createModularAccountV2Client,
159
type SignerEntity,
@@ -28,17 +22,6 @@ import { alchemyGasAndPaymasterAndDataMiddleware } from "@account-kit/infra";
2822
describe("MA v2 deferral actions tests", async () => {
2923
const instance = local070Instance;
3024

31-
let client: ReturnType<typeof instance.getClient> &
32-
ReturnType<typeof publicActions> &
33-
TestActions;
34-
35-
beforeAll(async () => {
36-
client = instance
37-
.getClient()
38-
.extend(publicActions)
39-
.extend(testActions({ mode: "anvil" }));
40-
});
41-
4225
const signer: SmartAccountSigner = new LocalAccountSigner(
4326
accounts.fundedAccountOwner
4427
);
@@ -73,25 +56,22 @@ describe("MA v2 deferral actions tests", async () => {
7356
});
7457

7558
const { typedData, fullPreSignatureDeferredActionDigest } =
76-
await new PermissionBuilder(serverClient)
77-
.configure({
78-
key: {
79-
publicKey: await sessionKey.getAddress(),
80-
type: "secp256k1",
81-
},
82-
entityId,
83-
nonce: nonce,
84-
})
59+
await new PermissionBuilder({
60+
client: serverClient,
61+
key: {
62+
publicKey: await sessionKey.getAddress(),
63+
type: "secp256k1",
64+
},
65+
entityId,
66+
nonce: nonce,
67+
deadline: 0,
68+
})
8569
.addPermission({
8670
permission: {
8771
type: PermissionType.ROOT,
8872
},
8973
})
90-
.compileDeferred({
91-
deadline: 0,
92-
uoValidationEntityId: entityId,
93-
uoIsGlobalValidation: true,
94-
});
74+
.compileDeferred();
9575

9676
const sig = await provider.account.signTypedData(typedData);
9777

account-kit/smart-contracts/src/ma-v2/client/client.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,6 @@ describe("MA v2 Tests", async () => {
704704
randomWallet
705705
);
706706

707-
// Test variables
708-
const isGlobalValidation = true;
709-
710707
const { entityId, nonce } = await provider.getEntityIdAndNonce({
711708
isGlobalValidation: true,
712709
});

0 commit comments

Comments
 (0)