Skip to content

Commit

Permalink
Bump Daedalus version to 3.0.0-FC4
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaglumac committed Dec 4, 2020
2 parents eb35f45 + 9effd23 commit 089546a
Show file tree
Hide file tree
Showing 45 changed files with 393 additions and 297 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"import/prefer-default-export": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/control-has-associated-label": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-static-element-interactions": 0,
"max-classes-per-file": 0,
"no-async-promise-executor": 0,
"no-await-in-loop": 0,
Expand Down
28 changes: 24 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Changelog
=========

## 3.0.0-FC4

### Fixes

- Fixed Trezor transactions TTL

## 3.0.0-FC3

### Features

- Added hardware wallet support for "Ledger Nano S" and "Ledger Nano X" on Linux ([PR 2046](https://github.com/input-output-hk/daedalus/pull/2046))

### Fixes

- Fixed the overlap of the "X" button in the stake pools search box ([PR 2251](https://github.com/input-output-hk/daedalus/pull/2251))

## 3.0.0-FC2

### Features
Expand All @@ -23,6 +25,24 @@ Changelog

- Added hardware wallet support for "Trezor model T" ([PR 2046](https://github.com/input-output-hk/daedalus/pull/2046))

## 2.6.0

### Features

- Close Newsfeed when clicking anywhere else in the UI ([PR 2250](https://github.com/input-output-hk/daedalus/pull/2250))

### Fixes

- Fixed removal of stake pools which have been delisted on SMASH ([PR 2263](https://github.com/input-output-hk/daedalus/pull/2263))
- Fixed error message and validation on redeem rewards screen ([PR 2220](https://github.com/input-output-hk/daedalus/pull/2220))
- Fixed empty disk space calculation for some Linux distributions ([PR 2258](https://github.com/input-output-hk/daedalus/pull/2258))
- Fixed the overlap of the "X" button in the stake pools search box ([PR 2251](https://github.com/input-output-hk/daedalus/pull/2251))

### Chores

- Improved maximum delegation stake amount calculation ([PR 2262](https://github.com/input-output-hk/daedalus/pull/2262))
- Updated `cardano-wallet` to version `2020-11-26` ([PR 2262](https://github.com/input-output-hk/daedalus/pull/2262))

## 2.5.0

### Features
Expand Down
8 changes: 4 additions & 4 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"homepage": null,
"owner": "input-output-hk",
"repo": "cardano-wallet",
"rev": "7767f33b7fde5cadf35e7974c531a49cd2680aa5",
"sha256": "1y4sfykqkdijv2rx4758nc1b2f262cn89qfsv48xrv4irwi7x5mr",
"rev": "5276dfdb433778643c4c82772c06f4d9fc3b28a7",
"sha256": "1262mangwrc2ykr9qwbcj57h2z2ib2sn0haipm2md4246f7b97v7",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/7767f33b7fde5cadf35e7974c531a49cd2680aa5.tar.gz",
"url": "https://github.com/input-output-hk/cardano-wallet/archive/5276dfdb433778643c4c82772c06f4d9fc3b28a7.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "v2020-11-17"
"version": "v2020-11-26"
},
"gitignore": {
"branch": "master",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "3.0.0-FC3",
"version": "3.0.0-FC4",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions source/common/utils/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const filterLogData = (data: Object): Object => {
'publicKeyHex',
'chainCodeHex',
'signedTransactionBlob',
'withdrawal',
];
return omitDeep(data, ...sensitiveData);
};
Expand Down
1 change: 0 additions & 1 deletion source/main/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ export const {
export const appLogsFolderPath = logsPrefix;
export const pubLogsFolderPath = path.join(appLogsFolderPath, 'pub');
export const stateDirectoryPath = stateDir;
export const stateDrive = isWindows ? stateDirectoryPath.slice(0, 2) : '/';
export const buildLabel = getBuildLabel(
build,
network,
Expand Down
4 changes: 2 additions & 2 deletions source/main/utils/handleDiskSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DISK_SPACE_CHECK_MEDIUM_INTERVAL,
DISK_SPACE_CHECK_SHORT_INTERVAL,
DISK_SPACE_RECOMMENDED_PERCENTAGE,
stateDrive,
stateDirectoryPath,
} from '../config';

export const handleDiskSpace = (
Expand All @@ -28,7 +28,7 @@ export const handleDiskSpace = (
const {
free: diskSpaceAvailable,
size: diskTotalSpace,
} = await checkDiskSpace(stateDrive);
} = await checkDiskSpace(stateDirectoryPath);
const diskSpaceMissing = Math.max(
diskSpaceRequired - diskSpaceAvailable,
0
Expand Down
1 change: 1 addition & 0 deletions source/renderer/app/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default class AppActions {
setIsDownloadingLogs: Action<boolean> = new Action();
toggleNewsFeed: Action<boolean> = new Action();
closeNewsFeed: Action<any> = new Action();
onUiClicked: Action<any> = new Action();

// About dialog actions
closeAboutDialog: Action<any> = new Action();
Expand Down
5 changes: 3 additions & 2 deletions source/renderer/app/actions/staking-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export default class StakingActions {
requestCSVFileSuccess: Action<any> = new Action();
/* ---------- Redeem ITN Rewards ---------- */
onRedeemStart: Action<any> = new Action();
onConfigurationContinue: Action<{
onConfigurationContinue: Action<any> = new Action();
onCalculateRedeemWalletFees: Action<{
walletId: string,
recoveryPhrase: Array<string>,
}> = new Action();
onSelectRedeemWallet: Action<{ walletId: string }> = new Action();
onConfirmationContinue: Action<{ spendingPassword: string }> = new Action();
onResultContinue: Action<any> = new Action();
closeRedeemDialog: Action<any> = new Action();
Expand Down
22 changes: 18 additions & 4 deletions source/renderer/app/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ import { filterLogData } from '../../../common/utils/logging';
// Config constants
import { LOVELACES_PER_ADA } from '../config/numbersConfig';
import {
REDEEM_ITN_REWARDS_AMOUNT,
DELEGATION_DEPOSIT,
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE,
REWARDS_REDEMPTION_FEE_CALCULATION_AMOUNT,
} from '../config/stakingConfig';
import {
ADA_CERTIFICATE_MNEMONIC_LENGTH,
Expand Down Expand Up @@ -195,6 +196,7 @@ import { getNewsHash } from './news/requests/getNewsHash';
import { deleteTransaction } from './transactions/requests/deleteTransaction';
import { WALLET_BYRON_KINDS } from '../config/walletRestoreConfig';
import ApiError from '../domains/ApiError';
import { formattedAmountToLovelace } from '../utils/formatters';

const { isIncentivizedTestnet } = global;

Expand Down Expand Up @@ -740,7 +742,8 @@ export default class AdaApi {
);
const fee = _createTransactionFeeFromServerData(response);
const amountWithFee = formattedTxAmount.plus(fee);
if (amountWithFee.gt(walletBalance)) {
const isRewardsRedemptionRequest = Array.isArray(withdrawal);
if (!isRewardsRedemptionRequest && amountWithFee.gt(walletBalance)) {
// Amount + fees exceeds walletBalance:
// = show "Not enough Ada for fees. Try sending a smaller amount."
throw new ApiError().result('cannotCoverFee');
Expand Down Expand Up @@ -1584,12 +1587,22 @@ export default class AdaApi {
request: GetRedeemItnRewardsFeeRequest
): Promise<GetRedeemItnRewardsFeeResponse> => {
const { address, wallet, recoveryPhrase: withdrawal } = request;
const amount = REDEEM_ITN_REWARDS_AMOUNT;
const {
id: walletId,
amount: walletBalance,
availableAmount: availableBalance,
} = wallet;
const minRewardsReceiverBalance = new BigNumber(
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE
);
// Amount is set to either wallet's balance in case balance is less than 3 ADA or 1 ADA in order to avoid min UTXO affecting transaction fees calculation
const amount = walletBalance.lessThan(
minRewardsReceiverBalance.times(
MIN_REWARDS_REDEMPTION_RECEIVER_BALANCE * 3
)
)
? formattedAmountToLovelace(walletBalance.toString())
: REWARDS_REDEMPTION_FEE_CALCULATION_AMOUNT;
const payload = {
address,
walletId,
Expand Down Expand Up @@ -1618,7 +1631,7 @@ export default class AdaApi {
spendingPassword: passphrase,
recoveryPhrase: withdrawal,
} = request;
const amount = REDEEM_ITN_REWARDS_AMOUNT;
const amount = REWARDS_REDEMPTION_FEE_CALCULATION_AMOUNT;
try {
const data = {
payments: [
Expand Down Expand Up @@ -1756,6 +1769,7 @@ export default class AdaApi {
);
const stakePools = response
.filter(({ metadata }: AdaApiStakePool) => metadata !== undefined)
.filter(({ flags }: AdaApiStakePool) => !flags.includes('delisted'))
.filter(
({ margin }: AdaApiStakePool) =>
margin !== undefined && margin.quantity < 100
Expand Down
4 changes: 4 additions & 0 deletions source/renderer/app/api/staking/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export type DelegationAction =
| 'removeDelegation'
| 'delegate';

export type AdaApiStakePoolFlag = 'delisted';
export type AdaApiStakePoolFlags = Array<AdaApiStakePoolFlag>;

export type AdaApiStakePool = {
id: string,
metrics: {
Expand Down Expand Up @@ -47,6 +50,7 @@ export type AdaApiStakePool = {
epoch_number: number,
epoch_start_time: string,
},
flags: AdaApiStakePoolFlags,
};
export type AdaApiStakePools = Array<AdaApiStakePool>;

Expand Down
4 changes: 1 addition & 3 deletions source/renderer/app/assets/images/circle-bg-faded.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions source/renderer/app/assets/images/untada.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 31 additions & 1 deletion source/renderer/app/components/news/NewsFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,26 @@ export default class NewsFeed extends Component<Props, State> {
};

scrollableDomElement: ?HTMLElement = null;
newsFeedRef = React.createRef<HTMLElement>();
newsFeedOpenedAt: number;

componentDidMount() {
document.addEventListener('click', this.handleWindowClick);
this.scrollableDomElement = document.querySelector(
SCROLLABLE_DOM_ELEMENT_SELECTOR
);
if (!(this.scrollableDomElement instanceof HTMLElement)) return;
this.scrollableDomElement.addEventListener('scroll', this.handleOnScroll);
}

componentDidUpdate(prevProps: Props) {
if (!prevProps.isNewsFeedOpen && this.props.isNewsFeedOpen) {
this.newsFeedOpenedAt = Date.now();
}
}

componentWillUnmount() {
document.removeEventListener('click', this.handleWindowClick);
if (this.scrollableDomElement) {
this.scrollableDomElement.removeEventListener(
'scroll',
Expand All @@ -87,6 +97,26 @@ export default class NewsFeed extends Component<Props, State> {
}
}

handleWindowClick = (event: MouseEvent) => {
const newsFeedElement = this.newsFeedRef.current;
const clickedElement = event.target;
const { isNewsFeedOpen } = this.props;
// Detect clicks outside of the newsfeed container
if (
isNewsFeedOpen &&
newsFeedElement &&
clickedElement instanceof Node &&
!newsFeedElement.contains(clickedElement)
) {
// This is necessary otherwise the UI click on the newsfeed bell icon
// would immediately close the newsfeed again
const msSinceNewsFeedOpened = Date.now() - this.newsFeedOpenedAt;
if (msSinceNewsFeedOpened > 100) {
this.props.onClose();
}
}
};

handleOnScroll = () => {
const { hasShadow: currentHasShadow } = this.state;

Expand Down Expand Up @@ -155,7 +185,7 @@ export default class NewsFeed extends Component<Props, State> {
]);

return (
<div className={componentClasses}>
<div className={componentClasses} ref={this.newsFeedRef}>
<div className={newsFeedHeaderStyles}>
<h3 className={styles.newsFeedTitle}>
{intl.formatMessage(messages.newsFeedTitle)}
Expand Down
2 changes: 1 addition & 1 deletion source/renderer/app/components/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styles from './Sidebar.scss';
import SidebarCategory from './SidebarCategory';
import SidebarCategoryNetworkInfo from './SidebarCategoryNetworkInfo';
import SidebarWalletsMenu from './wallets/SidebarWalletsMenu';
import { CATEGORIES_BY_NAME } from '../../config/sidebarConfig.js';
import { CATEGORIES_BY_NAME } from '../../config/sidebarConfig';
import { ROUTES } from '../../routes-config';
import type { networkType } from '../../types/networkTypes';
import type { SidebarCategoryInfo } from '../../config/sidebarConfig';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import BorderedBox from '../../widgets/BorderedBox';
import LoadingSpinner from '../../widgets/LoadingSpinner';
import StakingEpochsCurrentEpochData from './StakingEpochsCurrentEpochData';
import StakingEpochsPreviousEpochData from './StakingEpochsPreviousEpochData';
import { SELECTED_EPOCH_OPTIONS, humanizeDurationToShort } from './helpers.js';
import { SELECTED_EPOCH_OPTIONS, humanizeDurationToShort } from './helpers';
import type { EpochData } from '../../../api/staking/types';
import styles from './StakingEpochs.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
noDataExisting,
hasDataExisting,
sortData,
} from './helpers.js';
} from './helpers';
import type { EpochData } from '../../../api/staking/types';
import styles from './StakingEpochs.scss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
noDataExisting,
hasDataExisting,
sortData,
} from './helpers.js';
} from './helpers';
import type { EpochData } from '../../../api/staking/types';
import styles from './StakingEpochs.scss';
import globalMessages from '../../../i18n/global-messages';
Expand Down
Loading

0 comments on commit 089546a

Please sign in to comment.