Skip to content

Commit 3bf2ff9

Browse files
[DDW-779] Merges-in latest develop branch and fix conflicts
2 parents 870b875 + 98c6fd4 commit 3bf2ff9

File tree

13 files changed

+1122
-514
lines changed

13 files changed

+1122
-514
lines changed

.babelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"plugins": [
88
["@babel/plugin-proposal-decorators", { "legacy": true }],
99
["@babel/plugin-proposal-class-properties", { "loose": true }],
10+
["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
1011
[
1112
"@babel/plugin-proposal-private-methods",
1213
{

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@babel/eslint-parser",
33
"parserOptions": {
44
"ecmaFeatures": {
55
"legacyDecorators": true

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
## vNext
44

5+
### Fixes
6+
7+
- Fixed receiver address validation by disallowing rewards addresses ([PR 2781](https://github.com/input-output-hk/daedalus/pull/2781))
8+
59
### Chores
610

711
- Updated `trezor-connect` dependency to version `8.2.4` ([PR 2726](https://github.com/input-output-hk/daedalus/pull/2726))
12+
- Updated vulnerable dependencies ([PR 2769](https://github.com/input-output-hk/daedalus/pull/2769))
813

914
## 4.6.0
1015

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,25 @@ Daedalus - Cryptocurrency Wallet
2626
```
2727
and then add the following lines:
2828
```
29+
build-users-group = nixbld
30+
31+
max-jobs = auto
32+
cores = 0
33+
sandbox = false
34+
35+
require-sigs = true
36+
trusted-users = root
37+
allowed-users = *
38+
2939
substituters = https://hydra.iohk.io https://cache.nixos.org/
3040
trusted-substituters =
3141
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
32-
max-jobs = 2 # run at most two builds at once
33-
cores = 0 # the builder will use all available CPU cores
34-
extra-sandbox-paths = /System/Library/Frameworks
42+
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib
43+
44+
# If you are running on a Mac with M1 chip please uncomment 'system' setting to enforce running on Rosetta2
45+
# system = x86_64-darwin
3546
```
47+
3648
3. Run `nix-shell` with correct list of arguments or by using existing `package.json` scripts to load a shell with all the correct versions of all the required dependencies for development.
3749

3850
**Notes:**

installers/nix/electron.nix

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
libxkbcommon }:
33

44
let
5-
version = "13.1.1";
5+
version = "13.6.3";
66
name = "electron-${version}";
77

88
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
@@ -21,19 +21,19 @@ let
2121
src = {
2222
i686-linux = fetchurl {
2323
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-ia32.zip";
24-
sha256 = "fed00edaaba0c4a615fe835baf7d0d0ff893dff902800006bf63cc994c24d3dd";
24+
sha256 = "db9261c05ed57af2fcd4a84b89d299c76948b9d57ce0dba38e3240eb43935257";
2525
};
2626
x86_64-linux = fetchurl {
2727
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-x64.zip";
28-
sha256 = "eb6ae81d71a4d390ec5140d907b191a84c37621176eec9369bb6fc3bf8570e3b";
28+
sha256 = "7607422a4ba80cda4bd7fefb2fbe2f4e0b9a73db92e1e82dc01012a85b5d0d2b";
2929
};
3030
armv7l-linux = fetchurl {
3131
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-armv7l.zip";
32-
sha256 = "7e745a38c6761fa9826b3b9b8d0bd060126a3949da6f3f09f11b842e5e22cee4";
32+
sha256 = "a293a9684e16a427a9f68d101814575a4b1dd232dc3fca47552f906019a6cadc";
3333
};
3434
aarch64-linux = fetchurl {
3535
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-arm64.zip";
36-
sha256 = "445c88e9c9b33abbdb263103736fb5203938b0643bc5377fbdf12b444d26f211";
36+
sha256 = "1599d259832c806b98751a68fb93112711963d259024f0e36f12f064995b3251";
3737
};
3838
}.${stdenv.hostPlatform.system} or throwSystem;
3939

@@ -59,11 +59,11 @@ let
5959
src = {
6060
x86_64-darwin = fetchurl {
6161
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-x64.zip";
62-
sha256 = "1594ba9aa2e2aa059a03e6b70e16b8116de1998b38f8360801e113fa8d72938c";
62+
sha256 = "6bf09794d6f020bbaaf806a7758da125137b3c96646f4503eb81b9541e50e02f";
6363
};
6464
aarch64-darwin = fetchurl {
6565
url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-darwin-arm64.zip";
66-
sha256 = "7045538917c36214127b7f11a3223396c7199ac19e989e5648a0963773962e6c";
66+
sha256 = "374ddf0581794b31eee900828172f9218193c032c0e46bffcfac6aec95c22f1a";
6767
};
6868
}.${stdenv.hostPlatform.system} or throwSystem;
6969

nix/sources.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"homepage": null,
3030
"owner": "input-output-hk",
3131
"repo": "cardano-wallet",
32-
"rev": "dac16ba7e3bf64bf5474497656932fd342c3b720",
33-
"sha256": "012lnp5rah4qyl8r0v04d0rz28b1rdaz6flhjrahf45b9gx7mny1",
32+
"rev": "760140e238a5fbca61d1b286d7a80ece058dc729",
33+
"sha256": "014njpddrlqm9bbab636h2gf58zkm0bx04i1jsn07vh5j3k0gri6",
3434
"type": "tarball",
35-
"url": "https://github.com/input-output-hk/cardano-wallet/archive/dac16ba7e3bf64bf5474497656932fd342c3b720.tar.gz",
35+
"url": "https://github.com/input-output-hk/cardano-wallet/archive/760140e238a5fbca61d1b286d7a80ece058dc729.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
3838
"gitignore": {

package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@
6868
"electron": "./node_modules/.bin/electron"
6969
},
7070
"devDependencies": {
71-
"@babel/cli": "7.2.0",
72-
"@babel/core": "7.4.5",
73-
"@babel/helper-create-regexp-features-plugin": "7.7.0",
71+
"@babel/cli": "7.16.0",
72+
"@babel/core": "7.16.0",
73+
"@babel/eslint-parser": "7.16.3",
74+
"@babel/helper-create-regexp-features-plugin": "7.16.0",
7475
"@babel/plugin-proposal-class-properties": "7.2.1",
75-
"@babel/plugin-proposal-decorators": "7.2.0",
76+
"@babel/plugin-proposal-decorators": "7.16.4",
7677
"@babel/plugin-proposal-object-rest-spread": "7.2.0",
7778
"@babel/plugin-transform-runtime": "7.2.0",
7879
"@babel/polyfill": "7.0.0",
79-
"@babel/preset-env": "7.2.0",
80-
"@babel/preset-flow": "7.8.3",
80+
"@babel/preset-env": "7.16.4",
81+
"@babel/preset-flow": "7.16.0",
8182
"@babel/preset-react": "7.0.0",
8283
"@babel/register": "7.0.0",
8384
"@dump247/storybook-state": "1.6.1",
@@ -91,25 +92,24 @@
9192
"@testing-library/react": "12.1.2",
9293
"asar": "2.1.0",
9394
"autodll-webpack-plugin": "0.4.2",
94-
"axios": "0.21.1",
95-
"babel-eslint": "10.1.0",
95+
"axios": "0.24.0",
9696
"babel-loader": "8.0.4",
9797
"babel-plugin-react-intl": "3.0.1",
9898
"bufferutil": "4.0.1",
9999
"cache-loader": "4.1.0",
100-
"chai": "4.2.0",
100+
"chai": "4.3.4",
101101
"chalk": "4.1.0",
102102
"concurrently": "5.3.0",
103103
"cross-env": "7.0.2",
104104
"css-loader": "2.0.1",
105105
"cucumber": "6.0.5",
106106
"cucumber-pretty": "6.0.0",
107107
"del": "6.0.0",
108-
"electron-chromedriver": "13.0.0",
108+
"electron-chromedriver": "16.0.0",
109109
"electron-connect": "0.6.3",
110110
"electron-devtools-installer": "3.2.0",
111-
"electron-packager": "15.2.0",
112-
"electron-rebuild": "1.11.0",
111+
"electron-packager": "15.4.0",
112+
"electron-rebuild": "2.0.1",
113113
"eslint": "7.10.0",
114114
"eslint-config-airbnb": "18.2.0",
115115
"eslint-config-prettier": "6.12.0",
@@ -134,19 +134,19 @@
134134
"husky": "4.3.0",
135135
"identity-obj-proxy": "3.0.0",
136136
"jest": "26.6.3",
137-
"jest-css-modules-transform": "^4.3.0",
137+
"jest-css-modules-transform": "4.3.0",
138138
"jest-environment-jsdom": "26.6.2",
139-
"jest-svg-transformer": "^1.0.0",
139+
"jest-svg-transformer": "1.0.0",
140140
"markdown-loader": "5.1.0",
141-
"mini-css-extract-plugin": "0.9.0",
141+
"mini-css-extract-plugin": "0.12.0",
142142
"minimist": "1.2.5",
143143
"mobx-react-devtools": "6.1.1",
144144
"node-forge": "0.10.0",
145145
"node-libs-browser": "2.2.1",
146146
"node-sass": "4.14.1",
147147
"nodemon": "2.0.4",
148148
"npmlog": "4.1.2",
149-
"postcss": "7.0.27",
149+
"postcss": "7.0.39",
150150
"postcss-modules": "1.5.0",
151151
"prettier": "2.1.2",
152152
"pretty-quick": "3.0.2",
@@ -155,7 +155,6 @@
155155
"react-intl-translations-manager": "5.0.3",
156156
"react-syntax-highlighter": "13.5.3",
157157
"regenerator-runtime": "0.13.7",
158-
"resolve-url": "0.2.1",
159158
"sass-loader": "7.1.0",
160159
"sinon": "9.2.2",
161160
"spawn-sync": "2.0.0",
@@ -196,11 +195,11 @@
196195
"classnames": "2.2.6",
197196
"csv-stringify": "5.5.1",
198197
"cucumber-html-reporter": "5.2.0",
199-
"electron": "13.1.1",
198+
"electron": "13.6.3",
200199
"electron-log-daedalus": "2.2.21",
201-
"electron-store": "8.0.0",
200+
"electron-store": "8.0.1",
202201
"es6-error": "4.1.1",
203-
"find-process": "1.4.4",
202+
"find-process": "1.4.7",
204203
"fireworks-js": "1.0.4",
205204
"form-data": "3.0.0",
206205
"fs-extra": "9.0.1",
@@ -214,7 +213,7 @@
214213
"lodash": "4.17.21",
215214
"lodash-es": "4.17.15",
216215
"mime-types": "2.1.27",
217-
"mkdirp": "0.5.1",
216+
"mkdirp": "0.5.5",
218217
"mobx": "5.15.7",
219218
"mobx-react": "6.3.0",
220219
"mobx-react-form": "2.0.8",
@@ -256,7 +255,7 @@
256255
"tcp-port-used": "1.0.1",
257256
"trezor-connect": "8.2.4-extended",
258257
"unorm": "1.6.0",
259-
"validator": "13.1.17"
258+
"validator": "13.7.0"
260259
},
261260
"devEngines": {
262261
"node": ">=14.17.0",

source/common/types/address-introspection.types.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export type IntrospectAddressRequest = {
44
input: string,
55
};
66

7-
export type AddressStyle = 'Byron' | 'Icarus' | 'Jormungandr' | 'Shelley';
7+
export type AddressStyle = 'Byron' | 'Icarus' | 'Shelley';
8+
9+
export type AddressType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15;
810

911
export type ChainPointer = {
1012
slot_num: number,
@@ -13,6 +15,7 @@ export type ChainPointer = {
1315
};
1416

1517
export type AddressBase = {
18+
address_type: AddressType,
1619
address_style: AddressStyle,
1720
network_tag: number | null,
1821
stake_reference: 'none' | 'by pointer' | 'by value',
@@ -27,14 +30,6 @@ export type IcarusAddress = AddressBase & {
2730
address_root: string,
2831
};
2932

30-
export type JormungandrAddress = AddressBase & {
31-
address_type: 'single' | 'group' | 'account' | 'multisig',
32-
account_key?: string,
33-
merkle_root?: string,
34-
spending_key?: string,
35-
stake_key?: string,
36-
};
37-
3833
export type ShelleyAddress = AddressBase & {
3934
pointer?: ChainPointer,
4035
script_hash?: string,
@@ -45,10 +40,6 @@ export type ShelleyAddress = AddressBase & {
4540

4641
export type IntrospectAddressResponse =
4742
| {
48-
introspection:
49-
| ByronAddress
50-
| IcarusAddress
51-
| JormungandrAddress
52-
| ShelleyAddress,
43+
introspection: ByronAddress | IcarusAddress | ShelleyAddress,
5344
}
5445
| 'Invalid';

source/renderer/app/stores/WalletsStore.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ import { logger } from '../utils/logging';
1818
import { ROUTES } from '../routes-config';
1919
import { formattedWalletAmount } from '../utils/formatters';
2020
import { ellipsis } from '../utils/strings';
21-
import { bech32EncodePublicKey } from '../utils/hardwareWalletUtils';
21+
import {
22+
bech32EncodePublicKey,
23+
isReceiverAddressType,
24+
} from '../utils/hardwareWalletUtils';
2225
import {
2326
WalletPaperWalletOpenPdfError,
2427
WalletRewardsOpenCsvError,
@@ -1039,9 +1042,14 @@ export default class WalletsStore extends Store {
10391042
}
10401043
try {
10411044
const response = await introspectAddressChannel.send({ input: address });
1042-
if (response === 'Invalid') {
1045+
1046+
if (
1047+
response === 'Invalid' ||
1048+
!isReceiverAddressType(response.introspection.address_type)
1049+
) {
10431050
return false;
10441051
}
1052+
10451053
runInAction('check if address is from the same wallet', () => {
10461054
const walletAddresses = this.stores.addresses.all
10471055
.slice()

source/renderer/app/utils/hardwareWalletUtils.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { HARDENED } from '../config/hardwareWalletsConfig';
66

77
// Types
88
import type { CoinSelectionAssetsType } from '../api/transactions/types';
9+
import type { AddressType } from '../../../common/types/address-introspection.types';
910

1011
export type PathRoleIdentityType =
1112
| 'utxo_external'
@@ -38,6 +39,21 @@ export const KEY_PREFIXES = {
3839

3940
// Helpers
4041

42+
const receiverAddressTypes: Set<AddressType> = new Set([
43+
0,
44+
1,
45+
2,
46+
3,
47+
4,
48+
5,
49+
6,
50+
7,
51+
8,
52+
]);
53+
54+
export const isReceiverAddressType = (addressType: AddressType) =>
55+
receiverAddressTypes.has(addressType);
56+
4157
// [1852H, 1815H, 0H] => m/1852'/1815'/0'
4258
export const derivationPathToString = (derivationPath: Array<string>) => {
4359
let constructedPath = 'm';

0 commit comments

Comments
 (0)