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

Commit 469f3e6

Browse files
valentinewallacetanx
authored andcommitted
Add notification parameter to TransactionAction.
The purpose of adding this parameter is so we'll then be able to notify the user when they receive an invoice payment.
1 parent 659d257 commit 469f3e6

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/action/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const grpc = new GrpcAction(store, ipc);
3636
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);
39-
export const transaction = new TransactionAction(store, grpc, nav);
39+
export const transaction = new TransactionAction(store, grpc, nav, notify);
4040
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, nav, notify);

src/action/transaction.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import * as log from './log';
77
import { parseDate, parseSat, toHex } from '../helper';
88

99
class TransactionAction {
10-
constructor(store, grpc, nav) {
10+
constructor(store, grpc, nav, notification) {
1111
this._store = store;
1212
this._grpc = grpc;
1313
this._nav = nav;
14+
this._notification = notification;
1415
}
1516

1617
/**

stories/screen-story.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sinon.stub(wallet, 'checkSeed');
6767
sinon.stub(wallet, 'checkNewPassword');
6868
sinon.stub(wallet, 'checkPassword');
6969
sinon.stub(wallet, 'getExchangeRate');
70-
const transaction = new TransactionAction(store, grpc, nav);
70+
const transaction = new TransactionAction(store, grpc, nav, notify);
7171
sinon.stub(transaction, 'update');
7272
const invoice = new InvoiceAction(store, grpc, nav, notify, Clipboard);
7373
sinon.stub(invoice, 'generateUri');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('Action Integration Tests', function() {
149149
grpc1 = new GrpcAction(store1, ipc1);
150150
info1 = new InfoAction(store1, grpc1, nav1, notify1);
151151
wallet1 = new WalletAction(store1, grpc1, db1, nav1, notify1);
152-
transactions1 = new TransactionAction(store1, grpc1, nav1);
152+
transactions1 = new TransactionAction(store1, grpc1, nav1, notify1);
153153
channels1 = new ChannelAction(store1, grpc1, nav1, notify1);
154154
invoice1 = new InvoiceAction(store1, grpc1, nav1, notify1);
155155
payments1 = new PaymentAction(store1, grpc1, nav1, notify1);
@@ -161,7 +161,7 @@ describe('Action Integration Tests', function() {
161161
grpc2 = new GrpcAction(store2, ipc2);
162162
info2 = new InfoAction(store2, grpc2, nav2, notify2);
163163
wallet2 = new WalletAction(store2, grpc2, db2, nav2, notify2);
164-
transactions2 = new TransactionAction(store2, grpc2, nav2);
164+
transactions2 = new TransactionAction(store2, grpc2, nav2, notify2);
165165
channels2 = new ChannelAction(store2, grpc2, nav2, notify2);
166166
invoice2 = new InvoiceAction(store2, grpc2, nav2, notify2);
167167
payments2 = new PaymentAction(store2, grpc2, nav2, notify2);

test/unit/action/transaction.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import { Store } from '../../../src/store';
22
import GrpcAction from '../../../src/action/grpc';
33
import TransactionAction from '../../../src/action/transaction';
44
import NavAction from '../../../src/action/nav';
5+
import NotificationAction from '../../../src/action/notification';
56
import * as logger from '../../../src/action/log';
67

78
describe('Action Transactions Unit Tests', () => {
89
let store;
910
let sandbox;
1011
let grpc;
1112
let nav;
13+
let notification;
1214
let transaction;
1315

1416
beforeEach(() => {
@@ -18,7 +20,8 @@ describe('Action Transactions Unit Tests', () => {
1820
require('../../../src/config').RETRY_DELAY = 1;
1921
grpc = sinon.createStubInstance(GrpcAction);
2022
nav = sinon.createStubInstance(NavAction);
21-
transaction = new TransactionAction(store, grpc, nav);
23+
notification = sinon.createStubInstance(NotificationAction);
24+
transaction = new TransactionAction(store, grpc, nav, notification);
2225
});
2326

2427
afterEach(() => {

0 commit comments

Comments
 (0)