Skip to content

Commit 06fe03f

Browse files
author
Marcin Mazurek
committed
Fix Catalyst voting registration with HWs
1 parent 3d07522 commit 06fe03f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

source/renderer/app/containers/voting/dialogs/VotingRegistrationDialogContainer.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ class VotingRegistrationDialogContainer extends Component<Props, State> {
255255
const { calculateTransactionFee } = transactions;
256256
const { getAddressesByWalletId } = addresses;
257257
const { getWalletById } = wallets;
258-
const { selectCoins, initiateTransaction } = hardwareWallets;
258+
const {
259+
selectCoins,
260+
initiateTransaction,
261+
updateTxSignRequest,
262+
} = hardwareWallets;
259263
const { prepareVotingData } = voting;
260264
const amount = formattedAmountToLovelace(
261265
`${VOTING_REGISTRATION_FEE_CALCULATION_AMOUNT}`
@@ -269,30 +273,32 @@ class VotingRegistrationDialogContainer extends Component<Props, State> {
269273
const selectedWallet = getWalletById(this.selectedWalletId);
270274
const [address] = await getAddressesByWalletId(this.selectedWalletId);
271275
const isHardwareWallet = get(selectedWallet, 'isHardwareWallet', false);
272-
let fee;
276+
let coinSelection;
273277
let votingData;
274278

275279
if (isHardwareWallet) {
276280
votingData = await prepareVotingData({
277281
walletId: this.selectedWalletId,
278282
});
279-
({ fee } = await selectCoins({
283+
coinSelection = await selectCoins({
280284
walletId: this.selectedWalletId,
281285
address: address.id,
282286
amount,
283287
metadata: votingData.metadata,
284-
}));
288+
});
289+
290+
updateTxSignRequest(coinSelection);
285291
} else {
286-
({ fee } = await calculateTransactionFee({
292+
coinSelection = await calculateTransactionFee({
287293
walletId: this.selectedWalletId,
288294
address: address.id,
289295
amount,
290-
}));
296+
});
291297
}
292298

293299
if (this._isMounted) {
294300
this.setState({
295-
transactionFee: fee,
301+
transactionFee: coinSelection.fee,
296302
transactionFeeError: null,
297303
});
298304
}

0 commit comments

Comments
 (0)