From 827be15e54bd91824bd6219a5627a8409074a619 Mon Sep 17 00:00:00 2001 From: Anson Date: Thu, 10 Oct 2024 19:40:55 +0100 Subject: [PATCH 1/2] fix: The capacity credits NFT owner automatically uses the capacity credits to pay for the encryption --- local-tests/tests/testEthAuthSigToEncryptDecryptString.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts b/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts index 8ade5e1586..583b5a4cc6 100644 --- a/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts +++ b/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts @@ -3,6 +3,7 @@ import { ILitNodeClient } from '@lit-protocol/types'; import { AccessControlConditions } from 'local-tests/setup/accs/accs'; import { TinnyEnvironment } from 'local-tests/setup/tinny-environment'; import { log } from '@lit-protocol/misc'; +import { CENTRALISATION_BY_NETWORK } from '@lit-protocol/constants'; /** * Test Commands: @@ -15,6 +16,12 @@ export const testEthAuthSigToEncryptDecryptString = async ( ) => { const alice = await devEnv.createRandomPerson(); + if (CENTRALISATION_BY_NETWORK[devEnv.network] === 'decentralised') { + // The capacity credits NFT owner automatically uses the capacity credits + // to pay for the encryption + await alice.mintCapacityCreditsNFT(); + } + const accs = AccessControlConditions.getEmvBasicAccessControlConditions({ userAddress: alice.authSig.address, }); @@ -27,6 +34,7 @@ export const testEthAuthSigToEncryptDecryptString = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); + log('encryptRes:', encryptRes); // await 5 seconds for the encryption to be mined From a1fc5c384e02e4fe842ff3e5fdcac70e3f8cff5b Mon Sep 17 00:00:00 2001 From: Anson Date: Thu, 10 Oct 2024 19:54:32 +0100 Subject: [PATCH 2/2] fmt --- local-tests/tests/testEthAuthSigToEncryptDecryptString.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts b/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts index 583b5a4cc6..744dc55cdc 100644 --- a/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts +++ b/local-tests/tests/testEthAuthSigToEncryptDecryptString.ts @@ -34,7 +34,6 @@ export const testEthAuthSigToEncryptDecryptString = async ( devEnv.litNodeClient as unknown as ILitNodeClient ); - log('encryptRes:', encryptRes); // await 5 seconds for the encryption to be mined