UNPKG

evm-blockchain-tools

Version:

This is a collection of resuseable tools to support development for EVM-powered blockchains

20 lines 925 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const chai_1 = require("chai"); const aes_encryption_1 = require("../../src/utils/aes-encryption"); describe("AesEncryptionService", () => { it("shoult encrypt and decrypt successful", () => { const privateString = "12345"; const data = "Andy"; const encrypted = (0, aes_encryption_1.encrypt)(data, privateString); const decrypted = (0, aes_encryption_1.decrypt)(encrypted, privateString); (0, chai_1.expect)(data).to.be.eq(decrypted); }); it("shoult throws if private string is invalid", () => { const privateString = "12345"; const data = "Andy"; const encrypted = (0, aes_encryption_1.encrypt)(data, privateString); (0, chai_1.expect)(() => (0, aes_encryption_1.decrypt)(encrypted, "123")).to.throw(); }); }); //# sourceMappingURL=aes-encryption.spec.js.map