* 3.1.2

* Remove assert usage

* Unsubscribe on open observable

* Attempt a clear

* Final attempt before skip

* .skip for problematic
This commit is contained in:
Jaco
2023-03-25 10:04:20 +02:00
committed by GitHub
parent e3168c8231
commit 3250187fbb
14 changed files with 264 additions and 284 deletions
+3 -3
View File
@@ -7,8 +7,6 @@ import mkdirp from 'mkdirp';
import fs from 'node:fs';
import path from 'node:path';
import { assert } from '@polkadot/util';
// NOTE untested and unused by any known apps, probably broken in various mysterious ways
export class FileStore implements KeyringStore {
#path: string;
@@ -35,7 +33,9 @@ export class FileStore implements KeyringStore {
public get (key: string, fn: (value: KeyringJson) => void): void {
const value = this._readKey(key);
assert(value?.address, `Invalid JSON found for ${key}`);
if (!value?.address) {
throw new Error(`Invalid JSON found for ${key}`);
}
fn(value);
}