Skip to content

Commit d046b5e

Browse files
committed
refac: Prettier
1 parent 8bbd2be commit d046b5e

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

local-tests/tests/testCustomGenerateWrappedKey.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { log } from '@lit-protocol/misc';
22
import { TinnyEnvironment } from 'local-tests/setup/tinny-environment';
3-
import {
4-
customGeneratePrivateKey,
5-
} from '@lit-protocol/wrapped-keys';
3+
import { customGeneratePrivateKey } from '@lit-protocol/wrapped-keys';
64
import { getPkpSessionSigs } from 'local-tests/setup/session-sigs/get-pkp-session-sigs';
75
import { LIT_ACTION_CID_REPOSITORY } from 'packages/wrapped-keys/src/lib/constants';
86

@@ -34,7 +32,7 @@ const CUSTOM_LIT_ACTION_CODE = `
3432
response: resp,
3533
});
3634
})();
37-
`
35+
`;
3836

3937
/**
4038
* Test Commands:
@@ -57,11 +55,14 @@ export const testCustomGenerateWrappedKey = async (
5755

5856
const ipfsCustomPrivateKeys = await customGeneratePrivateKey({
5957
pkpSessionSigs: alicePkpSessionSigs,
60-
litActionIpfsCid: LIT_ACTION_CID_REPOSITORY.generateEncryptedSolanaPrivateKey,
58+
litActionIpfsCid:
59+
LIT_ACTION_CID_REPOSITORY.generateEncryptedSolanaPrivateKey,
6160
litNodeClient: devEnv.litNodeClient,
6261
});
6362

64-
console.log(`IPFS CID generatedPublicKey: ${ipfsCustomPrivateKeys.generatedPublicKey}`);
63+
console.log(
64+
`IPFS CID generatedPublicKey: ${ipfsCustomPrivateKeys.generatedPublicKey}`
65+
);
6566

6667
const alicePkpAddress = alice.authMethodOwnedPkp.ethAddress;
6768
if (ipfsCustomPrivateKeys.pkpAddress !== alicePkpAddress) {
@@ -86,7 +87,9 @@ export const testCustomGenerateWrappedKey = async (
8687
litNodeClient: devEnv.litNodeClient,
8788
});
8889

89-
console.log(`Code generatedPublicKey: ${codeCustomPrivateKeys.generatedPublicKey}`);
90+
console.log(
91+
`Code generatedPublicKey: ${codeCustomPrivateKeys.generatedPublicKey}`
92+
);
9093

9194
const bobPkpAddress = bob.authMethodOwnedPkp.ethAddress;
9295
if (codeCustomPrivateKeys.pkpAddress !== bobPkpAddress) {

local-tests/tests/testCustomSignMessageWrappedKey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { log } from '@lit-protocol/misc';
22
import { ethers } from 'ethers';
33
import { TinnyEnvironment } from 'local-tests/setup/tinny-environment';
44
import {
5-
customSignMessageWithEncryptedKey,
5+
customSignMessageWithEncryptedKey,
66
importPrivateKey,
77
} from '@lit-protocol/wrapped-keys';
88
import { getPkpSessionSigs } from 'local-tests/setup/session-sigs/get-pkp-session-sigs';

local-tests/tests/testFailCustomGenerateKeyWithBothIpfsAndCode.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { log } from '@lit-protocol/misc';
22
import { TinnyEnvironment } from 'local-tests/setup/tinny-environment';
3-
import {
4-
customGeneratePrivateKey,
5-
} from '@lit-protocol/wrapped-keys';
3+
import { customGeneratePrivateKey } from '@lit-protocol/wrapped-keys';
64
import { getPkpSessionSigs } from 'local-tests/setup/session-sigs/get-pkp-session-sigs';
75
import { LIT_ACTION_CID_REPOSITORY } from 'packages/wrapped-keys/src/lib/constants';
86

@@ -34,7 +32,7 @@ const CUSTOM_LIT_ACTION_CODE = `
3432
response: resp,
3533
});
3634
})();
37-
`
35+
`;
3836

3937
/**
4038
* Test Commands:
@@ -54,18 +52,20 @@ export const testFailCustomGenerateKeyWithBothIpfsAndCode = async (
5452
new Date(Date.now() + 1000 * 60 * 10).toISOString()
5553
); // 10 mins expiry
5654

57-
5855
try {
5956
await customGeneratePrivateKey({
60-
pkpSessionSigs: alicePkpSessionSigs,
61-
litActionIpfsCid: LIT_ACTION_CID_REPOSITORY.generateEncryptedSolanaPrivateKey,
62-
litActionCode: CUSTOM_LIT_ACTION_CODE,
63-
litNodeClient: devEnv.litNodeClient,
57+
pkpSessionSigs: alicePkpSessionSigs,
58+
litActionIpfsCid:
59+
LIT_ACTION_CID_REPOSITORY.generateEncryptedSolanaPrivateKey,
60+
litActionCode: CUSTOM_LIT_ACTION_CODE,
61+
litNodeClient: devEnv.litNodeClient,
6462
});
6563
} catch (e: any) {
6664
console.log('❌ THIS IS EXPECTED: ', e);
6765

68-
if (e.message === "Can't provide both the litActionIpfsCid or litActionCode") {
66+
if (
67+
e.message === "Can't provide both the litActionIpfsCid or litActionCode"
68+
) {
6969
console.log(
7070
'✅ testFailImportWrappedKeysWithSamePrivateKey is expected to have an error'
7171
);

packages/wrapped-keys/src/lib/wrapped-keys.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ export async function customGeneratePrivateKey({
109109
litNodeClient,
110110
}: CustomGeneratePrivateKeyParams): Promise<GeneratePrivateKeyResponse> {
111111
if (!litActionIpfsCid && !litActionCode) {
112-
throw new Error("Have to provide either the litActionIpfsCid or litActionCode");
112+
throw new Error(
113+
'Have to provide either the litActionIpfsCid or litActionCode'
114+
);
113115
}
114116

115117
if (litActionIpfsCid && litActionCode) {
@@ -337,7 +339,9 @@ export async function customSignTransactionWithEncryptedKey({
337339
litNodeClient,
338340
}: CustomSignTransactionWithEncryptedKeyParams): Promise<string> {
339341
if (!litActionIpfsCid && !litActionCode) {
340-
throw new Error("Have to provide either the litActionIpfsCid or litActionCode");
342+
throw new Error(
343+
'Have to provide either the litActionIpfsCid or litActionCode'
344+
);
341345
}
342346

343347
if (litActionIpfsCid && litActionCode) {
@@ -444,7 +448,9 @@ export async function customSignMessageWithEncryptedKey({
444448
litNodeClient,
445449
}: CustomSignMessageWithEncryptedKeyParams): Promise<string> {
446450
if (!litActionIpfsCid && !litActionCode) {
447-
throw new Error("Have to provide either the litActionIpfsCid or litActionCode");
451+
throw new Error(
452+
'Have to provide either the litActionIpfsCid or litActionCode'
453+
);
448454
}
449455

450456
if (litActionIpfsCid && litActionCode) {

0 commit comments

Comments
 (0)