TST: Add Electrum backup JSON test

This commit is contained in:
marcosrdz 2021-02-07 23:59:31 -05:00
parent 99b4a1611c
commit ed1640fe7c
2 changed files with 46 additions and 1 deletions

View File

@ -167,7 +167,12 @@ export class AbstractWallet {
let parsedSecret;
// regex might've matched invalid data. if so, parse newSecret.
if (this.secret.trim().length > 0) {
parsedSecret = JSON.parse(this.secret);
try {
parsedSecret = JSON.parse(this.secret);
} catch (e) {
console.log(e);
parsedSecret = JSON.parse(newSecret);
}
} else {
parsedSecret = JSON.parse(newSecret);
}

File diff suppressed because one or more lines are too long