Skip to content

Commit ef0e2b9

Browse files
Merge remote-tracking branch 'origin/develop' into feature/ddw-409-new-mnemonic-input
2 parents 82453d2 + d4c5122 commit ef0e2b9

File tree

9 files changed

+169
-41
lines changed

9 files changed

+169
-41
lines changed

CHANGELOG.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,31 @@
88

99
### Fixes
1010

11-
- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
12-
- Fixed incorrect amount of token sent ([PR 2962](https://github.com/input-output-hk/daedalus/pull/2962))
1311
- Ensured non-recommended decimal place setting alert is correctly shown ([PR 3007](https://github.com/input-output-hk/daedalus/pull/3007))
12+
- Disabled the possibility to choose a syncing wallet for ITN rewards and delegation ([PR 3015](https://github.com/input-output-hk/daedalus/pull/3015))
1413

1514
### Chores
1615

1716
- Updated cardano-node to 1.35.1 ([PR 3012](https://github.com/input-output-hk/daedalus/pull/3012))
18-
- Added Vasil-supported cardano-wallet ([PR 3001](https://github.com/input-output-hk/daedalus/pull/3001))
19-
- Upgraded webpack to version 5 ([PR 2772](https://github.com/input-output-hk/daedalus/pull/2772))
2017

2118
### Features
2219

2320
- Updated Terms of Service ([PR 3009](https://github.com/input-output-hk/daedalus/pull/3009))
2421

22+
## 4.12.0
23+
24+
### Fixes
25+
26+
- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
27+
- Fixed incorrect amount of token sent ([PR 2962](https://github.com/input-output-hk/daedalus/pull/2962))
28+
29+
### Chores
30+
31+
- Made Windows installer more resilient w.r.t. auto-updates ([PR 3017](https://github.com/input-output-hk/daedalus/pull/3017))
32+
- Added OS-architecture tuple to installer file names to help with releases ([PR 3016](https://github.com/input-output-hk/daedalus/pull/3016))
33+
- Added Vasil-supported cardano-wallet ([PR 3001](https://github.com/input-output-hk/daedalus/pull/3001))
34+
- Upgraded webpack to version 5 ([PR 2772](https://github.com/input-output-hk/daedalus/pull/2772))
35+
2536
## 4.11.0
2637

2738
### Fixes

default.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ let
3737
chmod -R +w $out
3838
cd $out
3939
patch -p1 -i ${./nix/cardano-wallet--enable-aarch64-darwin.patch}
40-
patch -p1 -i ${pkgs.fetchurl {
41-
url = "https://github.com/input-output-hk/cardano-wallet/pull/3382.patch";
40+
patch -p1 -i ${builtins.path {
41+
# XXX: unfortunately, GitHub changed lengths of hashes in patches it returns for PRs,
42+
# that’s why we’re providing this patch inside our repo, with the same exact SHA-256,
43+
# to the one released in 4.12.0:
44+
path = ./nix/cardano-wallet--pr-3382--ledger-bug.patch;
45+
recursive = false;
4246
sha256 = "1ii12g2zikv4197c7bsh4v5dc1jzygn1jap8xvnr7mvh3a09pdgn";
4347
}}
4448
'';
@@ -319,7 +323,7 @@ let
319323
signed-windows-installer = let
320324
backend_version = self.daedalus-bridge.wallet-version;
321325
frontend_version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
322-
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}.exe"; # must match to packageFileName in make-installer
326+
fullName = "daedalus-${frontend_version}-${cluster}${buildNumSuffix}-x86_64-windows.exe"; # must match to packageFileName in make-installer
323327
in pkgs.runCommand "signed-windows-installer-${cluster}" {} ''
324328
mkdir $out
325329
cp -v ${self.signFile "${self.unsigned-windows-installer}/${fullName}"} $out/${fullName}
@@ -436,7 +440,7 @@ let
436440
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
437441
backend = "cardano-wallet-${nodeImplementation}";
438442
suffix = if buildNum == null then "" else "-${toString buildNum}";
439-
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}.bin";
443+
fn = "daedalus-${version}-${self.linuxClusterBinName}${suffix}-x86_64-linux.bin";
440444
in pkgs.runCommand fn {} ''
441445
mkdir -p $out
442446
cp ${self.newBundle} $out/${fn}

installers/common/Types.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import Turtle (pwd, cd)
4242
import Turtle.Format (format, fp)
4343
import Data.Aeson (FromJSON(..), withObject, eitherDecode, (.:), genericParseJSON, defaultOptions)
4444
import qualified Data.ByteString.Lazy.Char8 as L8
45+
import qualified System.Info
4546

4647
data OS
4748
= Linux64
@@ -113,7 +114,7 @@ packageFileName :: OS -> Cluster -> Version -> Backend -> Text -> Maybe BuildJob
113114
packageFileName _os cluster ver backend _backendVer build = fromText name <.> ext
114115
where
115116
name = T.intercalate "-" parts
116-
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build'
117+
parts = ["daedalus", fromVer ver, lshowText cluster] ++ build' ++ [archOS]
117118
_backend' = case backend of
118119
Cardano _ -> "cardano-wallet"
119120
ext = case _os of
@@ -124,6 +125,13 @@ packageFileName _os cluster ver backend _backendVer build = fromText name <.> ex
124125
Win64 -> "windows"
125126
Macos64 -> "macos"
126127
Linux64 -> "linux"
128+
archOS = case _os of
129+
Win64 -> "x86_64-windows"
130+
Macos64 ->
131+
if System.Info.arch == "aarch64"
132+
then "aarch64-darwin"
133+
else "x86_64-darwin"
134+
Linux64 -> "x86_64-linux"
127135
build' = maybe [] (\b -> [fromBuildJob b]) build
128136

129137
instance FromJSON Version where

installers/common/WindowsInstaller.hs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import Development.NSIS (Attrib (IconFile, IconIndex, RebootOK, Recurs
2020
name, nsis, onPagePre, onError, outFile, page, readRegStr,
2121
requestExecutionLevel, rmdir, section, setOutPath, str,
2222
strLength, uninstall, unsafeInject, unsafeInjectGlobal,
23-
loadLanguage,
23+
loadLanguage, sleep, (@=), detailPrint, (%<), (%&&),
24+
not_, mutableInt_, mutable_, while, false, true, strShow, (&),
2425
writeRegDWORD, writeRegStr, (%/=), fileExists)
2526
import Prelude ((!!))
2627
import qualified System.IO as IO
@@ -185,9 +186,30 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
185186
createDirectory "$APPDATA\\$InstallDir\\Secrets-1.0"
186187
createDirectory "$APPDATA\\$InstallDir\\Logs"
187188
createDirectory "$APPDATA\\$InstallDir\\Logs\\pub"
188-
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $
189-
--abort "$SpacedName $(AlreadyRunning)"
190-
unsafeInject $ T.unpack $ "Abort \" " <> installDirectory <> "$(AlreadyRunning)\""
189+
190+
-- XXX: sometimes during auto-update, it takes longer for Daedalus to exit,
191+
-- and cardano-launcher.exe’s lockfile to be unlocked (deletable), so
192+
-- let’s loop waiting for this to happen:
193+
let waitSeconds = 30
194+
lockfileCounter <- mutableInt_ 0
195+
lockfileDeleted <- mutable_ false
196+
while ((lockfileCounter %< waitSeconds) %&& (not_ lockfileDeleted)) $ do
197+
detailPrint (
198+
"Checking if Daedalus is not running ("
199+
Development.NSIS.& strShow (lockfileCounter + 1)
200+
Development.NSIS.& "/"
201+
Development.NSIS.& strShow waitSeconds
202+
Development.NSIS.& ")..."
203+
)
204+
lockfileDeleted @= true
205+
onError (delete [] "$APPDATA\\$InstallDir\\daedalus_lockfile") $ do
206+
lockfileDeleted @= false
207+
iff_ (not_ lockfileDeleted) $ do
208+
sleep 1000 -- milliseconds
209+
lockfileCounter @= lockfileCounter + 1
210+
iff_ (not_ (lockfileDeleted)) $ do
211+
unsafeInject $ T.unpack $ "Abort \"" <> installDirectory <> " $(AlreadyRunning)\""
212+
191213
iff_ (fileExists "$APPDATA\\$InstallDir\\Wallet-1.0\\open\\*.*") $
192214
rmdir [] "$APPDATA\\$InstallDir\\Wallet-1.0\\open"
193215
case oBackend of
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From 3f0186bdc9231b0bc3523294d4b6ead52b0e1419 Mon Sep 17 00:00:00 2001
2+
From: Samuel Evans-Powell <[email protected]>
3+
Date: Mon, 11 Jul 2022 10:14:31 +0800
4+
Subject: [PATCH 1/2] Bump to cardano-node 1.35.1
5+
6+
---
7+
cabal.project | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/cabal.project b/cabal.project
11+
index 40f1ec8899..9eb3a27fd4 100644
12+
--- a/cabal.project
13+
+++ b/cabal.project
14+
@@ -213,8 +213,8 @@ source-repository-package
15+
source-repository-package
16+
type: git
17+
location: https://github.com/input-output-hk/cardano-node
18+
- tag: 9f1d7dc163ee66410d912e48509d6a2300cfa68a
19+
- --sha256: 06arx9hv7dn3qxfy83f0b6018rxbsvh841nvfyg5w6qclm1hddj7
20+
+ tag: c75451f0ffd7a60b5ad6c4263891e6c8acac105a
21+
+ --sha256: 1z0zv1i58ikmbqg878f9z573jkwp4lzhmmswshm6c96rq6lprzh8
22+
subdir:
23+
cardano-api
24+
cardano-git-rev
25+
26+
From a4d31a3e3d4dbd3b713dff5d911edd3869a3b343 Mon Sep 17 00:00:00 2001
27+
From: Samuel Evans-Powell <[email protected]>
28+
Date: Mon, 11 Jul 2022 10:21:02 +0800
29+
Subject: [PATCH 2/2] Bump version of cardano-node in compatibility matrix
30+
31+
---
32+
README.md | 2 +-
33+
cabal.project | 4 ++--
34+
2 files changed, 3 insertions(+), 3 deletions(-)
35+
36+
diff --git a/README.md b/README.md
37+
index d10239eec3..b0c8c7ceec 100644
38+
--- a/README.md
39+
+++ b/README.md
40+
@@ -73,7 +73,7 @@ See **Installation Instructions** for each available [release](https://github.co
41+
>
42+
> | cardano-wallet | cardano-node (compatible versions) | SMASH (compatible versions)
43+
> | --- | --- | ---
44+
-> | `master` branch | [1.35.0](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.0) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
45+
+> | `master` branch | [1.35.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
46+
> | [v2022-07-01](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-07-01) | [1.35.0](https://github.com/input-output-hk/cardano-node/releases/tag/1.35.0) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
47+
> | [v2022-05-27](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-05-27) | [1.34.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.34.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
48+
> | [v2022-04-27](https://github.com/input-output-hk/cardano-wallet/releases/tag/v2022-04-27) | [1.34.1](https://github.com/input-output-hk/cardano-node/releases/tag/1.34.1) | [1.6.1](https://github.com/input-output-hk/smash/releases/tag/1.6.1)
49+
diff --git a/cabal.project b/cabal.project
50+
index 9eb3a27fd4..c83a3e282c 100644
51+
--- a/cabal.project
52+
+++ b/cabal.project
53+
@@ -183,8 +183,8 @@ source-repository-package
54+
source-repository-package
55+
type: git
56+
location: https://github.com/input-output-hk/cardano-ledger
57+
- tag: ce3057e0863304ccb3f79d78c77136219dc786c6
58+
- --sha256: 19ijcy1sl1iqa7diy5nsydnjsn3281kp75i2i42qv0fpn58238s9
59+
+ tag: 3be8a19083fc13d9261b1640e27dd389b51bb08e
60+
+ --sha256: 0dvm9l43mp1i34bcywmznd0660hhcfxwgawypk9q1hjkml1i41z3
61+
subdir:
62+
eras/alonzo/impl
63+
eras/alonzo/test-suite

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "daedalus",
33
"productName": "Daedalus",
4-
"version": "4.11.0",
4+
"version": "4.12.0",
55
"description": "Cryptocurrency Wallet",
66
"main": "./dist/main/index.js",
77
"scripts": {

source/main/trezor/connection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const initTrezorConnect = async () => {
1414
logger.info('[TREZOR-CONNECT] Called TrezorConnect.init()');
1515
} catch (error) {
1616
logger.info('[TREZOR-CONNECT] Failed to call TrezorConnect.init()');
17-
throw error;
1817
}
1918
};
2019

source/renderer/app/components/staking/delegation-setup-wizard/DelegationStepsChooseWalletDialog.tsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import DialogBackButton from '../../widgets/DialogBackButton';
1616
import Dialog from '../../widgets/Dialog';
1717
import WalletsDropdown from '../../widgets/forms/WalletsDropdown';
1818
import Wallet from '../../../domains/Wallet';
19+
import LocalizableError from '../../../i18n/LocalizableError';
1920

2021
const messages = defineMessages({
2122
title: {
@@ -116,6 +117,30 @@ export default class DelegationStepsChooseWalletDialog extends Component<
116117
this.props.onSelectWallet(selectedWalletId);
117118
};
118119

120+
getErrorMessage = (wallet?: Wallet): LocalizableError | null => {
121+
if (!wallet) {
122+
return null;
123+
}
124+
125+
const { amount, reward, isRestoring } = wallet;
126+
127+
if (isRestoring) {
128+
return messages.errorRestoringWallet;
129+
}
130+
131+
if (!this.props.isWalletAcceptable(amount, reward)) {
132+
// Wallet only has Reward balance
133+
if (!amount.isZero() && amount.isEqualTo(reward)) {
134+
return messages.errorMinDelegationFundsRewardsOnly;
135+
}
136+
137+
// Wallet balance < min delegation funds
138+
return messages.errorMinDelegationFunds;
139+
}
140+
141+
return null;
142+
};
143+
119144
render() {
120145
const { intl } = this.context;
121146
const { selectedWalletId } = this.state;
@@ -125,25 +150,13 @@ export default class DelegationStepsChooseWalletDialog extends Component<
125150
minDelegationFunds,
126151
onClose,
127152
onBack,
128-
isWalletAcceptable,
129153
numberOfStakePools,
130154
getStakePoolById,
131155
} = this.props;
132156
const selectedWallet: Wallet | null | undefined = wallets.find(
133157
(wallet: Wallet) => wallet && wallet.id === selectedWalletId
134158
);
135-
const { amount, reward, isRestoring } = selectedWallet || {};
136-
let errorMessage;
137-
138-
if (selectedWallet && !isWalletAcceptable(amount, reward)) {
139-
// Wallet is restoring
140-
if (isRestoring) errorMessage = messages.errorRestoringWallet;
141-
// Wallet only has Reward balance
142-
else if (!amount.isZero() && amount.isEqualTo(reward))
143-
errorMessage = messages.errorMinDelegationFundsRewardsOnly;
144-
// Wallet balance < min delegation funds
145-
else errorMessage = messages.errorMinDelegationFunds;
146-
}
159+
const errorMessage = this.getErrorMessage(selectedWallet);
147160

148161
const error = errorMessage && (
149162
<p className={styles.errorMessage}>

source/renderer/app/containers/staking/dialogs/redeem-itn-rewards/Step1ConfigurationContainer.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import validWords from '../../../../../../common/config/crypto/valid-words.en';
1010
import { isValidMnemonic } from '../../../../../../common/config/crypto/decrypt';
1111
import { MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE } from '../../../../config/stakingConfig';
1212
import Wallet from '../../../../domains/Wallet';
13+
import LocalizableError from '../../../../i18n/LocalizableError';
1314

1415
type Props = InjectedDialogContainerStepProps;
1516
const DefaultProps = InjectedDialogContainerStepDefaultProps;
@@ -34,15 +35,32 @@ const messages = defineMessages({
3435
@observer
3536
class Step1ConfigurationContainer extends Component<Props> {
3637
static defaultProps = DefaultProps;
37-
onWalletAcceptable = (walletAmount?: BigNumber) => {
38+
hasEnoughAdaToCoverFees = (walletAmount?: BigNumber) => {
3839
const minRewardsFunds = new BigNumber(
3940
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE
4041
);
4142
return walletAmount && walletAmount.gte(minRewardsFunds);
4243
};
4344

45+
getErrorMessage = (wallet?: Wallet): LocalizableError | null => {
46+
if (!wallet) {
47+
return null;
48+
}
49+
50+
const { amount, isRestoring } = wallet;
51+
52+
if (isRestoring) {
53+
return messages.errorRestoringWallet;
54+
}
55+
if (!this.hasEnoughAdaToCoverFees(amount)) {
56+
return messages.errorMinRewardFunds;
57+
}
58+
59+
return null;
60+
};
61+
4462
render() {
45-
const { actions, stores, onBack, onClose } = this.props;
63+
const { actions, stores, onClose } = this.props;
4664
const { app, staking, wallets } = stores;
4765
const { allWallets } = wallets;
4866
const {
@@ -59,23 +77,13 @@ class Step1ConfigurationContainer extends Component<Props> {
5977
const selectedWallet: Wallet | null | undefined = allWallets.find(
6078
(current: Wallet) => current && current.id === selectedWalletId
6179
);
62-
const { amount, isRestoring } = selectedWallet || {};
63-
let errorMessage = null;
64-
65-
if (selectedWallet && !this.onWalletAcceptable(amount)) {
66-
// Wallet is restoring
67-
if (isRestoring) errorMessage = messages.errorRestoringWallet;
68-
// Wallet balance < min rewards redemption funds
69-
else errorMessage = messages.errorMinRewardFunds;
70-
}
80+
const errorMessage = this.getErrorMessage(selectedWallet);
7181

7282
return (
7383
<Step1ConfigurationDialog
7484
error={errorMessage}
7585
isCalculatingReedemFees={isCalculatingReedemFees}
7686
mnemonicValidator={isValidMnemonic}
77-
// @ts-ignore ts-migrate(2769) FIXME: No overload matches this call.
78-
onBack={onBack}
7987
onClose={onClose}
8088
onContinue={onConfigurationContinue.trigger}
8189
onSelectWallet={(walletId, recoveryPhrase) =>

0 commit comments

Comments
 (0)