Skip to content

Commit

Permalink
Merge pull request #2407 from input-output-hk/release-with-master
Browse files Browse the repository at this point in the history
Merge release/3.3.1 into master
  • Loading branch information
nikolaglumac committed Feb 25, 2021
2 parents ddaf412 + ef6133e commit f30ef2a
Show file tree
Hide file tree
Showing 68 changed files with 1,890 additions and 769 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,24 @@
Changelog
=========

## 3.3.1

### Features

- Implemented "Undelegate wallet" feature on "Wallet settings" screen ([PR 2351](https://github.com/input-output-hk/daedalus/pull/2351))

### Fixes

- Fixed calendar style issue on Filter dialog on transaction list screen ([PR 2387](https://github.com/input-output-hk/daedalus/pull/2387))
- Fixed issue on wallet send form with certain amounts ([PR 2379](https://github.com/input-output-hk/daedalus/pull/2379))

### Chores

- Enabled selecting whole addresses and ids when selecting them to copy on transactions and summary screens ([PR 2370](https://github.com/input-output-hk/daedalus/pull/2370))
- Added missing whitespace between amount and ADA in Japanese ([PR 2380](https://github.com/input-output-hk/daedalus/pull/2380))
- Updated link "Follow instructions and manually update" on testnet and flight ([PR 2372](https://github.com/input-output-hk/daedalus/pull/2372))
- Fixed broken staking stories in Storybook ([PR 2371](https://github.com/input-output-hk/daedalus/pull/2371))

## 3.3.0

### Fixes
Expand All @@ -9,6 +27,7 @@ Changelog

### Chores

- Updated `@cardano-foundation/ledgerjs-hw-app-cardano` package to version `2.2.0` ([PR 2381](https://github.com/input-output-hk/daedalus/pull/2381))
- Updated `cardano-launcher` to version `0.20210215.0` ([PR 2363](https://github.com/input-output-hk/daedalus/pull/2363))
- Updated `cardano-wallet` to version `2021-02-15` ([PR 2363](https://github.com/input-output-hk/daedalus/pull/2363))
- Updated `cardano-wallet` to version `2021-02-12` ([PR 2358](https://github.com/input-output-hk/daedalus/pull/2358))
Expand Down
3 changes: 3 additions & 0 deletions installers/common/MacInstaller.hs
Expand Up @@ -280,6 +280,9 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
, "trezor-connect"
, "js-chain-libs-node"
, "bignumber.js"
, "int64-buffer"
, "call-bind"
, "get-intrinsic"
]
mapM_ (\lib -> do
cptree ("../node_modules" </> lib) ((fromText pathtoapp) </> "Contents/Resources/app/node_modules" </> lib)
Expand Down
2 changes: 2 additions & 0 deletions netlify.toml
@@ -0,0 +1,2 @@
[build]
environment = { YARN_VERSION = "1.22.4" }
6 changes: 3 additions & 3 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "3.3.0",
"version": "3.3.1",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down Expand Up @@ -172,7 +172,7 @@
"yarn-lockfile": "1.1.1"
},
"dependencies": {
"@cardano-foundation/ledgerjs-hw-app-cardano": "2.1.0",
"@cardano-foundation/ledgerjs-hw-app-cardano": "2.2.0",
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
"aes-js": "3.1.2",
"bignumber.js": "9.0.1",
Expand Down Expand Up @@ -246,7 +246,7 @@
"shasum": "1.0.2",
"source-map-support": "0.5.19",
"spectron-fake-dialog": "0.0.1",
"trezor-connect": "8.1.16-extended",
"trezor-connect": "8.1.22-extended",
"unorm": "1.6.0",
"validator": "13.1.17"
},
Expand Down
6 changes: 4 additions & 2 deletions source/common/types/hardware-wallets.types.js
Expand Up @@ -175,7 +175,7 @@ export type LedgerSignTransactionRequest = {
inputs: LedgerSignTransactionInputsType,
outputs: LedgerSignTransactionOutputsType,
fee: string,
ttl: string,
ttl?: string,
networkId: number,
protocolMagic: number,
// $FlowFixMe
Expand All @@ -185,18 +185,20 @@ export type LedgerSignTransactionRequest = {
metadataHashHex: ?string, // TODO - add once metadata defined
reset?: boolean,
devicePath: ?string,
validityIntervalStartStr?: string,
};

export type TrezorSignTransactionRequest = {
inputs: TrezorSignTransactionInputsType,
outputs: TrezorSignTransactionOutputsType,
fee: string,
fee?: string,
ttl: string,
networkId: number,
protocolMagic: number,
certificates: Array<?Certificate>,
reset?: boolean,
devicePath: string,
validityIntervalStartStr?: string,
};

export type LedgerSignTransactionResponse = {
Expand Down
6 changes: 6 additions & 0 deletions source/main/ipc/getHardwareWalletChannel.js
Expand Up @@ -536,6 +536,7 @@ export const handleHardwareWalletRequests = async (
}
});

// @TODO - validityIntervalStartStr is not working with Cardano App 2.1.0
signTransactionLedgerChannel.onRequest(async (params) => {
const {
inputs,
Expand All @@ -548,6 +549,7 @@ export const handleHardwareWalletRequests = async (
withdrawals,
metadataHashHex,
devicePath,
// validityIntervalStartStr,
} = params;
logger.info('[HW-DEBUG] SIGN Ledger transaction');
deviceConnection = devicePath
Expand All @@ -558,6 +560,7 @@ export const handleHardwareWalletRequests = async (
if (!deviceConnection) {
throw new Error('Device not connected!');
}

const signedTransaction = await deviceConnection.signTransaction(
networkId,
protocolMagic,
Expand All @@ -568,6 +571,7 @@ export const handleHardwareWalletRequests = async (
certificates,
withdrawals,
metadataHashHex
// validityIntervalStartStr
);
return Promise.resolve(signedTransaction);
} catch (e) {
Expand All @@ -585,6 +589,7 @@ export const handleHardwareWalletRequests = async (
networkId,
certificates,
devicePath,
validityIntervalStartStr,
} = params;

if (!TrezorConnect) {
Expand All @@ -600,6 +605,7 @@ export const handleHardwareWalletRequests = async (
protocolMagic,
networkId,
certificates,
validityIntervalStartStr,
};
const signedTransaction = await TrezorConnect.cardanoSignTransaction({
device: { path: devicePath },
Expand Down
7 changes: 2 additions & 5 deletions source/renderer/app/actions/wallets-actions.js
Expand Up @@ -6,6 +6,7 @@ import type {
HardwareWalletExtendedPublicKeyResponse,
} from '../../../common/types/hardware-wallets.types';
import type { CsvFileContent } from '../../../common/types/csv-request.types';
import type { QuitStakePoolRequest } from '../api/staking/types';

export type WalletImportFromFileParams = {
filePath: string,
Expand Down Expand Up @@ -44,11 +45,7 @@ export default class WalletsActions {
restoreWallet: Action<any> = new Action();
importWalletFromFile: Action<WalletImportFromFileParams> = new Action();
deleteWallet: Action<{ walletId: string, isLegacy: boolean }> = new Action();
undelegateWallet: Action<{
walletId: string,
stakePoolId: string,
passphrase: string,
}> = new Action();
undelegateWallet: Action<QuitStakePoolRequest> = new Action();
setUndelegateWalletSubmissionSuccess: Action<{
result: boolean,
}> = new Action();
Expand Down
38 changes: 28 additions & 10 deletions source/renderer/app/api/api.js
Expand Up @@ -108,6 +108,8 @@ import {
SMASH_SERVERS_LIST,
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE,
REWARDS_REDEMPTION_FEE_CALCULATION_AMOUNT,
DELEGATION_DEPOSIT,
DELEGATION_ACTIONS,
} from '../config/stakingConfig';
import {
ADA_CERTIFICATE_MNEMONIC_LENGTH,
Expand Down Expand Up @@ -998,19 +1000,30 @@ export default class AdaApi {
});
}

const deposits = map(response.deposits, (deposit) => deposit.quantity);
const totalDeposits = deposits.length
? BigNumber.sum.apply(null, deposits)
const depositsArray = map(
response.deposits,
(deposit) => deposit.quantity
);
const deposits = depositsArray.length
? BigNumber.sum.apply(null, depositsArray)
: new BigNumber(0);
const feeWithDeposits = totalInputs.minus(totalOutputs);
const fee = feeWithDeposits.minus(totalDeposits);
// @TODO - Use api response when api is ready
const depositsReclaimed =
delegation && delegation.delegationAction === DELEGATION_ACTIONS.QUIT
? new BigNumber(DELEGATION_DEPOSIT).multipliedBy(LOVELACES_PER_ADA)
: new BigNumber(0);
const fee =
delegation && delegation.delegationAction === DELEGATION_ACTIONS.QUIT
? totalInputs.minus(totalOutputs).plus(depositsReclaimed)
: totalInputs.minus(totalOutputs).minus(deposits);

const extendedResponse = {
inputs: inputsData,
outputs: outputsData,
certificates: certificatesData,
feeWithDeposits: feeWithDeposits.dividedBy(LOVELACES_PER_ADA),
fee: fee.dividedBy(LOVELACES_PER_ADA),
deposits: deposits.dividedBy(LOVELACES_PER_ADA),
depositsReclaimed: depositsReclaimed.dividedBy(LOVELACES_PER_ADA),
};
logger.debug('AdaApi::selectCoins success', { extendedResponse });
return extendedResponse;
Expand Down Expand Up @@ -2479,7 +2492,9 @@ const _createWalletFromServerData = action(
const next = get(delegation, 'next', null);
const lastPendingStakePool = next ? last(next) : null;
const lastTarget = get(lastPendingStakePool, 'target', null);
const lastDelegationStakePoolId = isLegacy ? null : lastTarget;
const lastStatus = get(lastPendingStakePool, 'status', null);
const lastDelegatedStakePoolId = isLegacy ? null : lastTarget;
const lastDelegationStakePoolStatus = isLegacy ? null : lastStatus;

return new Wallet({
id,
Expand All @@ -2496,7 +2511,8 @@ const _createWalletFromServerData = action(
isHardwareWallet,
delegatedStakePoolId,
delegationStakePoolStatus,
lastDelegationStakePoolId,
lastDelegatedStakePoolId,
lastDelegationStakePoolStatus,
pendingDelegations: next,
discovery,
});
Expand Down Expand Up @@ -2605,10 +2621,12 @@ const _createDelegationFeeFromServerData = action(
const fee = new BigNumber(
get(data, ['estimated_max', 'quantity'], 0)
).dividedBy(LOVELACES_PER_ADA);
const deposit = new BigNumber(
const deposits = new BigNumber(
get(data, ['deposit', 'quantity'], 0)
).dividedBy(LOVELACES_PER_ADA);
return { fee, deposit };
// @TODO Use api response data when api is ready
const depositsReclaimed = new BigNumber(0);
return { fee, deposits, depositsReclaimed };
}
);

Expand Down
4 changes: 3 additions & 1 deletion source/renderer/app/api/staking/types.js
Expand Up @@ -96,12 +96,14 @@ export type GetDelegationFeeRequest = {

export type DelegationCalculateFeeResponse = {
fee: BigNumber,
deposit: BigNumber,
deposits: BigNumber,
depositsReclaimed: BigNumber,
};

export type QuitStakePoolRequest = {
walletId: string,
passphrase: string,
isHardwareWallet?: boolean,
};

export type GetRedeemItnRewardsFeeRequest = {
Expand Down
10 changes: 9 additions & 1 deletion source/renderer/app/api/transactions/types.js
Expand Up @@ -184,10 +184,17 @@ export type CoinSelectionInput = {
derivationPath: Array<string>,
};

export type Asset = {
policyId: string,
assetName: string,
quantity: number,
};

export type CoinSelectionOutput = {
address: string,
amount: CoinSelectionAmount,
derivationPath: Array<string>,
assets?: Array<Asset>,
};

export type CertificateType =
Expand Down Expand Up @@ -223,7 +230,8 @@ export type CoinSelectionsResponse = {
inputs: Array<CoinSelectionInput>,
outputs: Array<CoinSelectionOutput>,
certificates: CoinSelectionCertificates,
feeWithDeposits: BigNumber,
deposits: BigNumber,
depositsReclaimed: BigNumber,
fee: BigNumber,
};

Expand Down
51 changes: 42 additions & 9 deletions source/renderer/app/components/appUpdate/AppUpdateOverlay.js
Expand Up @@ -94,10 +94,23 @@ const messages = defineMessages({
defaultMessage: '!!!Follow instructions and manually update',
description: '"manualUpdateButtonLabel" for the App Update Overlay',
},
manualUpdateButtonUrl: {
id: 'appUpdate.overlay.manualUpdate.button.url',
manualUpdateButtonUrlForMainnet: {
id: 'appUpdate.overlay.manualUpdate.button.url.mainnet',
defaultMessage: '!!!https://daedaluswallet.io/en/download/',
description: '"manualUpdateButtonUrl" for the App Update Overlay',
description:
'"manualUpdateButtonUrl" for the App Update Overlay on Mainnet',
},
manualUpdateButtonUrlForFlight: {
id: 'appUpdate.overlay.manualUpdate.button.url.flight',
defaultMessage: '!!!https://daedaluswallet.io/en/flight/',
description: '"manualUpdateButtonUrl" for the App Update Overlay on Flight',
},
manualUpdateButtonUrlForTestnet: {
id: 'appUpdate.overlay.manualUpdate.button.url.testnet',
defaultMessage:
'!!!https://developers.cardano.org/en/testnets/cardano/get-started/wallet/',
description:
'"manualUpdateButtonUrl" for the App Update Overlay on Testnet',
},
});

Expand All @@ -118,6 +131,8 @@ type Props = {
onPostponeUpdate: Function,
installationProgress: number,
isLinux: boolean,
isFlight: boolean,
isTestnet: boolean,
};

type State = {
Expand Down Expand Up @@ -261,10 +276,32 @@ export default class AppUpdateOverlay extends Component<Props, State> {

manualUpdateAction = () => {
const { intl } = this.context;
const { onExternalLinkClick, onPostponeUpdate, isLinux } = this.props;
const {
onExternalLinkClick,
onPostponeUpdate,
isLinux,
isFlight,
isTestnet,
} = this.props;
const errorMessage = isLinux
? messages.manualUpdateDescriptionErrorLinux
: messages.manualUpdateDescriptionError;
let manualUpdateButtonUrl = intl.formatMessage(
messages.manualUpdateButtonUrlForMainnet
);

if (isTestnet) {
manualUpdateButtonUrl = intl.formatMessage(
messages.manualUpdateButtonUrlForTestnet
);
}

if (isFlight) {
manualUpdateButtonUrl = intl.formatMessage(
messages.manualUpdateButtonUrlForFlight
);
}

return (
<div className={styles.actions}>
<div className={styles.manualUpdateDescription}>
Expand All @@ -273,11 +310,7 @@ export default class AppUpdateOverlay extends Component<Props, State> {
</div>
<Button
className={styles.button}
onClick={() =>
onExternalLinkClick(
intl.formatMessage(messages.manualUpdateButtonUrl)
)
}
onClick={() => onExternalLinkClick(manualUpdateButtonUrl)}
skin={ButtonSkin}
label={
<span>
Expand Down
Expand Up @@ -190,7 +190,7 @@ export default class DelegationStepsChooseStakePoolDialog extends Component<
);
const lastDelegatedStakePoolId = get(
selectedWallet,
'lastDelegationStakePoolId',
'lastDelegatedStakePoolId',
null
);
const delegatedStakePoolId = get(
Expand Down

0 comments on commit f30ef2a

Please sign in to comment.