Skip to content

Commit 2bf0d96

Browse files
committed
https://github.com/LIT-Protocol/js-sdk/pull/881#discussion_r2337344946
1 parent 279a481 commit 2bf0d96

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

e2e/src/e2e.spec.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,32 @@ describe('all', () => {
124124

125125
describe('endpoints', () => {
126126
it('pkpSign', () =>
127-
createPkpSignTest(ctx, () => eveCustomAuthContext, ctx.eveViemAccountPkp.pubkey)());
127+
createPkpSignTest(
128+
ctx,
129+
() => eveCustomAuthContext,
130+
ctx.eveViemAccountPkp.pubkey
131+
)());
128132
it('executeJs', () =>
129-
createExecuteJsTest(ctx, () => eveCustomAuthContext, ctx.eveViemAccountPkp.pubkey)());
130-
it('viewPKPsByAddress', () =>
131-
createViewPKPsByAddressTest(ctx, () => eveCustomAuthContext, ctx.eveViemAccountPkp.pubkey)());
133+
createExecuteJsTest(
134+
ctx,
135+
() => eveCustomAuthContext,
136+
ctx.eveViemAccountPkp.pubkey
137+
)());
138+
it('viewPKPsByAddress', () => createViewPKPsByAddressTest(ctx)());
132139
it('viewPKPsByAuthData', () =>
133-
createViewPKPsByAuthDataTest(ctx, () => eveCustomAuthContext, ctx.eveCustomAuthData)());
140+
createViewPKPsByAuthDataTest(ctx, ctx.eveCustomAuthData)());
134141
it('pkpEncryptDecrypt', () =>
135-
createPkpEncryptDecryptTest(ctx, () => eveCustomAuthContext, ctx.eveViemAccountPkp.ethAddress)());
142+
createPkpEncryptDecryptTest(
143+
ctx,
144+
() => eveCustomAuthContext,
145+
ctx.eveViemAccountPkp.ethAddress
146+
)());
136147
it('encryptDecryptFlow', () =>
137-
createEncryptDecryptFlowTest(ctx, () => eveCustomAuthContext, ctx.eveViemAccountPkp.pubkey)());
148+
createEncryptDecryptFlowTest(
149+
ctx,
150+
() => eveCustomAuthContext,
151+
ctx.eveViemAccountPkp.pubkey
152+
)());
138153

139154
// Disable for now because it requires a different flow
140155
// it('pkpPermissionsManagerFlow', () =>

e2e/src/helper/tests/view-pkps-by-address.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { init } from '../../init';
22
import { assert } from '../assertions';
33

44
export const createViewPKPsByAddressTest = (
5-
ctx: Awaited<ReturnType<typeof init>>,
6-
getAuthContext: () => any,
7-
pubkey?: string
5+
ctx: Awaited<ReturnType<typeof init>>
86
) => {
97
return async () => {
108
const pkps = await ctx.litClient.viewPKPsByAddress({

e2e/src/helper/tests/view-pkps-by-auth-data.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import { assert } from '../assertions';
33

44
export const createViewPKPsByAuthDataTest = (
55
ctx: Awaited<ReturnType<typeof init>>,
6-
getAuthContext: () => any,
7-
authData?: any,
6+
authData?: any
87
) => {
98
return async () => {
109
const { ViemAccountAuthenticator } = await import('@lit-protocol/auth');
11-
const _authData = authData || await ViemAccountAuthenticator.authenticate(
12-
ctx.aliceViemAccount
13-
);
10+
const _authData =
11+
authData ||
12+
(await ViemAccountAuthenticator.authenticate(ctx.aliceViemAccount));
1413

1514
const pkps = await ctx.litClient.viewPKPsByAuthData({
1615
authData: {

0 commit comments

Comments
 (0)