Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-526] ADA redemption failing on Daedalus 0.12.0 with Cardano 2.0.0 #1220

Merged
merged 2 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Changelog
- Improved the loading UX ([PR 723](https://github.com/input-output-hk/daedalus/pull/723))
- Improved the NTP check handling ([PR 1086](https://github.com/input-output-hk/daedalus/pull/1086), [PR 1149](https://github.com/input-output-hk/daedalus/pull/1149), [PR 1158](https://github.com/input-output-hk/daedalus/pull/1158), [PR 1194](https://github.com/input-output-hk/daedalus/pull/1194), [PR 1213](https://github.com/input-output-hk/daedalus/pull/1213))
- Improved the transaction details text selection ([PR 1073](https://github.com/input-output-hk/daedalus/pull/1073), [PR 1095](https://github.com/input-output-hk/daedalus/pull/1095))
- Integrated Cardano V1 API endpoints ([PR 1018](https://github.com/input-output-hk/daedalus/pull/1018), [PR 1031](https://github.com/input-output-hk/daedalus/pull/1031), [PR 1037](https://github.com/input-output-hk/daedalus/pull/1037), [PR 1042](https://github.com/input-output-hk/daedalus/pull/1042), [PR 1045](https://github.com/input-output-hk/daedalus/pull/1045), [PR 1070](https://github.com/input-output-hk/daedalus/pull/1070), [PR 1078](https://github.com/input-output-hk/daedalus/pull/1078), [PR 1079](https://github.com/input-output-hk/daedalus/pull/1079), [PR 1080](https://github.com/input-output-hk/daedalus/pull/1080), [PR 1088](https://github.com/input-output-hk/daedalus/pull/1088))
- Integrated Cardano V1 API endpoints ([PR 1018](https://github.com/input-output-hk/daedalus/pull/1018), [PR 1031](https://github.com/input-output-hk/daedalus/pull/1031), [PR 1037](https://github.com/input-output-hk/daedalus/pull/1037), [PR 1042](https://github.com/input-output-hk/daedalus/pull/1042), [PR 1045](https://github.com/input-output-hk/daedalus/pull/1045), [PR 1070](https://github.com/input-output-hk/daedalus/pull/1070), [PR 1078](https://github.com/input-output-hk/daedalus/pull/1078), [PR 1079](https://github.com/input-output-hk/daedalus/pull/1079), [PR 1080](https://github.com/input-output-hk/daedalus/pull/1080), [PR 1088](https://github.com/input-output-hk/daedalus/pull/1088), [PR 1220](https://github.com/input-output-hk/daedalus/pull/1220))
- Refactored and improved `NetworkStatus` store to use V1 API data ([PR 1081](https://github.com/input-output-hk/daedalus/pull/1081))

### Fixes
Expand Down
12 changes: 7 additions & 5 deletions source/renderer/app/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,9 @@ export default class AdaApi {
}
};

async redeemAda(request: RedeemAdaParams): Promise<WalletTransaction> {
redeemAda = async (
request: RedeemAdaParams
): Promise<WalletTransaction> => {
Logger.debug('AdaApi::redeemAda called');
const { spendingPassword: passwordString } = request;
const spendingPassword = passwordString ? encryptPassphrase(passwordString) : '';
Expand All @@ -596,11 +598,11 @@ export default class AdaApi {
}
throw new RedeemAdaError();
}
}
};

async redeemPaperVendedAda(
redeemPaperVendedAda = async (
request: RedeemPaperVendedAdaParams
): Promise<WalletTransaction> {
): Promise<WalletTransaction> => {
Logger.debug('AdaApi::redeemAdaPaperVend called');
const { spendingPassword: passwordString } = request;
const spendingPassword = passwordString ? encryptPassphrase(passwordString) : '';
Expand All @@ -617,7 +619,7 @@ export default class AdaApi {
}
throw new RedeemAdaError();
}
}
};

async sendBugReport(requestFormData: SendBugReportRequest): Promise<any> {
Logger.debug('AdaApi::sendBugReport called: ' + stringifyData(requestFormData));
Expand Down
11 changes: 6 additions & 5 deletions source/renderer/app/stores/AdaRedemptionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Store from './lib/Store';
import Request from './lib/LocalizedRequest';
import WalletTransaction from '../domains/WalletTransaction';
import { Logger } from '../../../common/logging';
import { encryptPassphrase } from '../api/utils';
import { matchRoute } from '../utils/routing';
import { PARSE_REDEMPTION_CODE } from '../../../common/ipc-api';
import {
Expand Down Expand Up @@ -216,9 +215,10 @@ export default class AdaRedemptionStore extends Store {

try {
const transaction: WalletTransaction = await this.redeemAdaRequest.execute({
walletId,
accountIndex,
redemptionCode: this.redemptionCode,
spendingPassword: spendingPassword && encryptPassphrase(spendingPassword)
spendingPassword,
redemptionCode: this.redemptionCode
});
this._reset();
this.actions.adaRedemption.adaSuccessfullyRedeemed.trigger({
Expand All @@ -242,10 +242,11 @@ export default class AdaRedemptionStore extends Store {

try {
const transaction: WalletTransaction = await this.redeemPaperVendedAdaRequest.execute({
mnemonics: this.passPhrase && this.passPhrase.split(' '),
walletId,
accountIndex,
spendingPassword,
redemptionCode: shieldedRedemptionKey,
spendingPassword: spendingPassword && encryptPassphrase(spendingPassword)
mnemonics: this.passPhrase && this.passPhrase.split(' ')
});
this._reset();
this.actions.adaRedemption.adaSuccessfullyRedeemed.trigger({
Expand Down