Commit c186f41a authored by Valentine Wallace's avatar Valentine Wallace

Add grpc and notification actions to settings action.

This will enable us to toggle autopilot in the settings action, and display an error if the toggle fails.
parent cd8b5f7c
......@@ -53,7 +53,7 @@ export const transaction = new TransactionAction(store, grpc, nav, notify);
export const channel = new ChannelAction(store, grpc, nav, notify);
export const invoice = new InvoiceAction(store, grpc, nav, notify, Clipboard);
export const payment = new PaymentAction(store, grpc, nav, notify, Clipboard);
export const setting = new SettingAction(store, wallet, db, ipc);
export const setting = new SettingAction(store, wallet, db, ipc, grpc, notify);
export const auth = new AuthAction(
store,
wallet,
......
......@@ -40,7 +40,7 @@ export const transaction = new TransactionAction(store, grpc, nav, notify);
export const channel = new ChannelAction(store, grpc, nav, notify);
export const invoice = new InvoiceAction(store, grpc, nav, notify, Clipboard);
export const payment = new PaymentAction(store, grpc, nav, notify, Clipboard);
export const setting = new SettingAction(store, wallet, db, ipc);
export const setting = new SettingAction(store, wallet, db, ipc, grpc, notify);
payment.listenForUrl(ipc); // enable incoming url handler
......
......@@ -8,11 +8,13 @@ import localeCurrency from 'locale-currency';
import * as log from './log';
class SettingAction {
constructor(store, wallet, db, ipc) {
constructor(store, wallet, db, ipc, grpc, notification) {
this._store = store;
this._wallet = wallet;
this._db = db;
this._ipc = ipc;
this._grpc = grpc;
this._notification = notification;
}
/**
......
......@@ -92,7 +92,7 @@ const grpc = sinon.createStubInstance(GrpcAction);
const info = sinon.createStubInstance(InfoAction);
const notify = sinon.createStubInstance(NotificationAction);
const wallet = new WalletAction(store, grpc, db, nav, notify);
const setting = new SettingAction(store, wallet, db, ipc);
const setting = new SettingAction(store, wallet, db, ipc, grpc, notify);
sinon.stub(wallet, 'update');
sinon.stub(wallet, 'checkSeed');
sinon.stub(wallet, 'checkNewPassword');
......
......@@ -2,6 +2,8 @@ import { Store } from '../../../src/store';
import IpcAction from '../../../src/action/ipc';
import SettingAction from '../../../src/action/setting';
import WalletAction from '../../../src/action/wallet';
import GrpcAction from '../../../src/action/grpc';
import NotificationAction from '../../../src/action/notification';
import AppStorage from '../../../src/action/app-storage';
import * as logger from '../../../src/action/log';
......@@ -10,6 +12,8 @@ describe('Action Setting Unit Test', () => {
let wallet;
let db;
let ipc;
let grpc;
let notify;
let setting;
let sandbox;
......@@ -20,7 +24,9 @@ describe('Action Setting Unit Test', () => {
wallet = sinon.createStubInstance(WalletAction);
db = sinon.createStubInstance(AppStorage);
ipc = sinon.createStubInstance(IpcAction);
setting = new SettingAction(store, wallet, db, ipc);
grpc = sinon.createStubInstance(GrpcAction);
notify = sinon.createStubInstance(NotificationAction);
setting = new SettingAction(store, wallet, db, ipc, grpc, notify);
});
afterEach(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment