Skip to content

Commit 3df2fbf

Browse files
authored
Merge pull request #2951 from input-output-hk/flake-compat
2 parents c9c3ef7 + 6aaa488 commit 3df2fbf

File tree

12 files changed

+67
-63
lines changed

12 files changed

+67
-63
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
### Chores
3535

36+
- Updated cardano-wallet to v2022-04-27 and cardano-node to 1.34.1 ([PR 2951](https://github.com/input-output-hk/daedalus/pull/2951))
3637
- Refactor to remove duplicated code ([PR 2956](https://github.com/input-output-hk/daedalus/pull/2956))
3738
- Updated cardano-launcher to 0.20220119.0 ([PR 2839](https://github.com/input-output-hk/daedalus/pull/2839))
3839
- Added `storybook:build` check to pre-push hook ([PR 2955](https://github.com/input-output-hk/daedalus/pull/2955))

default.nix

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ let
3131
};
3232
};
3333
pkgs = import sources.nixpkgs { inherit system config; };
34-
pkgsNative = localLib.iohkNix.getPkgsDefault {};
3534
sources = localLib.sources;
35+
flake-compat = import sources.flake-compat;
36+
walletFlake = flake-compat { src = sources.cardano-wallet; };
37+
walletPackages = with walletFlake.defaultNix.hydraJobs; {
38+
x86_64-windows = linux.windows;
39+
x86_64-linux = linux.native;
40+
x86_64-darwin = macos.intel;
41+
aarch64-darwin = macos.silicon;
42+
}.${target};
3643
walletPkgs = import "${sources.cardano-wallet}/nix" {};
3744
# only used for CLI, to be removed when upgraded to next node version
3845
nodePkgs = import "${sources.cardano-node}/nix" {};
@@ -73,15 +80,11 @@ let
7380

7481
sources = localLib.sources;
7582
bridgeTable = {
76-
cardano = self.callPackage ./nix/cardano-bridge.nix {
77-
cardano-wallet = self.cardano-wallet.cardano-wallet;
78-
cardanoWalletPkgs = self.cardano-wallet.pkgs;
79-
};
83+
cardano = self.callPackage ./nix/cardano-bridge.nix {};
8084
};
81-
cardano-wallet = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; };
82-
cardano-wallet-native = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; };
83-
cardano-address = (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).cardano-address;
84-
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;
85+
inherit (walletPackages) cardano-wallet;
86+
inherit (walletPackages) cardano-address;
87+
inherit (walletPackages) mock-token-metadata-server;
8588
cardano-shell = import self.sources.cardano-shell { inherit system; crossSystem = crossSystem shellPkgs.lib; };
8689
local-cluster = if cluster == "selfnode" then (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).local-cluster else null;
8790
cardano-node-cluster = let
@@ -99,10 +102,10 @@ let
99102
in (import self.sources.cardano-node { inherit system customConfig; crossSystem = crossSystem nodePkgs.lib; }).cluster;
100103
cardano-node = if useLocalNode
101104
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).cardano-node
102-
else self.cardano-wallet.cardano-node;
105+
else walletPackages.cardano-node;
103106
cardano-cli = if useLocalNode
104107
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).haskellPackages.cardano-cli
105-
else self.cardano-wallet.cardano-cli;
108+
else walletPackages.cardano-cli;
106109
darwin-launcher = self.callPackage ./nix/darwin-launcher.nix {};
107110

108111
# a cross-compiled fastlist for the ps-list package
@@ -123,7 +126,6 @@ let
123126
network = cluster;
124127
os = ostable.${target};
125128
backend = nodeImplementation;
126-
runCommandNative = pkgsNative.runCommand;
127129
};
128130

129131
unsignedUnpackedCardano = self.daedalus-bridge; # TODO

installers/common/WindowsInstaller.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
208208
file [] "delegation.cert"
209209
file [] "cardano-launcher.exe"
210210
file [] "libffi-7.dll"
211+
file [] "libffi-8.dll"
211212
file [] "libgmp-10.dll"
212213
--file [] "cardano-x509-certificates.exe"
213214
--file [] "log-config-prod.yaml"

nix/cardano-bridge.nix

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
{ target, cardanoWalletPkgs, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null }:
1+
{ target, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null }:
22

3-
let
4-
commonLib = import ../lib.nix {};
5-
pkgsCross = import cardanoWalletPkgs.path { crossSystem = cardanoWalletPkgs.lib.systems.examples.mingwW64; config = {}; overlays = []; };
6-
in runCommandCC "daedalus-cardano-bridge" {
3+
runCommandCC "daedalus-cardano-bridge" {
74
passthru = {
85
node-version = cardano-node.passthru.identifier.version;
96
wallet-version = cardano-wallet.version;
@@ -14,7 +11,7 @@ in runCommandCC "daedalus-cardano-bridge" {
1411
echo ${cardano-wallet.version} > $out/version
1512
cp ${cardano-wallet}/bin/* .
1613
cp -f ${cardano-address}/bin/cardano-address* .
17-
cp -f ${cardano-shell.haskellPackages.cardano-launcher.components.exes.cardano-launcher}/bin/cardano-launcher* .
14+
cp -f ${cardano-shell.haskellPackages.cardano-launcher.components.exes.cardano-launcher}/bin/* .
1815
cp -f ${cardano-node}/bin/cardano-node* .
1916
cp -f ${cardano-cli}/bin/cardano-cli* .
2017
${lib.optionalString (local-cluster != null) "cp -f ${local-cluster}/bin/local-cluster* ."}

nix/launcher-config.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
, runCommand
66
, lib
77
, devShell ? false
8-
, cardano-wallet-native
9-
, runCommandNative
108
, topologyOverride ? null
119
, configOverride ? null
1210
, genesisOverride ? null

nix/sources.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"cardano-node": {
3-
"branch": "tags/1.33.0",
3+
"branch": "tags/1.34.1",
44
"description": null,
55
"homepage": null,
66
"owner": "input-output-hk",
77
"repo": "cardano-node",
8-
"rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d",
9-
"sha256": "1hr00wqzmcyc3x0kp2hyw78rfmimf6z4zd4vv85b9zv3nqbjgrik",
8+
"rev": "73f9a746362695dc2cb63ba757fbcabb81733d23",
9+
"sha256": "1hh53whcj5y9kw4qpkiza7rmkniz18r493vv4dzl1a8r5fy3b2bv",
1010
"type": "tarball",
11-
"url": "https://github.com/input-output-hk/cardano-node/archive/814df2c146f5d56f8c35a681fe75e85b905aed5d.tar.gz",
11+
"url": "https://github.com/input-output-hk/cardano-node/archive/73f9a746362695dc2cb63ba757fbcabb81733d23.tar.gz",
1212
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313
},
1414
"cardano-shell": {
@@ -24,15 +24,27 @@
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
},
2626
"cardano-wallet": {
27-
"branch": "master",
27+
"branch": "v2022-04-27",
2828
"description": "Official Wallet Backend & API for Cardano decentralized",
2929
"homepage": null,
3030
"owner": "input-output-hk",
3131
"repo": "cardano-wallet",
32-
"rev": "a5085acbd2670c24251cf8d76a4e83c77a2679ba",
33-
"sha256": "1apzfy7qdgf6l0lb3icqz3rvaq2w3a53xq6wvhqnbfi8i7cacy03",
32+
"rev": "3ee8ca721f3704b34e29194ae25c6cbcb50ff506",
33+
"sha256": "19xz4ngck1xbvq0577yrjhbvlp8ssfx2q71l8zr10132fx9li9jd",
34+
"type": "tarball",
35+
"url": "https://github.com/input-output-hk/cardano-wallet/archive/3ee8ca721f3704b34e29194ae25c6cbcb50ff506.tar.gz",
36+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
37+
},
38+
"flake-compat": {
39+
"branch": "fixes",
40+
"description": null,
41+
"homepage": null,
42+
"owner": "input-output-hk",
43+
"repo": "flake-compat",
44+
"rev": "7da118186435255a30b5ffeabba9629c344c0bec",
45+
"sha256": "01iwymbnyadqj1xfl0xhk8582v7k9b2m6s6yxp3r805w4g3h1k62",
3446
"type": "tarball",
35-
"url": "https://github.com/input-output-hk/cardano-wallet/archive/a5085acbd2670c24251cf8d76a4e83c77a2679ba.tar.gz",
47+
"url": "https://github.com/input-output-hk/flake-compat/archive/7da118186435255a30b5ffeabba9629c344c0bec.tar.gz",
3648
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3749
},
3850
"gitignore": {

source/main/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const isDevelopment = checkIsDevelopment(NETWORK);
4545
const isWatchMode = process.env.IS_WATCH_MODE;
4646
const keepLocalClusterRunning = process.env.KEEP_LOCAL_CLUSTER_RUNNING;
4747
const API_VERSION = process.env.API_VERSION || 'dev';
48-
const NODE_VERSION = '1.33.0'; // TODO: pick up this value from process.env
48+
const NODE_VERSION = '1.34.1'; // TODO: pick up this value from process.env
4949

5050
const mainProcessID = get(process, 'ppid', '-');
5151
const rendererProcessID = process.pid;

source/renderer/app/api/api.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ export default class AdaApi {
863863
address,
864864
amount: {
865865
quantity: amount,
866-
unit: WalletUnits.LOVELACE,
866+
unit: WalletUnits.LOVELACE as const,
867867
},
868868
assets,
869869
},
@@ -941,7 +941,7 @@ export default class AdaApi {
941941
address,
942942
amount: {
943943
quantity: amount,
944-
unit: WalletUnits.LOVELACE,
944+
unit: WalletUnits.LOVELACE as const,
945945
},
946946
},
947947
],
@@ -1014,7 +1014,7 @@ export default class AdaApi {
10141014
address,
10151015
amount: {
10161016
quantity: amount,
1017-
unit: WalletUnits.LOVELACE,
1017+
unit: WalletUnits.LOVELACE as const,
10181018
},
10191019
assets,
10201020
},
@@ -1143,7 +1143,7 @@ export default class AdaApi {
11431143
address: payments.address,
11441144
amount: {
11451145
quantity: payments.amount,
1146-
unit: WalletUnits.LOVELACE,
1146+
unit: WalletUnits.LOVELACE as const,
11471147
},
11481148
assets: payments.assets,
11491149
},
@@ -1223,13 +1223,14 @@ export default class AdaApi {
12231223
derivationPath: withdrawal.derivation_path,
12241224
amount: withdrawal.amount,
12251225
}));
1226-
const depositsArray = map(response.deposits, (deposit) =>
1226+
const depositsArray = map(response.deposits_taken, (deposit) =>
12271227
deposit.quantity.toString()
12281228
);
12291229
const deposits = depositsArray.length
12301230
? BigNumber.sum.apply(null, depositsArray)
12311231
: new BigNumber(0);
1232-
// @TODO - Use api response when api is ready
1232+
// @TODO - Use API response
1233+
// https://bump.sh/doc/cardano-wallet-diff/changes/c11ebb1b-39c1-40b6-96b9-610705c62cb8#operation-selectcoins-200-deposits_returned
12331234
const depositsReclaimed =
12341235
delegation && delegation.delegationAction === DELEGATION_ACTIONS.QUIT
12351236
? new BigNumber(DELEGATION_DEPOSIT).multipliedBy(LOVELACES_PER_ADA)
@@ -2311,7 +2312,7 @@ export default class AdaApi {
23112312
address,
23122313
amount: {
23132314
quantity: amount,
2314-
unit: WalletUnits.LOVELACE,
2315+
unit: WalletUnits.LOVELACE as const,
23152316
},
23162317
},
23172318
],
@@ -2841,7 +2842,7 @@ export default class AdaApi {
28412842
address,
28422843
amount: {
28432844
quantity: amount,
2844-
unit: WalletUnits.LOVELACE,
2845+
unit: WalletUnits.LOVELACE as const,
28452846
},
28462847
},
28472848
],
@@ -3120,7 +3121,7 @@ const _createTransactionFromServerData = action(
31203121
id,
31213122
amount,
31223123
fee,
3123-
deposit,
3124+
deposit_taken: deposit,
31243125
inserted_at: insertedAt,
31253126
pending_since: pendingSince,
31263127
depth,

source/renderer/app/api/transactions/requests/selectCoins.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type PaymentsType = {
1414
withdrawal?: TransactionWithdrawalType;
1515
metadata?: VotingMetadataType;
1616
};
17+
1718
export type DelegationType = {
1819
delegation_action: {
1920
pool: string;
@@ -53,9 +54,12 @@ export type SelectCoinsResponseType = {
5354
certificate_type: DelegationAction;
5455
reward_account_path: Array<string>;
5556
}>;
56-
deposits?: Array<{
57+
deposits_taken?: Array<{
58+
quantity: number;
59+
unit: WalletUnits.LOVELACE;
60+
}>;
61+
deposits_returned?: Array<{
5762
quantity: number;
58-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
5963
unit: WalletUnits.LOVELACE;
6064
}>;
6165
metadata?: string;

source/renderer/app/api/transactions/types.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type { PathRoleIdentityType } from '../../utils/hardwareWalletUtils';
88

99
export type TransactionAmount = {
1010
quantity: number;
11-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
1211
unit: WalletUnits.LOVELACE;
1312
};
1413
export type TransactionDepth = {
@@ -24,12 +23,14 @@ export type Transaction = {
2423
amount: TransactionAmount;
2524
fee: {
2625
quantity: number;
27-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
2826
unit: WalletUnits.LOVELACE;
2927
};
30-
deposit: {
28+
deposit_taken: {
29+
quantity: number;
30+
unit: WalletUnits.LOVELACE;
31+
};
32+
deposit_returned: {
3133
quantity: number;
32-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
3334
unit: WalletUnits.LOVELACE;
3435
};
3536
inserted_at?: {
@@ -140,7 +141,6 @@ export type TransactionParams = {
140141
};
141142
export type TransactionFeeAmount = {
142143
quantity: number;
143-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
144144
unit: WalletUnits.LOVELACE;
145145
};
146146
export type GetTransactionFeeParams = {
@@ -162,7 +162,6 @@ export type TransactionFee = {
162162
};
163163
export type CoinSelectionAmount = {
164164
quantity: number;
165-
// @ts-ignore ts-migrate(2503) FIXME: Cannot find namespace 'WalletUnits'.
166165
unit: WalletUnits.LOVELACE;
167166
};
168167
export type CoinSelectionInput = {

0 commit comments

Comments
 (0)