diff --git a/nx.json b/nx.json index 8924e3f60a..1e929a819b 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["^build", "test"] + "cacheableOperations": ["build", "clean", "test"] } } }, @@ -12,7 +12,10 @@ "dependsOn": ["^build"] }, "test": { - "dependsOn": ["build"] + "dependsOn": ["clean", "build"] + }, + "clean": { + "dependsOn": ["^clean"] } } } diff --git a/packages/epk-cipher/src/ethereum-private-key-cipher-provider.ts b/packages/epk-cipher/src/ethereum-private-key-cipher-provider.ts index 3f4b45de0c..1b0440bd47 100644 --- a/packages/epk-cipher/src/ethereum-private-key-cipher-provider.ts +++ b/packages/epk-cipher/src/ethereum-private-key-cipher-provider.ts @@ -20,7 +20,7 @@ export default class EthereumPrivateKeyCipherProvider /** Dictionary containing all the private keys indexed by address */ private decryptionParametersDictionary: IDecryptionParametersDictionary; - private isDecryptionOn = false; + private decryptionEnabled = true; constructor(decryptionParameters?: EncryptionTypes.IDecryptionParameters) { this.decryptionParametersDictionary = new Map(); @@ -44,7 +44,7 @@ export default class EthereumPrivateKeyCipherProvider * @returns true if decryption is available */ public isDecryptionAvailable(): boolean { - return this.decryptionParametersDictionary.size > 0 && this.isDecryptionOn; + return this.decryptionParametersDictionary.size > 0 && this.decryptionEnabled; } /** @@ -53,8 +53,17 @@ export default class EthereumPrivateKeyCipherProvider * @param option */ public enableDecryption(option: boolean): void { - this.isDecryptionOn = option; + this.decryptionEnabled = option; } + + /** + * Checks if decryption is enabled. + * @returns A boolean indicating if decryption is enabled. + */ + public isDecryptionEnabled(): boolean { + return this.decryptionEnabled; + } + /** * Encrypts data * diff --git a/packages/epk-decryption/src/ethereum-private-key-decryption-provider.ts b/packages/epk-decryption/src/ethereum-private-key-decryption-provider.ts index 4a35c595ac..942b70f6a1 100644 --- a/packages/epk-decryption/src/ethereum-private-key-decryption-provider.ts +++ b/packages/epk-decryption/src/ethereum-private-key-decryption-provider.ts @@ -8,6 +8,7 @@ type IDecryptionParametersDictionary = Map(); if (decryptionParameters) { this.addDecryptionParameters(decryptionParameters); diff --git a/packages/lit-protocol-cipher/src/lit-protocol-cipher-provider.ts b/packages/lit-protocol-cipher/src/lit-protocol-cipher-provider.ts index 398ed191f6..d0e980af42 100644 --- a/packages/lit-protocol-cipher/src/lit-protocol-cipher-provider.ts +++ b/packages/lit-protocol-cipher/src/lit-protocol-cipher-provider.ts @@ -63,7 +63,7 @@ export default class LitProvider implements CipherProviderTypes.ICipherProvider /** * @property {boolean} isDecryptionOn - A boolean indicating if decryption is enabled. */ - private isDecryptionOn = false; + private decryptionEnabled = false; /** * @constructor @@ -284,7 +284,15 @@ export default class LitProvider implements CipherProviderTypes.ICipherProvider * @param option */ public enableDecryption(option: boolean): void { - this.isDecryptionOn = option; + this.decryptionEnabled = option; + } + + /** + * Checks if decryption is enabled. + * @returns A boolean indicating if decryption is enabled. + */ + public isDecryptionEnabled(): boolean { + return this.decryptionEnabled; } /** @@ -334,7 +342,7 @@ export default class LitProvider implements CipherProviderTypes.ICipherProvider * @returns {boolean} A boolean indicating if decryption is available. */ public isDecryptionAvailable(): boolean { - return this.client !== null && this.sessionSigs !== null && this.isDecryptionOn; + return this.client !== null && this.sessionSigs !== null && this.decryptionEnabled; } /** diff --git a/packages/types/src/cipher-provider-types.ts b/packages/types/src/cipher-provider-types.ts index 799dd12bd5..fb83677954 100644 --- a/packages/types/src/cipher-provider-types.ts +++ b/packages/types/src/cipher-provider-types.ts @@ -35,4 +35,10 @@ export interface ICipherProvider { * @param option - A boolean indicating if decryption should be switched on/off. */ enableDecryption(option: boolean): void; + + /** + * Checks if decryption is enabled. + * @returns A boolean indicating if decryption is enabled. + */ + isDecryptionEnabled(): boolean; }