Skip to content

Commit d95a4cc

Browse files
authored
Merge pull request #3264 from input-output-hk/release/7.0.2
Release 7.0.2
2 parents a69826c + 331049f commit d95a4cc

File tree

4 files changed

+41
-57
lines changed

4 files changed

+41
-57
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Changelog
22

3+
## 7.0.2
4+
5+
### Fixes
6+
7+
- Changed Cardano Wallet endpoint used to initialize VP delegation transaction ([PR 3262](https://github.com/input-output-hk/daedalus/pull/3262))
8+
39
## 7.0.1
410

11+
### Chores
12+
513
- Fixed crashing of Daedalus 7.0.0 on Ubuntu ([PR 3257](https://github.com/input-output-hk/daedalus/pull/3257))
614

715
## 7.0.0

package.json

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

source/renderer/app/api/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2829,7 +2829,7 @@ export default class AdaApi {
28292829

28302830
return response;
28312831
} catch (error) {
2832-
logger.debug('AdaApi::delegateVotes error', {
2832+
logger.error('AdaApi::delegateVotes error', {
28332833
error,
28342834
});
28352835

source/renderer/app/stores/VotingStore.ts

+31-55
Original file line numberDiff line numberDiff line change
@@ -278,29 +278,29 @@ export default class VotingStore extends Store {
278278
chosenOption: string;
279279
wallet: Wallet;
280280
}) => {
281-
if (wallet.isHardwareWallet) {
282-
let poolId: string;
283-
284-
if (wallet.isDelegating) {
285-
const { lastDelegatedStakePoolId, delegatedStakePoolId } = wallet;
286-
const currentPoolId = lastDelegatedStakePoolId || delegatedStakePoolId;
287-
poolId = this.stores.staking.stakePools.find(
288-
(stakePool) => stakePool.id !== currentPoolId
289-
).id;
290-
} else {
291-
const [{ id }] = this.stores.staking.stakePools;
292-
poolId = id;
293-
}
281+
let poolId: string;
282+
283+
if (wallet.isDelegating) {
284+
const { lastDelegatedStakePoolId, delegatedStakePoolId } = wallet;
285+
const currentPoolId = lastDelegatedStakePoolId || delegatedStakePoolId;
286+
poolId = this.stores.staking.stakePools.find(
287+
(stakePool) => stakePool.id !== currentPoolId
288+
).id;
289+
} else {
290+
const [{ id }] = this.stores.staking.stakePools;
291+
poolId = id;
292+
}
294293

295-
try {
296-
const initialCoinSelection = await this.stores.hardwareWallets.selectDelegationCoins(
297-
{
298-
walletId: wallet.id,
299-
delegationAction: 'join',
300-
poolId,
301-
}
302-
);
294+
try {
295+
let coinSelection = await this.stores.hardwareWallets.selectDelegationCoins(
296+
{
297+
walletId: wallet.id,
298+
delegationAction: 'join',
299+
poolId,
300+
}
301+
);
303302

303+
if (wallet.isHardwareWallet) {
304304
let certificates: object[] = [
305305
{
306306
certificateType: 'cast_vote',
@@ -309,7 +309,7 @@ export default class VotingStore extends Store {
309309
},
310310
];
311311

312-
const walletNeedsRegisteringRewardAccount = initialCoinSelection.certificates.some(
312+
const walletNeedsRegisteringRewardAccount = coinSelection.certificates.some(
313313
(c) => c.certificateType === 'register_reward_account'
314314
);
315315
if (walletNeedsRegisteringRewardAccount) {
@@ -322,52 +322,28 @@ export default class VotingStore extends Store {
322322
];
323323
}
324324

325-
const coinSelection = {
326-
...initialCoinSelection,
325+
coinSelection = {
326+
...coinSelection,
327327
certificates,
328328
};
329329

330330
this.stores.hardwareWallets.updateTxSignRequest(coinSelection);
331331
this.stores.hardwareWallets.initiateTransaction({
332332
walletId: wallet.id,
333333
});
334-
335-
return {
336-
success: true,
337-
fees: coinSelection.fee,
338-
};
339-
} catch (error) {
340-
logger.error(
341-
'VotingStore: error while initializing VP delegation TX with HW',
342-
{
343-
error,
344-
}
345-
);
346-
return {
347-
success: false,
348-
errorCode: parseApiCode(
349-
expectedInitializeVPDelegationTxErrors,
350-
error
351-
),
352-
};
353334
}
354-
}
355-
356-
this.constructTxRequest.reset();
357-
try {
358-
const constructedTx = await this.constructTxRequest.execute({
359-
walletId: wallet.id,
360-
data: { vote: chosenOption },
361-
}).promise;
362335

363336
return {
364337
success: true,
365-
fees: constructedTx.fee,
338+
fees: coinSelection.fee,
366339
};
367340
} catch (error) {
368-
logger.error('VotingStore: error while initializing VP delegation TX', {
369-
error,
370-
});
341+
logger.error(
342+
'VotingStore: error while initializing VP delegation TX with HW',
343+
{
344+
error,
345+
}
346+
);
371347
return {
372348
success: false,
373349
errorCode: parseApiCode(expectedInitializeVPDelegationTxErrors, error),

0 commit comments

Comments
 (0)