diff --git a/HDBech32Wallet.test.js b/HDBech32Wallet.test.js index 2d8de6ff3..4036a43eb 100644 --- a/HDBech32Wallet.test.js +++ b/HDBech32Wallet.test.js @@ -15,7 +15,6 @@ beforeAll(async () => { // awaiting for Electrum to be connected. For RN Electrum would naturally connect // while app starts up, but for tests we need to wait for it await BlueElectrum.waitTillConnected(); - console.log('electrum connected'); }); describe('Bech32 Segwit HD (BIP84)', () => { diff --git a/screen/selftest.js b/screen/selftest.js index fff079a46..26ed913ca 100644 --- a/screen/selftest.js +++ b/screen/selftest.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { ScrollView, View } from 'react-native'; import { BlueLoading, BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle } from '../BlueComponents'; import PropTypes from 'prop-types'; -import { SegwitP2SHWallet, LegacyWallet, HDSegwitP2SHWallet } from '../class'; +import { SegwitP2SHWallet, LegacyWallet, HDSegwitP2SHWallet, HDSegwitBech32Wallet } from '../class'; let BigNumber = require('bignumber.js'); let encryption = require('../encryption'); let bitcoin = require('bitcoinjs-lib'); @@ -262,6 +262,16 @@ export default class Selftest extends Component { if (hd3.getBalance() !== 26000) throw new Error('Could not fetch HD balance'); await hd3.fetchTransactions(); if (hd3.transactions.length !== 7) throw new Error('Could not fetch HD transactions'); + + // + + let hd4 = new HDSegwitBech32Wallet(); + hd4._xpub = 'zpub6r7jhKKm7BAVx3b3nSnuadY1WnshZYkhK8gKFoRLwK9rF3Mzv28BrGcCGA3ugGtawi1WLb2vyjQAX9ZTDGU5gNk2bLdTc3iEXr6tzR1ipNP'; + await hd4.fetchBalance(); + if (hd4.getBalance() !== 200000) throw new Error('Could not fetch HD Bech32 balance'); + await hd4.fetchTransactions(); + if (hd4.getTransactions().length !== 4) + throw new Error('Could not fetch HD Bech32 transactions'); } else { console.warn('skipping RN-specific test'); }