mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 06:52:41 +01:00
fix eslint
This commit is contained in:
parent
bd39adf8fc
commit
bdcaa2021f
2 changed files with 7 additions and 6 deletions
|
@ -143,11 +143,11 @@ export class AbstractWallet {
|
|||
if (this.secret.startsWith('BC1')) this.secret = this.secret.toLowerCase();
|
||||
|
||||
// [fingerprint/derivation]zpub
|
||||
let re = /\[([^\]]+)\](.*)/;
|
||||
let m = this.secret.match(re);
|
||||
if(m && m.length==3){
|
||||
let hexFingerprint = m[1].split("/")[0];
|
||||
if(hexFingerprint.length == 8){
|
||||
const re = /\[([^\]]+)\](.*)/;
|
||||
const m = this.secret.match(re);
|
||||
if (m && m.length === 3) {
|
||||
let hexFingerprint = m[1].split('/')[0];
|
||||
if (hexFingerprint.length === 8) {
|
||||
hexFingerprint = Buffer.from(hexFingerprint, 'hex').reverse().toString('hex');
|
||||
this.masterFingerprint = parseInt(hexFingerprint, 16);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,8 @@ describe('Watch only wallet', () => {
|
|||
});
|
||||
|
||||
it('can import zpub with master fingerprint', async () => {
|
||||
const zpub = "[8cce63f8/84h/0h/0h]zpub6s2RJ9qAEBW8Abhojs6LyDzF7gttcDr6EsR3Umu2aptZBb45e734rGtt4KqsCMmNyR1EEzUU2ugdVYez2VywQvAbBjUSKn8ho4Zk2c5otkk";
|
||||
const zpub =
|
||||
'[8cce63f8/84h/0h/0h]zpub6s2RJ9qAEBW8Abhojs6LyDzF7gttcDr6EsR3Umu2aptZBb45e734rGtt4KqsCMmNyR1EEzUU2ugdVYez2VywQvAbBjUSKn8ho4Zk2c5otkk';
|
||||
const w = new WatchOnlyWallet();
|
||||
w.setSecret(zpub);
|
||||
w.init();
|
||||
|
|
Loading…
Add table
Reference in a new issue