diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a579bae0..3ac8082a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,9 @@ ### Chores -- Update `cardano-node` to 10.1.2 via `cardano-wallet` v2024-11-18 ([PR 3229](https://github.com/input-output-hk/daedalus/pull/3229)) +- Update `cardano-node` to 10.1.3 ([PR 3249](https://github.com/input-output-hk/daedalus/pull/3249)) + +- Update `cardano-wallet` to v2024-11-18 ([PR 3229](https://github.com/input-output-hk/daedalus/pull/3229)) ### Fixes diff --git a/flake.lock b/flake.lock index 0df724831d..baeffa0596 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "cardano-node-override": { + "flake": false, + "locked": { + "lastModified": 1732705838, + "narHash": "sha256-v0q8qHdI6LKc8mP43QZt3UGdTNDQXE0aF6QapvZsTvU=", + "owner": "IntersectMBO", + "repo": "cardano-node", + "rev": "36871ba0cd3e86a5dbcfd6878cdb7168bb4e56a1", + "type": "github" + }, + "original": { + "owner": "IntersectMBO", + "ref": "10.1.3", + "repo": "cardano-node", + "type": "github" + } + }, "cardano-playground": { "flake": false, "locked": { @@ -101,6 +118,7 @@ }, "root": { "inputs": { + "cardano-node-override": "cardano-node-override", "cardano-playground": "cardano-playground", "cardano-shell": "cardano-shell", "cardano-wallet-unpatched": "cardano-wallet-unpatched", diff --git a/flake.nix b/flake.nix index 0e2f2f8bee..fc735d9934 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,8 @@ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin"; cardano-wallet-unpatched.url = "github:cardano-foundation/cardano-wallet/v2024-11-18"; cardano-wallet-unpatched.flake = false; # otherwise, +10k quadratic dependencies in flake.lock… + cardano-node-override.url = "github:IntersectMBO/cardano-node/10.1.3"; + cardano-node-override.flake = false; cardano-playground.url = "github:input-output-hk/cardano-playground/49d93e5fe42e1e37f8b4c7d463b5d6bc4af65f26"; cardano-playground.flake = false; # otherwise, +9k dependencies in flake.lock… cardano-shell.url = "github:input-output-hk/cardano-shell/0d1d5f036c73d18e641412d2c58d4acda592d493"; diff --git a/nix/internal/common.nix b/nix/internal/common.nix index 1c59b81927..1a4408ca6b 100644 --- a/nix/internal/common.nix +++ b/nix/internal/common.nix @@ -40,7 +40,7 @@ rec { }).defaultNix; nodeFlake = let - unpatched = walletFlake.inputs.cardano-node-runtime; + unpatched = inputs.cardano-node-override; in (flake-compat { src = { outPath = toString (pkgs.runCommand "source" {} '' diff --git a/source/renderer/app/api/api.ts b/source/renderer/app/api/api.ts index 5bbcb79c19..bc1b38c31f 100644 --- a/source/renderer/app/api/api.ts +++ b/source/renderer/app/api/api.ts @@ -1300,7 +1300,7 @@ export default class AdaApi { error, }); - throw new ApiError(error); + throw new ApiError(error).result(); } }; @@ -1318,7 +1318,7 @@ export default class AdaApi { logger.error('AdaApi::createExternalTransaction error', { error, }); - throw new ApiError(error); + throw new ApiError(error).result(); } }; inspectAddress = async (request: { @@ -2827,7 +2827,7 @@ export default class AdaApi { error, }); - throw new ApiError(error); + throw new ApiError(error).result(); } }; diff --git a/source/renderer/app/stores/VotingStore.ts b/source/renderer/app/stores/VotingStore.ts index c1a9c8fc2e..bf1752dfc1 100644 --- a/source/renderer/app/stores/VotingStore.ts +++ b/source/renderer/app/stores/VotingStore.ts @@ -1,6 +1,5 @@ import { action, computed, observable, runInAction } from 'mobx'; import { get } from 'lodash'; -import BigNumber from 'bignumber.js'; import Store from './lib/Store'; import Request from './lib/LocalizedRequest'; import { ROUTES } from '../routes-config'; @@ -30,8 +29,8 @@ import { EventCategories } from '../analytics'; import type { DelegationCalculateFeeResponse } from '../api/staking/types'; import Wallet from '../domains/Wallet'; import ApiError from '../domains/ApiError'; -import type { DelegationAction } from '../types/stakingTypes'; import { GenericApiError } from '../api/common/errors'; +import { logger } from '../utils/logging'; export type VotingRegistrationKeyType = { bytes: (...args: Array) => any; @@ -280,29 +279,25 @@ export default class VotingStore extends Store { wallet: Wallet; }) => { if (wallet.isHardwareWallet) { - const [{ id: stakePoolId }] = this.stores.staking.stakePools; - let dlegationData: { - delegationAction: DelegationAction; - poolId: string; - } = { - delegationAction: 'join', - poolId: stakePoolId, - }; + let poolId: string; if (wallet.isDelegating) { const { lastDelegatedStakePoolId, delegatedStakePoolId } = wallet; - const poolId = lastDelegatedStakePoolId || delegatedStakePoolId || ''; - dlegationData = { - delegationAction: 'quit', - poolId, - }; + const currentPoolId = lastDelegatedStakePoolId || delegatedStakePoolId; + poolId = this.stores.staking.stakePools.find( + (stakePool) => stakePool.id !== currentPoolId + ).id; + } else { + const [{ id }] = this.stores.staking.stakePools; + poolId = id; } try { const initialCoinSelection = await this.stores.hardwareWallets.selectDelegationCoins( { walletId: wallet.id, - ...dlegationData, + delegationAction: 'join', + poolId, } ); @@ -342,6 +337,12 @@ export default class VotingStore extends Store { fees: coinSelection.fee, }; } catch (error) { + logger.error( + 'VotingStore: error while initializing VP delegation TX with HW', + { + error, + } + ); return { success: false, errorCode: parseApiCode( @@ -364,6 +365,9 @@ export default class VotingStore extends Store { fees: constructedTx.fee, }; } catch (error) { + logger.error('VotingStore: error while initializing VP delegation TX', { + error, + }); return { success: false, errorCode: parseApiCode(expectedInitializeVPDelegationTxErrors, error), @@ -417,6 +421,9 @@ export default class VotingStore extends Store { success: true, }; } catch (error) { + logger.error('VotingStore: error while delegating vote with HW', { + error, + }); const errorCode: GenericErrorCode = 'generic'; return { success: false,