Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async getData(): Promise {
if (this.data === '') {
try {
const encryptedData = MultiFormat.deserialize(this.persistedData);
this.data = await Utils.encryption.decrypt(encryptedData, this.channelKey);
} catch {
throw new Error('Impossible to decrypt the transaction');
}
}
return this.data;
}