This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,9 @@ class WalletAction {
158158
159159 async getChannelBalance ( ) {
160160 try {
161- const response = await this . _grpc . sendCommand ( 'ChannelBalance' ) ;
162- this . _store . channelBalanceSatoshis = parseSat ( response . balance ) ;
161+ const r = await this . _grpc . sendCommand ( 'ChannelBalance' ) ;
162+ this . _store . channelBalanceSatoshis = parseSat ( r . balance ) ;
163+ this . _store . pendingBalanceSatoshis = parseSat ( r . pending_open_balance ) ;
163164 } catch ( err ) {
164165 log . error ( 'Getting channel balance failed' , err ) ;
165166 }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export class Store {
2424 balanceSatoshis : 0 ,
2525 confirmedBalanceSatoshis : 0 ,
2626 unconfirmedBalanceSatoshis : 0 ,
27+ pendingBalanceSatoshis : 0 ,
2728 channelBalanceSatoshis : 0 ,
2829 pubKey : null ,
2930 walletAddress : null ,
Original file line number Diff line number Diff line change @@ -292,9 +292,13 @@ describe('Action Wallet Unit Tests', () => {
292292
293293 describe ( 'getChannelBalance()' , ( ) => {
294294 it ( 'should get channel balance' , async ( ) => {
295- grpc . sendCommand . withArgs ( 'ChannelBalance' ) . resolves ( { balance : '1' } ) ;
295+ grpc . sendCommand . withArgs ( 'ChannelBalance' ) . resolves ( {
296+ balance : '1' ,
297+ pending_open_balance : '2' ,
298+ } ) ;
296299 await wallet . getChannelBalance ( ) ;
297300 expect ( store . channelBalanceSatoshis , 'to equal' , 1 ) ;
301+ expect ( store . pendingBalanceSatoshis , 'to equal' , 2 ) ;
298302 } ) ;
299303
300304 it ( 'should log error on failure' , async ( ) => {
You can’t perform that action at this time.
0 commit comments