Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 5d9f646

Browse files
committed
Remove transaction from the channel action since wallet
balances are polled and transaction list is updated when navigating there
1 parent 62c8426 commit 5d9f646

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

src/action/channel.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import { toSatoshis, parseSat } from '../helper';
77
import * as log from './log';
88

99
class ChannelAction {
10-
constructor(store, grpc, transaction, nav, notification) {
10+
constructor(store, grpc, nav, notification) {
1111
this._store = store;
1212
this._grpc = grpc;
13-
this._transaction = transaction;
1413
this._nav = nav;
1514
this._notification = notification;
1615
}
@@ -84,7 +83,6 @@ class ChannelAction {
8483
this.getPeers(),
8584
this.getChannels(),
8685
this.getPendingChannels(),
87-
this._transaction.update(),
8886
]);
8987
}
9088

src/action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const notify = new NotificationAction(store, nav);
3737
export const wallet = new WalletAction(store, grpc, db, nav, notify);
3838
export const info = new InfoAction(store, grpc, nav, notify);
3939
export const transaction = new TransactionAction(store, grpc, nav);
40-
export const channel = new ChannelAction(store, grpc, transaction, nav, notify);
40+
export const channel = new ChannelAction(store, grpc, nav, notify);
4141
export const invoice = new InvoiceAction(store, grpc, nav, notify, Clipboard);
4242
export const payment = new PaymentAction(store, grpc, transaction, nav, notify);
4343
export const setting = new SettingAction(store, wallet, db, ipc);

stories/screen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const payment = new PaymentAction(store, grpc, transaction, nav, notify);
7373
sinon.stub(payment, 'checkType');
7474
sinon.stub(payment, 'payBitcoin');
7575
sinon.stub(payment, 'payLightning');
76-
const channel = new ChannelAction(store, grpc, transaction, nav, notify);
76+
const channel = new ChannelAction(store, grpc, nav, notify);
7777
sinon.stub(channel, 'update');
7878
sinon.stub(channel, 'connectAndOpen');
7979
sinon.stub(channel, 'closeSelectedChannel');

test/integration/action/action-integration.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('Action Integration Tests', function() {
150150
info1 = new InfoAction(store1, grpc1, nav1, notify1);
151151
wallet1 = new WalletAction(store1, grpc1, db1, nav1, notify1);
152152
transactions1 = new TransactionAction(store1, grpc1, nav1);
153-
channels1 = new ChannelAction(store1, grpc1, transactions1, nav1, notify1);
153+
channels1 = new ChannelAction(store1, grpc1, nav1, notify1);
154154
invoice1 = new InvoiceAction(store1, grpc1, nav1, notify1);
155155
payments1 = new PaymentAction(store1, grpc1, transactions1, nav1, notify1);
156156

@@ -162,7 +162,7 @@ describe('Action Integration Tests', function() {
162162
info2 = new InfoAction(store2, grpc2, nav2, notify2);
163163
wallet2 = new WalletAction(store2, grpc2, db2, nav2, notify2);
164164
transactions2 = new TransactionAction(store2, grpc2, nav2);
165-
channels2 = new ChannelAction(store2, grpc2, transactions2, nav2, notify2);
165+
channels2 = new ChannelAction(store2, grpc2, nav2, notify2);
166166
invoice2 = new InvoiceAction(store2, grpc2, nav2, notify2);
167167
payments2 = new PaymentAction(store2, grpc2, transactions2, nav2, notify2);
168168
});

test/unit/action/channel.spec.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Store } from '../../../src/store';
22
import GrpcAction from '../../../src/action/grpc';
33
import ChannelAction from '../../../src/action/channel';
4-
import TransactionAction from '../../../src/action/transaction';
54
import NotificationAction from '../../../src/action/notification';
65
import NavAction from '../../../src/action/nav';
76
import * as logger from '../../../src/action/log';
@@ -16,7 +15,6 @@ describe('Action Channels Unit Tests', () => {
1615
let grpc;
1716
let channel;
1817
let nav;
19-
let transaction;
2018
let notification;
2119

2220
beforeEach(() => {
@@ -26,10 +24,9 @@ describe('Action Channels Unit Tests', () => {
2624
store.settings.displayFiat = false;
2725
require('../../../src/config').RETRY_DELAY = 1;
2826
grpc = sinon.createStubInstance(GrpcAction);
29-
transaction = sinon.createStubInstance(TransactionAction);
3027
notification = sinon.createStubInstance(NotificationAction);
3128
nav = sinon.createStubInstance(NavAction);
32-
channel = new ChannelAction(store, grpc, transaction, nav, notification);
29+
channel = new ChannelAction(store, grpc, nav, notification);
3330
});
3431

3532
afterEach(() => {
@@ -85,7 +82,6 @@ describe('Action Channels Unit Tests', () => {
8582
it('should refresh channels and peers', async () => {
8683
await channel.update();
8784
expect(grpc.sendCommand, 'was called thrice');
88-
expect(transaction.update, 'was called once');
8985
});
9086
});
9187

0 commit comments

Comments
 (0)