Skip to content

Commit

Permalink
[DDW-197] Merge and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomislav Horaček committed Oct 22, 2020
2 parents 8463a9f + bfe3f01 commit 37bd26b
Show file tree
Hide file tree
Showing 183 changed files with 1,020 additions and 666 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -15,6 +15,8 @@ Changelog

### Chores

- Updated `cardano-launcher` to version `0.20201014.0` ([PR 2205](https://github.com/input-output-hk/daedalus/pull/2205))
- Updated `cardano-wallet` to version `2020-10-13` ([PR 2205](https://github.com/input-output-hk/daedalus/pull/2205))
- Update Nix installation instructions ([PR 2200](https://github.com/input-output-hk/daedalus/pull/2200))
- Updated `cardano-wallet` to revision `be40d5f2` which includes `cardano-node` 1.21.1 ([PR 2200](https://github.com/input-output-hk/daedalus/pull/2200))
- Dependency update ([PR 2190](https://github.com/input-output-hk/daedalus/pull/2190))
Expand Down Expand Up @@ -43,7 +45,7 @@ Changelog

- Fixed the "Retirement" label on Stake Pools for yellow theme ([PR 2189](https://github.com/input-output-hk/daedalus/pull/2189))
- Fixed stake pool tooltip "Delegate to this pool" button background colors ([PR 2181](https://github.com/input-output-hk/daedalus/pull/2181))
- Removed one second delay on changing wallet selection and selecting delegating stake slider value on the "Stake pools" screen ([PR 2179](https://github.com/input-output-hk/daedalus/pull/2179))
- Removed one second delay on changing wallet selection and selecting delegating stake slider value on the "Stake pools" screen ([PR 2180](https://github.com/input-output-hk/daedalus/pull/2180))
- Improved rendering performance of the stake pools on the "Stake pools" screen ([PR 2177](https://github.com/input-output-hk/daedalus/pull/2177))

### Chores
Expand Down
10 changes: 5 additions & 5 deletions gulpfile.js
Expand Up @@ -43,7 +43,7 @@ const buildMain = () => () =>
.pipe(webpackStream(mainWebpackConfig, webpack))
.pipe(mainOutputDestination());

const buildMainWatch = () => done =>
const buildMainWatch = () => (done) =>
mainInputSource()
.pipe(
webpackStream(mainWebpackWatchConfig, webpack, () => {
Expand All @@ -59,7 +59,7 @@ const buildRenderer = () => () =>
.pipe(webpackStream(rendererWebpackConfig, webpack))
.pipe(rendererOutputDestination());

const buildRendererWatch = () => done =>
const buildRendererWatch = () => (done) =>
rendererInputSource()
.pipe(
webpackStream(rendererWebpackWatchConfig, webpack, () => {
Expand All @@ -79,17 +79,17 @@ gulp.task(

gulp.task('clean:dist', shell.task('rimraf ./dist'));

gulp.task('server:start', done => {
gulp.task('server:start', (done) => {
electronServer.start();
done();
});

gulp.task('server:create:dev', done => {
gulp.task('server:create:dev', (done) => {
createElectronServer({ NODE_ENV: process.env.NODE_ENV || 'development' });
done();
});

gulp.task('server:create:debug', done => {
gulp.task('server:create:debug', (done) => {
createElectronServer({ NODE_ENV: process.env.NODE_ENV || 'development' }, [
'--inspect',
'--inspect-brk',
Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Expand Up @@ -29,12 +29,12 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "cardano-wallet",
"rev": "53d31285b72320d5066b334f2df5d70c7a5f6b49",
"sha256": "148mpn78lpwrrjz1x304jk45g5lzcjvnzplcfp9dfdsahhs3x1fg",
"rev": "77e04fc0f0c226f27ea2e293666bb8311ba0daa1",
"sha256": "0kc1ddidp1vip8rfnm7vp5avx46xr9nvyzn7q9r3yn50ylhx0i0j",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/53d31285b72320d5066b334f2df5d70c7a5f6b49.tar.gz",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/77e04fc0f0c226f27ea2e293666bb8311ba0daa1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "v2020-04-28"
"version": "v2020-10-13"
},
"gitignore": {
"branch": "master",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -176,11 +176,11 @@
"bip39": "2.3.0",
"blake2b": "2.1.3",
"blakejs": "1.1.0",
"borc": "^2.1.2",
"borc": "2.1.2",
"bs58": "4.0.1",
"cardano-crypto.js": "^5.3.6-rc.6",
"cardano-crypto.js": "5.3.6-rc.6",
"cardano-js": "0.4.5",
"cardano-launcher": "0.20200813.0",
"cardano-launcher": "0.20201014.0",
"cbor": "5.0.2",
"check-disk-space": "2.1.0",
"chroma-js": "2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion source/common/ipc/lib/IpcChannel.js
Expand Up @@ -142,7 +142,7 @@ export class IpcChannel<Incoming, Outgoing> {
* Sets up a permanent handler for receiving request from the other side.
*/
onRequest(
handler: Incoming => Promise<Outgoing>,
handler: (Incoming) => Promise<Outgoing>,
receiver: IpcReceiver
): void {
receiver.on(
Expand Down
2 changes: 1 addition & 1 deletion source/common/ipc/lib/IpcConversation.js
Expand Up @@ -95,7 +95,7 @@ export class IpcConversation<Incoming, Outgoing> {
* from the other side.
*/
onRequest(
handler: Incoming => Promise<Outgoing>,
handler: (Incoming) => Promise<Outgoing>,
receiver: IpcReceiver
): void {
receiver.on(
Expand Down
10 changes: 5 additions & 5 deletions source/main/cardano/CardanoNode.js
Expand Up @@ -311,7 +311,7 @@ export class CardanoNode {

return new Promise(async (resolve, reject) => {
const nodeLogFile = rfs(
time => {
(time) => {
// The module works by writing to the one file name before it is rotated out.
if (!time) return 'node.log';
const timestamp = moment.utc().format('YYYYMMDDHHmmss');
Expand All @@ -326,7 +326,7 @@ export class CardanoNode {
this._cardanoNodeLogFile = nodeLogFile;

const walletLogFile = rfs(
time => {
(time) => {
// The module works by writing to the one file name before it is rotated out.
if (!time) return 'cardano-wallet.log';
const timestamp = moment.utc().format('YYYYMMDDHHmmss');
Expand Down Expand Up @@ -367,7 +367,7 @@ export class CardanoNode {

node
.start()
.then(api => {
.then((api) => {
const processes: {
wallet: ChildProcess,
node: ChildProcess,
Expand All @@ -377,7 +377,7 @@ export class CardanoNode {
};

// Setup event handling
node.walletBackend.events.on('exit', exitStatus => {
node.walletBackend.events.on('exit', (exitStatus) => {
_log.info('CardanoNode#exit', { exitStatus });
const { code, signal } = exitStatus.wallet;
this._handleCardanoNodeExit(code, signal);
Expand All @@ -399,7 +399,7 @@ export class CardanoNode {
});
resolve();
})
.catch(exitStatus => {
.catch((exitStatus) => {
_log.error('CardanoNode#start: Error while spawning cardano-node', {
exitStatus,
});
Expand Down
7 changes: 4 additions & 3 deletions source/main/cardano/CardanoWalletLauncher.js
Expand Up @@ -131,9 +131,10 @@ export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
logger.info('Launching Wallet with --testnet flag');
}
if (smashUrl) {
logger.info('Launching Wallet with --smash-url flag', { smashUrl });
// @TODO - remove comment once WBE fixed
// merge(launcherConfig, { smashUrl });
logger.info('Launching Wallet with --pool-metadata-fetching flag', {
poolMetadataSource: { smashUrl },
});
merge(launcherConfig, { poolMetadataSource: { smashUrl } });
}
merge(launcherConfig, { nodeConfig, tlsConfiguration });
break;
Expand Down
4 changes: 2 additions & 2 deletions source/main/cardano/setup.js
Expand Up @@ -120,7 +120,7 @@ export const setupCardanoNode = (
onStopped: () => {},
onUpdating: () => {},
onUpdated: () => {},
onCrashed: code => {
onCrashed: (code) => {
const restartTimeout = cardanoNode.startupTries > 0 ? 30000 : 1000;
logger.info(
`CardanoNode crashed with code ${code}. Restarting in ${restartTimeout}ms...`,
Expand Down Expand Up @@ -180,7 +180,7 @@ export const setupCardanoNode = (
return cardanoNode.restart(true); // forced restart
});

cardanoFaultInjectionChannel.onReceive(fault => {
cardanoFaultInjectionChannel.onReceive((fault) => {
logger.info(
'ipcMain: Received request to inject a fault into cardano node',
{ fault }
Expand Down
2 changes: 1 addition & 1 deletion source/main/cardano/utils.js
Expand Up @@ -257,7 +257,7 @@ export const exportWallets = async (
const errors = stderr.toString();

logger.info(`ipcMain: Exported ${wallets.length} wallets`, {
walletsData: wallets.map(w => ({
walletsData: wallets.map((w) => ({
name: w.name,
id: w.id,
hasPassword: w.is_passphrase_empty,
Expand Down
12 changes: 6 additions & 6 deletions source/main/index.js
Expand Up @@ -192,11 +192,11 @@ const onAppReady = async () => {
client.create(mainWindow);
}

setStateSnapshotLogChannel.onReceive(data => {
setStateSnapshotLogChannel.onReceive((data) => {
return Promise.resolve(logStateSnapshot(data));
});

generateWalletMigrationReportChannel.onReceive(data => {
generateWalletMigrationReportChannel.onReceive((data) => {
return Promise.resolve(generateWalletMigrationReport(data));
});

Expand All @@ -210,7 +210,7 @@ const onAppReady = async () => {

getSystemLocaleChannel.onRequest(() => Promise.resolve(systemLocale));

mainWindow.on('close', async event => {
mainWindow.on('close', async (event) => {
logger.info(
'mainWindow received <close> event. Safe exiting Daedalus now.'
);
Expand All @@ -221,8 +221,8 @@ const onAppReady = async () => {
buildAppMenus(mainWindow, cardanoNode, locale, { isUpdateAvailable: false });

await rebuildApplicationMenu.onReceive(
data =>
new Promise(resolve => {
(data) =>
new Promise((resolve) => {
locale = getLocale(network);
buildAppMenus(mainWindow, cardanoNode, locale, {
isUpdateAvailable: data.isUpdateAvailable,
Expand All @@ -245,7 +245,7 @@ const onAppReady = async () => {
});

// Wait for controlled cardano-node shutdown before quitting the app
app.on('before-quit', async event => {
app.on('before-quit', async (event) => {
logger.info('app received <before-quit> event. Safe exiting Daedalus now.');
event.preventDefault(); // prevent Daedalus from quitting immediately
await safeExit();
Expand Down
6 changes: 3 additions & 3 deletions source/main/ipc/bugReportRequestChannel.js
Expand Up @@ -44,19 +44,19 @@ export const handleBugReportRequests = () => {

logger.info('Sending bug report request with options', { options });
const httpRequest = http.request(options);
httpRequest.on('response', response => {
httpRequest.on('response', (response) => {
if (response.statusCode !== 200) {
return reject();
}
response.on('data', () => {});
response.on('error', error => {
response.on('error', (error) => {
reject(error);
});
response.on('end', () => {
resolve();
});
});
httpRequest.on('error', error => reject(error));
httpRequest.on('error', (error) => reject(error));

// Attach form-data and trigger the request
formData.pipe(httpRequest);
Expand Down
4 changes: 2 additions & 2 deletions source/main/ipc/compress-logs.js
Expand Up @@ -32,7 +32,7 @@ export default () => {
resolve(outputPath);
});

archive.on('error', error => {
archive.on('error', (error) => {
logger.error('COMPRESS_LOGS.ERROR', { error });
reject(error);
});
Expand All @@ -48,7 +48,7 @@ export default () => {
archive.append(stream, { name: logFiles[i] });
}

archive.finalize(error => {
archive.finalize((error) => {
if (error) {
logger.error('COMPRESS_LOGS.ERROR', { error });
reject(error);
Expand Down
2 changes: 1 addition & 1 deletion source/main/ipc/download-logs.js
Expand Up @@ -13,7 +13,7 @@ export const downloadLogsChannel: MainIpcChannel<
> = new MainIpcChannel(DOWNLOAD_LOGS_CHANNEL);

export default () => {
downloadLogsChannel.onRequest(request => {
downloadLogsChannel.onRequest((request) => {
const { compressedLogsFilePath, destinationPath } = request;

if (!fs.existsSync(compressedLogsFilePath)) {
Expand Down
2 changes: 1 addition & 1 deletion source/main/ipc/downloadManagerChannel.js
Expand Up @@ -107,7 +107,7 @@ const requestDownload = async (

download.on('start', eventActions.start);
download.on('download', eventActions.download);
download.on(progressType, evt => {
download.on(progressType, (evt) => {
if (!evt || parseInt(evt.progress, 10) === currentDownloadData) return;
currentDownloadData++;
eventActions.progress(evt);
Expand Down
29 changes: 10 additions & 19 deletions source/main/ipc/generateAddressPDFChannel.js
Expand Up @@ -40,7 +40,7 @@ export const handleAddressPDFRequests = () => {
author,
} = request;

const readAssetSync = p => fs.readFileSync(path.join(__dirname, p));
const readAssetSync = (p) => fs.readFileSync(path.join(__dirname, p));
let fontRegular;
let fontMedium;

Expand Down Expand Up @@ -90,13 +90,10 @@ export const handleAddressPDFRequests = () => {
}).fillColor(textColor);

// Title
doc
.font(fontBufferMedium)
.fontSize(18)
.text(title.toUpperCase(), {
align: 'center',
characterSpacing: 2,
});
doc.font(fontBufferMedium).fontSize(18).text(title.toUpperCase(), {
align: 'center',
characterSpacing: 2,
});

// Creation date
doc
Expand All @@ -118,21 +115,15 @@ export const handleAddressPDFRequests = () => {
doc.moveDown();

// Address
doc
.font(fontBufferMono)
.fontSize(19)
.text(address, {
align: 'center',
characterSpacing: 1.5,
});
doc.font(fontBufferMono).fontSize(19).text(address, {
align: 'center',
characterSpacing: 1.5,
});

if (note) {
doc.moveDown();
// Note title
doc
.font(fontBufferRegular)
.fontSize(14)
.text(noteLabel);
doc.font(fontBufferRegular).fontSize(14).text(noteLabel);

// Note
doc.font(fontBufferUnicode).text(note);
Expand Down
4 changes: 2 additions & 2 deletions source/main/ipc/generatePaperWalletChannel.js
Expand Up @@ -38,8 +38,8 @@ export const handlePaperWalletRequests = () => {
} = request;

// Helpers
const printMnemonic = index => `${index + 1}. ${mnemonics[index]}`;
const readAssetSync = p => fs.readFileSync(path.join(__dirname, p));
const printMnemonic = (index) => `${index + 1}. ${mnemonics[index]}`;
const readAssetSync = (p) => fs.readFileSync(path.join(__dirname, p));

// Generate QR image for wallet address
const qrCodeImage = qr.imageSync(address, {
Expand Down
2 changes: 1 addition & 1 deletion source/main/ipc/generateRewardsCsvChannel.js
Expand Up @@ -25,7 +25,7 @@ export const handleRewardsCsvRequests = () => {
return reject(csvErr);
}

return fs.writeFile(filePath, output, fileErr => {
return fs.writeFile(filePath, output, (fileErr) => {
if (fileErr) {
return reject(fileErr);
}
Expand Down
5 changes: 1 addition & 4 deletions source/main/ipc/get-logs.js
Expand Up @@ -59,10 +59,7 @@ export default () => {
// check if pub folder exists and create array of log file names
const logFiles: Array<string> = [];
if (fs.existsSync(pubLogsFolderPath)) {
const files = fs
.readdirSync(pubLogsFolderPath)
.sort()
.reverse();
const files = fs.readdirSync(pubLogsFolderPath).sort().reverse();

let nodeLogsIncluded = 0;
let launcherLogsIncluded = 0;
Expand Down
2 changes: 1 addition & 1 deletion source/main/ipc/getHardwareWalletChannel.js
@@ -1,7 +1,7 @@
// @flow
/* eslint-disable no-console */
// @TODO - enable console once connecting logic refined
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
//import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
import AppAda, { cardano } from '@cardano-foundation/ledgerjs-hw-app-cardano';
import { BrowserWindow } from 'electron';
// $FlowFixMe
Expand Down
2 changes: 1 addition & 1 deletion source/main/ipc/lib/MainIpcChannel.js
Expand Up @@ -37,7 +37,7 @@ export class MainIpcChannel<Incoming, Outgoing> extends IpcChannel<
}

onRequest(
handler: Incoming => Promise<Outgoing>,
handler: (Incoming) => Promise<Outgoing>,
receiver: IpcReceiver = ipcMain
): void {
super.onRequest(handler, receiver);
Expand Down

0 comments on commit 37bd26b

Please sign in to comment.