From cebbf929113e2905db6e78929b64ea1eeb473a4e Mon Sep 17 00:00:00 2001 From: Justin Tormey Date: Tue, 10 Oct 2017 10:58:28 -0400 Subject: [PATCH] fix(Cash): mark bch.imported as having bch coinCode --- src/bch/bch-imported.js | 4 ++++ tests/bch/bch-account.spec.js | 4 ++++ tests/bch/bch-imported.spec.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/bch/bch-imported.js b/src/bch/bch-imported.js index 9414280e6..ab4b4d3b6 100644 --- a/src/bch/bch-imported.js +++ b/src/bch/bch-imported.js @@ -18,6 +18,10 @@ class BchImported extends BchSpendable { return balances.every(x => x == null) ? null : sumNonNull(balances) } + get coinCode () { + return 'bch' + } + getAvailableBalance (feePerByte) { return super.getAvailableBalance(this.addresses, feePerByte) } diff --git a/tests/bch/bch-account.spec.js b/tests/bch/bch-account.spec.js index bfa4f1b35..2d90e7c72 100644 --- a/tests/bch/bch-account.spec.js +++ b/tests/bch/bch-account.spec.js @@ -29,6 +29,10 @@ describe('BchAccount', () => { expect(account.label).toEqual('Bitcoin Cash - My Wallet') }) + it('should have: coinCode=bch', () => { + expect(account.coinCode).toEqual('bch') + }) + it('should have: balance', () => { spyOn(BchSpendable.prototype, 'getAddressBalance').and.callThrough() expect(account.balance).toEqual(null) diff --git a/tests/bch/bch-imported.spec.js b/tests/bch/bch-imported.spec.js index 2d0323cd4..a97af697a 100644 --- a/tests/bch/bch-imported.spec.js +++ b/tests/bch/bch-imported.spec.js @@ -23,6 +23,10 @@ describe('BchImported', () => { expect(imported.label).toEqual('Imported Addresses') }) + it('should have: coinCode=bch', () => { + expect(imported.coinCode).toEqual('bch') + }) + it('should have: balance (null)', () => { spyOn(BchSpendable.prototype, 'getAddressBalance').and.returnValue(null) expect(imported.balance).toEqual(null)