Skip to content

Commit

Permalink
Merges develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaglumac committed Feb 25, 2021
2 parents 96a3fda + 4fc35fb commit 0d79071
Show file tree
Hide file tree
Showing 83 changed files with 2,311 additions and 953 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,44 @@
Changelog
=========

## vNext

### Chores

- Adjusted hover PopOver styles on the first tile in the delegation center screen ([PR 2386](https://github.com/input-output-hk/daedalus/pull/2386))

## 3.3.1

### Features

- Implemented "Undelegate wallet" feature on "Wallet settings" screen ([PR 2351](https://github.com/input-output-hk/daedalus/pull/2351))

### Fixes

- Fixed calendar style issue on Filter dialog on transaction list screen ([PR 2387](https://github.com/input-output-hk/daedalus/pull/2387))
- Fixed issue on wallet send form with certain amounts ([PR 2379](https://github.com/input-output-hk/daedalus/pull/2379))

### Chores

- Enabled selecting whole addresses and ids when selecting them to copy on transactions and summary screens ([PR 2370](https://github.com/input-output-hk/daedalus/pull/2370))
- Added missing whitespace between amount and ADA in Japanese ([PR 2380](https://github.com/input-output-hk/daedalus/pull/2380))
- Updated link "Follow instructions and manually update" on testnet and flight ([PR 2372](https://github.com/input-output-hk/daedalus/pull/2372))
- Fixed broken staking stories in Storybook ([PR 2371](https://github.com/input-output-hk/daedalus/pull/2371))

## 3.3.0

### Fixes

- Fixed issue with hardware wallet delegation ([PR 2369](https://github.com/input-output-hk/daedalus/pull/2369))

### Chores

- Updated `@cardano-foundation/ledgerjs-hw-app-cardano` package to version `2.2.0` ([PR 2381](https://github.com/input-output-hk/daedalus/pull/2381))
- Updated `cardano-launcher` to version `0.20210215.0` ([PR 2363](https://github.com/input-output-hk/daedalus/pull/2363))
- Updated `cardano-wallet` to version `2021-02-15` ([PR 2363](https://github.com/input-output-hk/daedalus/pull/2363))
- Updated `cardano-wallet` to version `2021-02-12` ([PR 2358](https://github.com/input-output-hk/daedalus/pull/2358))
- Improved the error messages for the custom SMASH server url input ([PR 2355](https://github.com/input-output-hk/daedalus/pull/2355))

## 3.3.0-FC1

### Features
Expand Down
32 changes: 32 additions & 0 deletions README.md
Expand Up @@ -84,6 +84,38 @@ Daedalus - Cryptocurrency Wallet
1. Run `yarn nix:shelley_qa` from `daedalus`.
2. Run `yarn dev` from the subsequent `nix-shell`

#### Native token metadata server

Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.

It's also possible to use a mock server locally by running the following command in `nix-shell` prior to starting Daedalus:

```
$ mock-token-metadata-server ./utils/cardano/native-tokens/registry.json
Mock metadata server running with url http://localhost:65432/
```

Then proceed to launch Daedalus and make sure to provide the mock token metadata server port:

```
$ MOCK_TOKEN_METADATA_SERVER_PORT=65432 yarn dev
```

This enables you to modify the metadata directly by modifying the registry file directly:

```
$ vi ./utils/cardano/native-tokens/registry.json # ..or any other editor, if you prefer
```

Use the following command to check if the mock server is working correctly:

```
$ curl -i -H "Content-type: application/json" --data '{"subjects":["789ef8ae89617f34c07f7f6a12e4d65146f958c0bc15a97b4ff169f1"],"properties":["name","description","acronym","unit","logo"]}'
http://localhost:65432/metadata/query
```
... and expect a "200 OK" response.


### Running Daedalus with Jormungandr

#### ITN Selfnode
Expand Down
1 change: 1 addition & 0 deletions default.nix
Expand Up @@ -85,6 +85,7 @@ let
cardano-wallet = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; };
cardano-wallet-native = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; };
cardano-address = (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).cardano-address;
mock-token-metadata-server = (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).mock-token-metadata-server;
cardano-shell = import self.sources.cardano-shell { inherit system; crossSystem = crossSystem shellPkgs.lib; };
cardano-cli = (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).cardano-cli;
shelley-test-cluster = if cluster == "selfnode" then (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).project.hsPkgs.cardano-wallet.components.exes.shelley-test-cluster else null;
Expand Down
3 changes: 3 additions & 0 deletions installers/common/MacInstaller.hs
Expand Up @@ -280,6 +280,9 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
, "trezor-connect"
, "js-chain-libs-node"
, "bignumber.js"
, "int64-buffer"
, "call-bind"
, "get-intrinsic"
]
mapM_ (\lib -> do
cptree ("../node_modules" </> lib) ((fromText pathtoapp) </> "Contents/Resources/app/node_modules" </> lib)
Expand Down
2 changes: 2 additions & 0 deletions netlify.toml
@@ -0,0 +1,2 @@
[build]
environment = { YARN_VERSION = "1.22.4" }
11 changes: 5 additions & 6 deletions nix/sources.json
Expand Up @@ -24,17 +24,16 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cardano-wallet": {
"branch": "refs/tags/v2021-01-28",
"branch": "master",
"description": "Official Wallet Backend & API for Cardano decentralized",
"homepage": null,
"owner": "input-output-hk",
"repo": "cardano-wallet",
"rev": "1ea5e8824dbc4d7b1624e41088700a10ad118aa8",
"sha256": "1pzwwwwx02mb8r7jk999w8pms0spgq3ckjcyfih336nq1ybxi2wg",
"rev": "a37c9856b4d96286e3f01a95026c63b986ebbba0",
"sha256": "1mg8n58j2mjqhhzjb4p5yp8z06b9arh40pagi9rddil2f3vxzihm",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/1ea5e8824dbc4d7b1624e41088700a10ad118aa8.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "v2021-01-28"
"url": "https://github.com/input-output-hk/cardano-wallet/archive/a37c9856b4d96286e3f01a95026c63b986ebbba0.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"gitignore": {
"branch": "master",
Expand Down
10 changes: 5 additions & 5 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "3.3.0-FC1",
"version": "3.3.1",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down Expand Up @@ -172,7 +172,7 @@
"yarn-lockfile": "1.1.1"
},
"dependencies": {
"@cardano-foundation/ledgerjs-hw-app-cardano": "2.1.0",
"@cardano-foundation/ledgerjs-hw-app-cardano": "2.2.0",
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
"aes-js": "3.1.2",
"bignumber.js": "9.0.1",
Expand All @@ -183,7 +183,7 @@
"bs58": "4.0.1",
"cardano-crypto.js": "5.3.6-rc.6",
"cardano-js": "0.4.5",
"cardano-launcher": "0.20201014.0",
"cardano-launcher": "0.20210215.0",
"cbor": "5.0.2",
"check-disk-space": "2.1.0",
"chroma-js": "2.1.0",
Expand Down Expand Up @@ -230,7 +230,7 @@
"react-intl": "2.7.2",
"react-lottie": "1.2.3",
"react-markdown": "4.3.1",
"react-polymorph": "0.9.7-rc.17",
"react-polymorph": "0.9.8-rc.9",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-svg-inline": "2.1.1",
Expand All @@ -247,7 +247,7 @@
"source-map-support": "0.5.19",
"spectron-fake-dialog": "0.0.1",
"tcp-port-used": "1.0.1",
"trezor-connect": "8.1.16-extended",
"trezor-connect": "8.1.22-extended",
"unorm": "1.6.0",
"validator": "13.1.17"
},
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Expand Up @@ -51,6 +51,7 @@ let
daedalusPkgs.daedalus-bridge
daedalusPkgs.daedalus-installer
daedalusPkgs.darwin-launcher
daedalusPkgs.mock-token-metadata-server
] ++ (with pkgs; [
nix bash binutils coreutils curl gnutar
git python27 curl jq
Expand Down
6 changes: 4 additions & 2 deletions source/common/types/hardware-wallets.types.js
Expand Up @@ -175,7 +175,7 @@ export type LedgerSignTransactionRequest = {
inputs: LedgerSignTransactionInputsType,
outputs: LedgerSignTransactionOutputsType,
fee: string,
ttl: string,
ttl?: string,
networkId: number,
protocolMagic: number,
// $FlowFixMe
Expand All @@ -185,18 +185,20 @@ export type LedgerSignTransactionRequest = {
metadataHashHex: ?string, // TODO - add once metadata defined
reset?: boolean,
devicePath: ?string,
validityIntervalStartStr?: string,
};

export type TrezorSignTransactionRequest = {
inputs: TrezorSignTransactionInputsType,
outputs: TrezorSignTransactionOutputsType,
fee: string,
fee?: string,
ttl: string,
networkId: number,
protocolMagic: number,
certificates: Array<?Certificate>,
reset?: boolean,
devicePath: string,
validityIntervalStartStr?: string,
};

export type LedgerSignTransactionResponse = {
Expand Down
20 changes: 19 additions & 1 deletion source/main/cardano/CardanoWalletLauncher.js
Expand Up @@ -7,7 +7,12 @@ import * as cardanoLauncher from 'cardano-launcher';
import type { Launcher } from 'cardano-launcher';
import type { NodeConfig } from '../config';
import { environment } from '../environment';
import { STAKE_POOL_REGISTRY_URL } from '../config';
import {
STAKE_POOL_REGISTRY_URL,
TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_PORT,
} from '../config';
import {
MAINNET,
STAGING,
Expand Down Expand Up @@ -95,6 +100,8 @@ export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
await fs.copy('tls', tlsPath);
}

let tokenMetadataServer;

// This switch statement handles any node specific
// configuration, prior to spawning the child process
logger.info('Node implementation', { nodeImplementation });
Expand Down Expand Up @@ -128,6 +135,17 @@ export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
launcherConfig.networkName = TESTNET;
logger.info('Launching Wallet with --testnet flag');
}
if (MOCK_TOKEN_METADATA_SERVER_PORT) {
tokenMetadataServer = `${MOCK_TOKEN_METADATA_SERVER_URL}:${MOCK_TOKEN_METADATA_SERVER_PORT}/`;
} else if (cluster !== MAINNET) {
tokenMetadataServer = TOKEN_METADATA_SERVER_URL;
}
if (tokenMetadataServer) {
logger.info('Launching Wallet with --token-metadata-server flag', {
tokenMetadataServer,
});
merge(launcherConfig, { tokenMetadataServer });
}
merge(launcherConfig, { nodeConfig, tlsConfiguration });
break;
case CardanoNodeImplementationOptions.JORMUNGANDR:
Expand Down
9 changes: 9 additions & 0 deletions source/main/config.js
Expand Up @@ -176,3 +176,12 @@ export const STAKE_POOL_REGISTRY_URL = {
qa:
'https://explorer.qa.jormungandr-testnet.iohkdev.io/stakepool-registry/registry.zip',
};

// Used for all non mainnet networks
export const TOKEN_METADATA_SERVER_URL =
'https://metadata.cardano-testnet.iohkdev.io/';

// Used by mock-token-metadata-server
export const MOCK_TOKEN_METADATA_SERVER_URL = 'http://localhost';
export const MOCK_TOKEN_METADATA_SERVER_PORT =
process.env.MOCK_TOKEN_METADATA_SERVER_PORT || 0;
6 changes: 6 additions & 0 deletions source/main/ipc/getHardwareWalletChannel.js
Expand Up @@ -536,6 +536,7 @@ export const handleHardwareWalletRequests = async (
}
});

// @TODO - validityIntervalStartStr is not working with Cardano App 2.1.0
signTransactionLedgerChannel.onRequest(async (params) => {
const {
inputs,
Expand All @@ -548,6 +549,7 @@ export const handleHardwareWalletRequests = async (
withdrawals,
metadataHashHex,
devicePath,
// validityIntervalStartStr,
} = params;
logger.info('[HW-DEBUG] SIGN Ledger transaction');
deviceConnection = devicePath
Expand All @@ -558,6 +560,7 @@ export const handleHardwareWalletRequests = async (
if (!deviceConnection) {
throw new Error('Device not connected!');
}

const signedTransaction = await deviceConnection.signTransaction(
networkId,
protocolMagic,
Expand All @@ -568,6 +571,7 @@ export const handleHardwareWalletRequests = async (
certificates,
withdrawals,
metadataHashHex
// validityIntervalStartStr
);
return Promise.resolve(signedTransaction);
} catch (e) {
Expand All @@ -585,6 +589,7 @@ export const handleHardwareWalletRequests = async (
networkId,
certificates,
devicePath,
validityIntervalStartStr,
} = params;

if (!TrezorConnect) {
Expand All @@ -600,6 +605,7 @@ export const handleHardwareWalletRequests = async (
protocolMagic,
networkId,
certificates,
validityIntervalStartStr,
};
const signedTransaction = await TrezorConnect.cardanoSignTransaction({
device: { path: devicePath },
Expand Down
2 changes: 2 additions & 0 deletions source/main/webpack.config.js
Expand Up @@ -72,6 +72,8 @@ module.exports = {
'process.env.NETWORK': JSON.stringify(
process.env.NETWORK || 'development'
),
'process.env.MOCK_TOKEN_METADATA_SERVER_PORT':
process.env.MOCK_TOKEN_METADATA_SERVER_PORT || 0,
'process.env.MOBX_DEV_TOOLS': process.env.MOBX_DEV_TOOLS || 0,
'process.env.BUILD_NUMBER': JSON.stringify(
process.env.BUILD_NUMBER || 'dev'
Expand Down
7 changes: 2 additions & 5 deletions source/renderer/app/actions/wallets-actions.js
Expand Up @@ -6,6 +6,7 @@ import type {
HardwareWalletExtendedPublicKeyResponse,
} from '../../../common/types/hardware-wallets.types';
import type { CsvFileContent } from '../../../common/types/csv-request.types';
import type { QuitStakePoolRequest } from '../api/staking/types';

export type WalletImportFromFileParams = {
filePath: string,
Expand Down Expand Up @@ -44,11 +45,7 @@ export default class WalletsActions {
restoreWallet: Action<any> = new Action();
importWalletFromFile: Action<WalletImportFromFileParams> = new Action();
deleteWallet: Action<{ walletId: string, isLegacy: boolean }> = new Action();
undelegateWallet: Action<{
walletId: string,
stakePoolId: string,
passphrase: string,
}> = new Action();
undelegateWallet: Action<QuitStakePoolRequest> = new Action();
setUndelegateWalletSubmissionSuccess: Action<{
result: boolean,
}> = new Action();
Expand Down

0 comments on commit 0d79071

Please sign in to comment.