diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5e1c234c1..9d05d8cee2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 env: - NETWORK: cayenne + NETWORK: datil-dev DEBUG: true MAX_ATTEMPTS: 3 steps: diff --git a/local-tests/setup/tinny-environment.ts b/local-tests/setup/tinny-environment.ts index d210c2f0d7..12fe123137 100644 --- a/local-tests/setup/tinny-environment.ts +++ b/local-tests/setup/tinny-environment.ts @@ -174,16 +174,6 @@ export class TinnyEnvironment { this.processEnvs.KEY_IN_USE[index] = true; // Mark the key as in use // console.log('[𐬺🧪 Tinny Environment𐬺] 🔑 Selected key at index', index); // Log a message indicating that we have selected a key - // Set a timer to automatically release the key after 10 seconds - setTimeout(() => { - this.releasePrivateKey(index); - // console.log( - // '[𐬺🧪 Tinny Environment𐬺] 🔓 Automatically released key at index', - // index, - // `after ${this.processEnvs.TIME_TO_RELEASE_KEY / 10000} seconds` - // ); - }, this.processEnvs.TIME_TO_RELEASE_KEY); - return { privateKey: this.processEnvs.PRIVATE_KEYS[index], index }; // Return the key and its index } else { // console.log('[𐬺🧪 Tinny Environment𐬺] No available keys. Waiting...'); // Log a message indicating that we are waiting @@ -195,6 +185,18 @@ export class TinnyEnvironment { } } + /** + * Marks a private key as available again after use. + * @param {number} index - The index of the key to mark as available. + */ + releasePrivateKeyFromUser(user: TinnyPerson) { + const index = this.processEnvs.PRIVATE_KEYS.indexOf(user.privateKey); + this.processEnvs.KEY_IN_USE[index] = false; + // console.log( + // `[𐬺🧪 Tinny Environment𐬺] 🪽 Released key at index ${index}. Thank you for your service!` + // ); + } + /** * Marks a private key as available again after use. * @param {number} index - The index of the key to mark as available. diff --git a/local-tests/tests/test-example.ts b/local-tests/tests/test-example.ts index 28665e3a41..9deedaebac 100644 --- a/local-tests/tests/test-example.ts +++ b/local-tests/tests/test-example.ts @@ -30,6 +30,8 @@ export const testExample = async (devEnv: TinnyEnvironment) => { console.log('aliceExecuteJsRes:', aliceExecuteJsRes); + devEnv.releasePrivateKeyFromUser(alice); + // console.log('aliceEoaSessionSigs: ', aliceEoaSessionSigs); // const alicePkpSessionSigs = await getPkpSessionSigs(devEnv, alice); diff --git a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs.ts b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs.ts index d1fe134e45..2fca0422e5 100644 --- a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs.ts +++ b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs.ts @@ -85,6 +85,9 @@ export const testDelegatingCapacityCreditsNFTToAnotherPkpToExecuteJs = async ( console.log('✅ res:', res); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // -- Expected output: // { // claims: {}, diff --git a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs.ts b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs.ts index 46ba42a016..ea397ebd8e 100644 --- a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs.ts +++ b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs.ts @@ -64,6 +64,9 @@ export const testDelegatingCapacityCreditsNFTToAnotherWalletToExecuteJs = }, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // Expected output: // { // claims: {}, diff --git a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign.ts b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign.ts index ac5f308db0..1d625ad771 100644 --- a/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign.ts +++ b/local-tests/tests/testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign.ts @@ -56,6 +56,9 @@ export const testDelegatingCapacityCreditsNFTToAnotherWalletToPkpSign = async ( pubKey: bob.pkp.publicKey, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // -- Expected output: // { // r: "25e04b2abdf220b1374b19228bc292bab71a3224a635726a46d4cbe3a62bb636", diff --git a/local-tests/tests/testExecuteJsBroadcastAndCollect.ts b/local-tests/tests/testExecuteJsBroadcastAndCollect.ts index b44b6ba0dc..3b056db7f5 100644 --- a/local-tests/tests/testExecuteJsBroadcastAndCollect.ts +++ b/local-tests/tests/testExecuteJsBroadcastAndCollect.ts @@ -38,6 +38,7 @@ export const testExecuteJsBroadcastAndCollect = async ( })();`, jsParams: {}, }); + devEnv.releasePrivateKeyFromUser(alice); const response = res.response; if (!response) { diff --git a/local-tests/tests/testExecuteJsDecryptAndCombine.ts b/local-tests/tests/testExecuteJsDecryptAndCombine.ts index 64962cb347..3b24cd4416 100644 --- a/local-tests/tests/testExecuteJsDecryptAndCombine.ts +++ b/local-tests/tests/testExecuteJsDecryptAndCombine.ts @@ -78,6 +78,8 @@ export const testExecutJsDecryptAndCombine = async ( }, }); + devEnv.releasePrivateKeyFromUser(alice); + if (res.response !== 'Hello world') { throw new Error('content does not match what was expected'); } diff --git a/local-tests/tests/testExecuteJsSignAndCombineEcdsa.ts b/local-tests/tests/testExecuteJsSignAndCombineEcdsa.ts index f2bed59baa..d2c808e776 100644 --- a/local-tests/tests/testExecuteJsSignAndCombineEcdsa.ts +++ b/local-tests/tests/testExecuteJsSignAndCombineEcdsa.ts @@ -72,6 +72,9 @@ export const testExecuteJsSignAndCombineEcdsa = async ( }, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + /** Response format { diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSign.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSign.ts index bf3151a105..ff681d6c07 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSign.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSign.ts @@ -56,5 +56,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSign = async ( console.log('✅ recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTransaction.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTransaction.ts index 8ad1ebf554..accf022ad0 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTransaction.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTransaction.ts @@ -103,5 +103,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTransaction = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedData.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedData.ts index 1e7b502dd8..c1d7c29a4b 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedData.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedData.ts @@ -91,5 +91,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTypedData = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil.ts index 60af8f09aa..41b0d7f2e4 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil.ts @@ -88,5 +88,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTypedDataUtil = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1.ts index 6227559d7a..a63712d77a 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1.ts @@ -73,5 +73,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTypedDataV1 = async ( console.log('recoveredAddr: ', recoveredAddr); } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3.ts index d0c7f64a21..96c1727b14 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3.ts @@ -101,5 +101,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTypedDataV3 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4.ts index adaa3d34f7..1f2c6ff0a7 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4.ts @@ -101,5 +101,7 @@ export const testPkpEthersWithEoaSessionSigsToEthSignTypedDataV4 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToPersonalSign.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToPersonalSign.ts index 74c963d307..b4cb9f79df 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToPersonalSign.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToPersonalSign.ts @@ -57,5 +57,7 @@ export const testPkpEthersWithEoaSessionSigsToPersonalSign = async ( console.log('✅ personal_sign recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSendTx.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSendTx.ts index 8a347da507..4edb56141e 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSendTx.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSendTx.ts @@ -58,5 +58,7 @@ export const testPkpEthersWithEoaSessionSigsToSendTx = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts index 42591b54c4..d3e5e4cb98 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignMessage.ts @@ -29,5 +29,7 @@ export const testPkpEthersWithEoaSessionSigsToSignMessage = async ( console.log('✅ signature:', signature); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts index 365b52d2ae..456aa2692c 100644 --- a/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts +++ b/local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts @@ -66,5 +66,7 @@ export const testPkpEthersWithEoaSessionSigsToSignWithAuthContext = async ( console.log('✅ signature:', signature); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSign.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSign.ts index 897ea8b1a1..28439833ab 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSign.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSign.ts @@ -56,5 +56,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSign = async ( console.log('✅ recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTransaction.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTransaction.ts index cbfb204787..8542bcc55c 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTransaction.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTransaction.ts @@ -103,5 +103,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTransaction = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedData.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedData.ts index 60fc57cb03..2ddf80f082 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedData.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedData.ts @@ -91,5 +91,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTypedData = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil.ts index d3dd79393f..f6102c40ae 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil.ts @@ -83,5 +83,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTypedDataUtil = } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1.ts index d126811422..0c96a2689c 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1.ts @@ -73,5 +73,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV1 = async ( console.log('recoveredAddr: ', recoveredAddr); } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3.ts index fd4e4268ab..a12d0efc05 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3.ts @@ -100,5 +100,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV3 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4.ts index 034260228b..5159129a8e 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4.ts @@ -101,5 +101,7 @@ export const testPkpEthersWithLitActionSessionSigsToEthSignTypedDataV4 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToPersonalSign.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToPersonalSign.ts index ecfca49e60..b303cf69f3 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToPersonalSign.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToPersonalSign.ts @@ -57,5 +57,7 @@ export const testPkpEthersWithLitActionSessionSigsToPersonalSign = async ( console.log('✅ personal_sign recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSendTx.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSendTx.ts index f4bcf05340..4d81570e7b 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSendTx.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSendTx.ts @@ -58,5 +58,7 @@ export const testPkpEthersWithLitActionSessionSigsToSendTx = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSignMessage.ts b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSignMessage.ts index 76bceaf03b..cb7a2f35ac 100644 --- a/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSignMessage.ts +++ b/local-tests/tests/testPkpEthersWithLitActionSessionSigsToSignMessage.ts @@ -28,5 +28,7 @@ export const testPkpEthersWithLitActionSessionSigsToSignMessage = async ( console.log('✅ signature:', signature); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSign.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSign.ts index 6bf9cd0bb7..3a63f307ae 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSign.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSign.ts @@ -56,5 +56,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSign = async ( console.log('✅ recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTransaction.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTransaction.ts index ae33298efd..794989c722 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTransaction.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTransaction.ts @@ -103,5 +103,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTransaction = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedData.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedData.ts index 91f267fe9e..31d20c98be 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedData.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedData.ts @@ -91,5 +91,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTypedData = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil.ts index a9ec574c2a..1ec0ba2010 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil.ts @@ -84,5 +84,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTypedDataUtil = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1.ts index b13f716f9e..ccaeb7cb48 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1.ts @@ -73,5 +73,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTypedDataV1 = async ( console.log('recoveredAddr: ', recoveredAddr); } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3.ts index b5e2c55ca5..bfae5a64ab 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3.ts @@ -100,5 +100,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTypedDataV3 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4.ts index a5de892413..a4712ed587 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4.ts @@ -101,5 +101,7 @@ export const testPkpEthersWithPkpSessionSigsToEthSignTypedDataV4 = async ( } } catch (e) { throw new Error(`❌ ${e.toString()}`); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToPersonalSign.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToPersonalSign.ts index 944119c32a..49a14f561a 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToPersonalSign.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToPersonalSign.ts @@ -57,5 +57,7 @@ export const testPkpEthersWithPkpSessionSigsToPersonalSign = async ( console.log('✅ personal_sign recoveredAddr:', recoveredAddr); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToSendTx.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToSendTx.ts index 783d5f8a9b..f8807ba32f 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToSendTx.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToSendTx.ts @@ -58,5 +58,7 @@ export const testPkpEthersWithPkpSessionSigsToSendTx = async ( } else { throw new Error(`❌ Error: ${e.toString()}`); } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testPkpEthersWithPkpSessionSigsToSignMessage.ts b/local-tests/tests/testPkpEthersWithPkpSessionSigsToSignMessage.ts index 568f144bc9..3ad2a2a3d4 100644 --- a/local-tests/tests/testPkpEthersWithPkpSessionSigsToSignMessage.ts +++ b/local-tests/tests/testPkpEthersWithPkpSessionSigsToSignMessage.ts @@ -28,5 +28,7 @@ export const testPkpEthersWithPkpSessionSigsToSignMessage = async ( console.log('✅ signature:', signature); } catch (e) { throw new Error('❌ Error: ' + e.message); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExecuteJs.ts b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExecuteJs.ts index 1d85764098..c6cf228505 100644 --- a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExecuteJs.ts +++ b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExecuteJs.ts @@ -68,6 +68,9 @@ export const testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToExe }, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // Expected output: // { // claims: {}, diff --git a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkpSign.ts b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkpSign.ts index fd7b22c0f7..342c4419f3 100644 --- a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkpSign.ts +++ b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkpSign.ts @@ -58,6 +58,9 @@ export const testUseCapacityDelegationAuthSigWithUnspecifiedCapacityTokenIdToPkp pubKey: bob.pkp.publicKey, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // -- Expected output: // { // r: "25e04b2abdf220b1374b19228bc292bab71a3224a635726a46d4cbe3a62bb636", diff --git a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJs.ts b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJs.ts index d552915556..0ffb15dacc 100644 --- a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJs.ts +++ b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJs.ts @@ -66,6 +66,9 @@ export const testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToExecuteJ }, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // Expected output: // { // claims: {}, diff --git a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign.ts b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign.ts index 11f0c05550..6cdd9d2779 100644 --- a/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign.ts +++ b/local-tests/tests/testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign.ts @@ -56,6 +56,9 @@ export const testUseCapacityDelegationAuthSigWithUnspecifiedDelegateesToPkpSign sessionSigs: bobsSessionSigs, }); + devEnv.releasePrivateKeyFromUser(alice); + devEnv.releasePrivateKeyFromUser(bob); + // -- Expected output: // { // r: "36bd0039b4e4d1dae488a63437318790df86b8023ac4ffa842c8983245b7f629", diff --git a/local-tests/tests/testUseCustomAuthSessionSigsToPkpSignExecuteJs.ts b/local-tests/tests/testUseCustomAuthSessionSigsToPkpSignExecuteJs.ts index 20bdb2723d..24410d0a2b 100644 --- a/local-tests/tests/testUseCustomAuthSessionSigsToPkpSignExecuteJs.ts +++ b/local-tests/tests/testUseCustomAuthSessionSigsToPkpSignExecuteJs.ts @@ -112,6 +112,8 @@ export const testUseCustomAuthSessionSigsToPkpSignExecuteJs = async ( console.log('✅ pkpSign res:', res); } catch (e) { throw new Error(e); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } // -- execute js @@ -133,5 +135,7 @@ export const testUseCustomAuthSessionSigsToPkpSignExecuteJs = async ( console.log('✅ executeJs res:', res); } catch (e) { throw new Error(e); + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptFile.ts b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptFile.ts index c51c09de5d..302b2a0a38 100644 --- a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptFile.ts +++ b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptFile.ts @@ -77,6 +77,8 @@ export const testUseEoaSessionSigsToEncryptDecryptFile = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { throw new Error( `decrypted file should match the original file but received ${decriptedFile}` diff --git a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts index 53fa1a4244..6a951cfc88 100644 --- a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts +++ b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptString.ts @@ -73,6 +73,8 @@ export const testUseEoaSessionSigsToEncryptDecryptString = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { throw new Error( `Expected decryptRes to be 'Hello world' but got ${decryptRes}` diff --git a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptZip.ts b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptZip.ts index 208ee74751..f64eab4a5c 100644 --- a/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptZip.ts +++ b/local-tests/tests/testUseEoaSessionSigsToEncryptDecryptZip.ts @@ -73,6 +73,8 @@ export const testUseEoaSessionSigsToEncryptDecryptZip = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + const decryptedMessage = await decryptedZip['string.txt'].async('string'); if (message !== decryptedMessage) { diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimKeys.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimKeys.ts index 53d2c4ae37..038b232e32 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimKeys.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimKeys.ts @@ -41,6 +41,8 @@ export const testUseEoaSessionSigsToExecuteJsClaimKeys = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); // Expected output: diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimMultipleKeys.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimMultipleKeys.ts index eb10ff3d13..c18f740365 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimMultipleKeys.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsClaimMultipleKeys.ts @@ -32,6 +32,8 @@ export const testUseEoaSessionSigsToExecuteJsClaimMultipleKeys = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // claims: { diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsConsoleLog.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsConsoleLog.ts index b09b213bbd..f6b90ae481 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsConsoleLog.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsConsoleLog.ts @@ -23,6 +23,8 @@ export const testUseEoaSessionSigsToExecuteJsConsoleLog = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); // Expected output: diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsJsonResponse.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsJsonResponse.ts index 42ac64beeb..4e219a264f 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsJsonResponse.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsJsonResponse.ts @@ -28,6 +28,8 @@ export const testUseEoaSessionSigsToExecuteJsJsonResponse = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // success: true, diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts index 49275a856e..c381ded7a8 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigning.ts @@ -32,6 +32,8 @@ export const testUseEoaSessionSigsToExecuteJsSigning = async ( }, }); + devEnv.releasePrivateKeyFromUser(alice); + // -- Expected output: // { // claims: {}, diff --git a/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigningInParallel.ts b/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigningInParallel.ts index e5c38682b6..0b20018d88 100644 --- a/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigningInParallel.ts +++ b/local-tests/tests/testUseEoaSessionSigsToExecuteJsSigningInParallel.ts @@ -37,6 +37,7 @@ export const testUseEoaSessionSigsToExecuteJsSigningInParallel = async ( }; const res = await Promise.all([fn(1), fn(2), fn(3)]); + devEnv.releasePrivateKeyFromUser(alice); log('res:', res); // -- Expected output: diff --git a/local-tests/tests/testUseEoaSessionSigsToPkpSign.ts b/local-tests/tests/testUseEoaSessionSigsToPkpSign.ts index ae5d396788..d50d5b5513 100644 --- a/local-tests/tests/testUseEoaSessionSigsToPkpSign.ts +++ b/local-tests/tests/testUseEoaSessionSigsToPkpSign.ts @@ -23,6 +23,8 @@ export const testUseEoaSessionSigsToPkpSign = async ( sessionSigs: eoaSessionSigs, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // r: "25fc0d2fecde8ed801e9fee5ad26f2cf61d82e6f45c8ad1ad1e4798d3b747fd9", diff --git a/local-tests/tests/testUseInvalidLitActionCodeToGenerateSessionSigs.ts b/local-tests/tests/testUseInvalidLitActionCodeToGenerateSessionSigs.ts index 33a73b5f26..69d6cd36ad 100644 --- a/local-tests/tests/testUseInvalidLitActionCodeToGenerateSessionSigs.ts +++ b/local-tests/tests/testUseInvalidLitActionCodeToGenerateSessionSigs.ts @@ -28,5 +28,7 @@ export const testUseInvalidLitActionCodeToGenerateSessionSigs = async ( } else { throw e; } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testUseInvalidLitActionIpfsCodeToGenerateSessionSigs.ts b/local-tests/tests/testUseInvalidLitActionIpfsCodeToGenerateSessionSigs.ts index 4243a1cf90..871009d8e5 100644 --- a/local-tests/tests/testUseInvalidLitActionIpfsCodeToGenerateSessionSigs.ts +++ b/local-tests/tests/testUseInvalidLitActionIpfsCodeToGenerateSessionSigs.ts @@ -26,5 +26,7 @@ export const testUseInvalidLitActionIpfsCodeToGenerateSessionSigs = async ( } else { throw e; } + } finally { + devEnv.releasePrivateKeyFromUser(alice); } }; diff --git a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptFile.ts b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptFile.ts index 75db87c7bf..4b4026eb28 100644 --- a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptFile.ts +++ b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptFile.ts @@ -78,6 +78,8 @@ export const testUsePkpSessionSigsToEncryptDecryptFile = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { throw new Error( `decrypted file should match the original file but received ${decriptedFile}` diff --git a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptString.ts b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptString.ts index 01d4994875..f5918b1e73 100644 --- a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptString.ts +++ b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptString.ts @@ -71,6 +71,8 @@ export const testUsePkpSessionSigsToEncryptDecryptString = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { throw new Error( `Expected decryptRes to be 'Hello world' but got ${decryptRes}` diff --git a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptZip.ts b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptZip.ts index 0e926bebcd..abdc59ef4e 100644 --- a/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptZip.ts +++ b/local-tests/tests/testUsePkpSessionSigsToEncryptDecryptZip.ts @@ -76,6 +76,8 @@ export const testUsePkpSessionSigsToEncryptDecryptZip = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + const decryptedMessage = await decryptedZip['string.txt'].async('string'); if (message !== decryptedMessage) { diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimKeys.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimKeys.ts index 61648d5598..3dee2d97d3 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimKeys.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimKeys.ts @@ -33,6 +33,8 @@ export const testUsePkpSessionSigsToExecuteJsClaimKeys = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); // Expected output: diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimMultipleKeys.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimMultipleKeys.ts index d218252fd8..6b960c9958 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimMultipleKeys.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsClaimMultipleKeys.ts @@ -32,6 +32,8 @@ export const testUsePkpSessionSigsToExecuteJsClaimMultipleKeys = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // claims: { diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsConsoleLog.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsConsoleLog.ts index 211af2f0d6..dab300578d 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsConsoleLog.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsConsoleLog.ts @@ -23,6 +23,8 @@ export const testUsePkpSessionSigsToExecuteJsConsoleLog = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // success: true, diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsJsonResponse.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsJsonResponse.ts index 12a79fa9f7..cc4e016d69 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsJsonResponse.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsJsonResponse.ts @@ -28,6 +28,8 @@ export const testUsePkpSessionSigsToExecuteJsJsonResponse = async ( })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // success: true, diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts index 0ddfdb2bb4..0864680c36 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigning.ts @@ -32,6 +32,8 @@ export const testUsePkpSessionSigsToExecuteJsSigning = async ( }, }); + devEnv.releasePrivateKeyFromUser(alice); + // -- Expected output: // { // claims: {}, diff --git a/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigningInParallel.ts b/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigningInParallel.ts index 796eef4732..7469896024 100644 --- a/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigningInParallel.ts +++ b/local-tests/tests/testUsePkpSessionSigsToExecuteJsSigningInParallel.ts @@ -36,6 +36,8 @@ export const testUsePkpSessionSigsToExecuteJsSigningInParallel = async ( }); }; + devEnv.releasePrivateKeyFromUser(alice); + const res = await Promise.all([fn(1), fn(2), fn(3)]); log('res:', res); diff --git a/local-tests/tests/testUsePkpSessionSigsToPkpSign.ts b/local-tests/tests/testUsePkpSessionSigsToPkpSign.ts index e08e60a23c..658b676a73 100644 --- a/local-tests/tests/testUsePkpSessionSigsToPkpSign.ts +++ b/local-tests/tests/testUsePkpSessionSigsToPkpSign.ts @@ -23,6 +23,8 @@ export const testUsePkpSessionSigsToPkpSign = async ( sessionSigs: pkpSessionSigs, }); + devEnv.releasePrivateKeyFromUser(alice); + // -- Expected output: // { // r: "f67785b9c516a1fdbd224e9591554171d594bb1fb9799c851bac56212956838a", diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile.ts index b9139a3566..9481fa4a65 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile.ts @@ -81,6 +81,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptFile = devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (blobArray.length !== decriptedFile.length) { throw new Error( `decrypted file should match the original file but received ${decriptedFile}` diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString.ts index 9b72ad5a21..c62bb9f4e9 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString.ts @@ -77,6 +77,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptString devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + if (decryptRes !== 'Hello world') { throw new Error( `Expected decryptRes to be 'Hello world' but got ${decryptRes}` diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip.ts index 84a3dcfdf7..1ef9ff9e5e 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip.ts @@ -78,6 +78,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToEncryptDecryptZip = devEnv.litNodeClient as unknown as ILitNodeClient ); + devEnv.releasePrivateKeyFromUser(alice); + const decryptedMessage = await decryptedZip['string.txt'].async('string'); if (message !== decryptedMessage) { diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys.ts index 521a65f19f..9d6fd6e946 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys.ts @@ -44,6 +44,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimKeys = })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // claims: { diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys.ts index 53f9286cfb..2cd2919b8d 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultipleKeys.ts @@ -34,6 +34,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsClaimMultip })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // claims: { diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog.ts index 05156a4072..53ffe99766 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog.ts @@ -36,6 +36,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsConsoleLog })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + console.log('res:', res); // Expected output: diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse.ts index c08b2f0e27..007c9e448c 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonResponse.ts @@ -29,6 +29,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsJsonRespons })();`, }); + devEnv.releasePrivateKeyFromUser(alice); + // Expected output: // { // success: true, diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning.ts index 200c4b7dca..92b90b2556 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning.ts @@ -45,6 +45,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigning = }, }); + devEnv.releasePrivateKeyFromUser(alice); + // -- Expected output: // { // claims: {}, diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel.ts index f79de4e9d3..e57cc6f451 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInParallel.ts @@ -38,6 +38,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToExecuteJsSigningInPa }); }; + devEnv.releasePrivateKeyFromUser(alice); + const res = await Promise.all([fn(1), fn(2), fn(3)]); log('res:', res); diff --git a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts index fdfb2ad118..b72471a035 100644 --- a/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts +++ b/local-tests/tests/testUseValidLitActionCodeGeneratedSessionSigsToPkpSign.ts @@ -28,6 +28,8 @@ export const testUseValidLitActionCodeGeneratedSessionSigsToPkpSign = async ( sessionSigs: litActionSessionSigs, }); + devEnv.releasePrivateKeyFromUser(alice); + // -- Expected output: // { // r: "ab2cef959db920d56f001c3b05637ee49af4c4441f2867ea067c413594a4c87b", diff --git a/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning.ts b/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning.ts index ef8516f5ad..535521bd87 100644 --- a/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning.ts +++ b/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning.ts @@ -42,6 +42,7 @@ export const testUseValidLitActionIpfsCodeGeneratedSessionSigsToExecuteJsSigning publicKey: alice.authMethodOwnedPkp.publicKey, }, }); + devEnv.releasePrivateKeyFromUser(alice); console.log('✅ res:', res); // -- Expected output: diff --git a/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign.ts b/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign.ts index 1ed4405d4f..9d11289b7b 100644 --- a/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign.ts +++ b/local-tests/tests/testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign.ts @@ -29,7 +29,7 @@ export const testUseValidLitActionIpfsCodeGeneratedSessionSigsToPkpSign = pubKey: alice.authMethodOwnedPkp.publicKey, sessionSigs: litActionSessionSigs, }); - + devEnv.releasePrivateKeyFromUser(alice); console.log('✅ res:', res); // -- Expected output: