mirror of
https://github.com/paritytech/banana_split.git
synced 2026-09-12 19:51:03 +05:00
small changes
This commit is contained in:
parent
4250227ad6
commit
ab170b93cb
@ -31,17 +31,16 @@ export default Vue.extend({
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
const self = this;
|
||||
this.$eventHub.$on("showError", function(text: string) {
|
||||
self.level = AlertLevel.Error;
|
||||
self.message = text;
|
||||
this.$eventHub.$on("showError", (text: string) => {
|
||||
this.level = AlertLevel.Error;
|
||||
this.message = text;
|
||||
});
|
||||
this.$eventHub.$on("showWarn", function(text: string) {
|
||||
self.level = AlertLevel.Warn;
|
||||
self.message = text;
|
||||
this.$eventHub.$on("showWarn", (text: string) => {
|
||||
this.level = AlertLevel.Warn;
|
||||
this.message = text;
|
||||
});
|
||||
this.$eventHub.$on("clearAlerts", function() {
|
||||
self.message = null;
|
||||
this.$eventHub.$on("clearAlerts", () => {
|
||||
this.message = null;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -92,7 +92,7 @@ function decrypt(
|
||||
salt: Uint8Array,
|
||||
passphrase: string,
|
||||
nonce: Uint8Array
|
||||
): Uint8Array {
|
||||
): Uint8Array | null {
|
||||
const key = SCRYPT(passphrase, Buffer.from(salt.buffer), 1 << 15, 8, 1, 32);
|
||||
// This is a false positive, `secretbox.open` is unrelated to `fs.open`
|
||||
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
||||
|
||||
@ -52,7 +52,7 @@ test("fails with incorrect password", () => {
|
||||
);
|
||||
var parsed = shards.map(s => crypto.parse(s));
|
||||
expect(() => crypto.reconstruct(parsed, "")).toThrow(
|
||||
new Error("Unable to decrypt the secret")
|
||||
"Unable to decrypt the secret"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user