Skip to content

Commit

Permalink
[DDW-419] Merges develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaglumac committed Mar 2, 2021
2 parents 646d08a + f832601 commit 1e7bba4
Show file tree
Hide file tree
Showing 167 changed files with 10,376 additions and 2,368 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,59 @@ Changelog

- Increased the maximum number of wallets limit to 100 and optimized wallet data polling ([PR 2208](https://github.com/input-output-hk/daedalus/pull/2208))

## 4.0.0-FC1

### Features

- Added native token support [PR 2292](https://github.com/input-output-hk/daedalus/pull/2292)

### Features

- Enabled rewards withdrawals on hardware wallets ([PR 2408](https://github.com/input-output-hk/daedalus/pull/2408))

### Fixes

- Fixed InlineEditingInput common component so that wallet name input field works well ([PR 2409](https://github.com/input-output-hk/daedalus/pull/2409))

### Chores

- Moved ITN redemption to Daedalus application menu ([PR 2401](https://github.com/input-output-hk/daedalus/pull/2401))
- Removed unnecessary "socketFile" declaration in launcher-config ([PR 2400](https://github.com/input-output-hk/daedalus/pull/2400))
- Updated delegated stake pool status on delegation center screen ([PR 2404](https://github.com/input-output-hk/daedalus/pull/2404))
- 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;
cardano-node-cluster = let
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" }
3 changes: 2 additions & 1 deletion nix/launcher-config.nix
Expand Up @@ -252,13 +252,14 @@ let
genesisFile = mkConfigPath nodeConfigFiles "genesis.json";
topologyFile = mkConfigPath nodeConfigFiles "topology.yaml";
};
socketFile = if os != "windows" then "${dataDir}${dirSep}cardano-node.socket" else "\\\\.\\pipe\\cardano-node-${network}";
} // (lib.optionalAttrs (network == "selfnode") {
delegationCertificate = mkConfigPath nodeConfigFiles "delegation.cert";
signingKey = mkConfigPath nodeConfigFiles "signing.key";
});
} // (lib.optionalAttrs (__hasAttr "smashUrl" envCfg) {
smashUrl = envCfg.smashUrl;
}) // (lib.optionalAttrs (__hasAttr "metadataUrl" envCfg) {
metadataUrl = envCfg.metadataUrl;
});

installerConfig = {
Expand Down
17 changes: 8 additions & 9 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": "b6810e8401b04b1d8a1a142f0b06b47cd6b51186",
"sha256": "0228p4jhi1cd55g9s4n2qdsvhc92bflnz5kg11ybkzfbp62ggjfi",
"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/b6810e8401b04b1d8a1a142f0b06b47cd6b51186.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"gitignore": {
"branch": "master",
Expand Down Expand Up @@ -66,10 +65,10 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "iohk-nix",
"rev": "4efc38924c64c23a582c84950c8c25f72ff049cc",
"sha256": "0nhwyrd0xc72yj5q3jqa2wl4khp4g7n72i45cxy2rgn9nrp8wqh0",
"rev": "b64b63fd56dddbe3ff070dea78977f0f15a487c2",
"sha256": "13fmxh8wykwqcywxd4vlxpqqcdxqbj07pc6qrshrk830i4akc2ib",
"type": "tarball",
"url": "https://github.com/input-output-hk/iohk-nix/archive/4efc38924c64c23a582c84950c8c25f72ff049cc.tar.gz",
"url": "https://github.com/input-output-hk/iohk-nix/archive/b64b63fd56dddbe3ff070dea78977f0f15a487c2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"js-chain-libs": {
Expand Down
10 changes: 5 additions & 5 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "3.3.0-FC1",
"version": "4.0.0-FC1",
"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.11",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"react-svg-inline": "2.1.1",
Expand All @@ -246,7 +246,7 @@
"shasum": "1.0.2",
"source-map-support": "0.5.19",
"spectron-fake-dialog": "0.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
1 change: 0 additions & 1 deletion source/common/ipc/api.js
Expand Up @@ -179,7 +179,6 @@ export type SubmitBugReportRequestMainResponse = void;
*/
export const REBUILD_APP_MENU_CHANNEL = 'REBUILD_APP_MENU_CHANNEL';
export type RebuildAppMenuRendererRequest = {
isUpdateAvailable: boolean,
isNavigationEnabled: boolean,
};
export type RebuildAppMenuMainResponse = void;
Expand Down
1 change: 1 addition & 0 deletions source/common/ipc/constants.js
Expand Up @@ -2,6 +2,7 @@
export const DIALOGS = {
ABOUT: 'ABOUT_DIALOG',
DAEDALUS_DIAGNOSTICS: 'DAEDALUS_DIAGNOSTICS_DIALOG',
ITN_REWARDS_REDEMPTION: 'ITN_REWARDS_REDEMPTION_DIALOG',
};

export const NOTIFICATIONS = {
Expand Down
15 changes: 8 additions & 7 deletions source/common/types/hardware-wallets.types.js
Expand Up @@ -175,28 +175,29 @@ export type LedgerSignTransactionRequest = {
inputs: LedgerSignTransactionInputsType,
outputs: LedgerSignTransactionOutputsType,
fee: string,
ttl: string,
ttl?: string,
networkId: number,
protocolMagic: number,
// $FlowFixMe
certificates: Array<?Certificate>, // TODO - add once certificates defined
// $FlowFixMe
withdrawals: Array<?Withdrawal>, // TODO - add once withdrawals defined
metadataHashHex: ?string, // TODO - add once metadata defined
certificates: Array<?Certificate>,
withdrawals: Array<?Withdrawal>,
metadataHashHex: ?string,
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>,
withdrawals: Array<?Withdrawal>,
reset?: boolean,
devicePath: string,
validityIntervalStartStr?: string,
};

export type LedgerSignTransactionResponse = {
Expand Down
3 changes: 3 additions & 0 deletions source/main/cardano/CardanoNode.js
Expand Up @@ -81,6 +81,7 @@ export type CardanoNodeConfig = {
syncTolerance: string,
cliBin: string, // Path to cardano-cli executable
isStaging: boolean,
metadataUrl?: string,
};

const CARDANO_UPDATE_EXIT_CODE = 20;
Expand Down Expand Up @@ -296,6 +297,7 @@ export class CardanoNode {
syncTolerance,
cliBin,
isStaging,
metadataUrl,
} = config;

this._config = config;
Expand Down Expand Up @@ -354,6 +356,7 @@ export class CardanoNode {
walletLogFile,
cliBin,
isStaging,
metadataUrl,
});

this._node = node;
Expand Down
27 changes: 25 additions & 2 deletions 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,
FALLBACK_TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_URL,
MOCK_TOKEN_METADATA_SERVER_PORT,
} from '../config';
import {
MAINNET,
STAGING,
Expand Down Expand Up @@ -38,6 +43,7 @@ export type WalletOpts = {
walletLogFile: WriteStream,
cliBin: string,
isStaging: boolean,
metadataUrl?: string,
};

export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
Expand All @@ -56,6 +62,7 @@ export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
walletLogFile,
cliBin,
isStaging,
metadataUrl,
} = walletOpts;
// TODO: Update launcher config to pass number
const syncToleranceSeconds = parseInt(syncTolerance.replace('s', ''), 10);
Expand Down Expand Up @@ -95,6 +102,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,7 +137,21 @@ export async function CardanoWalletLauncher(walletOpts: WalletOpts): Launcher {
launcherConfig.networkName = TESTNET;
logger.info('Launching Wallet with --testnet flag');
}
merge(launcherConfig, { nodeConfig, tlsConfiguration });
if (MOCK_TOKEN_METADATA_SERVER_PORT) {
tokenMetadataServer = `${MOCK_TOKEN_METADATA_SERVER_URL}:${MOCK_TOKEN_METADATA_SERVER_PORT}`;
} else if (metadataUrl) {
tokenMetadataServer = metadataUrl;
} else {
tokenMetadataServer = FALLBACK_TOKEN_METADATA_SERVER_URL;
}
logger.info('Launching Wallet with --token-metadata-server flag', {
tokenMetadataServer,
});
merge(launcherConfig, {
nodeConfig,
tlsConfiguration,
tokenMetadataServer,
});
break;
case CardanoNodeImplementationOptions.JORMUNGANDR:
if (cluster === ITN_SELFNODE) {
Expand Down
2 changes: 2 additions & 0 deletions source/main/cardano/setup.js
Expand Up @@ -49,6 +49,7 @@ const startCardanoNode = (
syncTolerance,
cliBin,
isStaging,
metadataUrl,
} = launcherConfig;
const logFilePath = `${logsPrefix}/pub/`;
const config = {
Expand All @@ -65,6 +66,7 @@ const startCardanoNode = (
syncTolerance,
cliBin,
isStaging,
metadataUrl,
startupTimeout: NODE_STARTUP_TIMEOUT,
startupMaxRetries: NODE_STARTUP_MAX_RETRIES,
shutdownTimeout: NODE_SHUTDOWN_TIMEOUT,
Expand Down

0 comments on commit 1e7bba4

Please sign in to comment.