Skip to content

Commit 39b5883

Browse files
committed
Merges develop
2 parents e3966ba + 98bebf5 commit 39b5883

File tree

14 files changed

+108
-101
lines changed

14 files changed

+108
-101
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## vNext
4+
5+
### Features
6+
7+
- Removed "Alonzo tada" icon and "Alonzo countdown" screen ([PR 2708](https://github.com/input-output-hk/daedalus/pull/2708))
8+
9+
### Fixes
10+
11+
- Fixed transaction timestamps localization ([PR 2702](https://github.com/input-output-hk/daedalus/pull/2702))
12+
13+
### Chores
14+
15+
- Added hardware wallet support for all non-public testnets ([PR 2672](https://github.com/input-output-hk/daedalus/pull/2672))
16+
317
## 4.4.1
418

519
### Fixes

source/common/types/cardano-node.types.js

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
// @flow
2+
import {
3+
MAINNET,
4+
TESTNET,
5+
STAGING,
6+
SHELLEY_QA,
7+
ALONZO_PURPLE,
8+
SELFNODE,
9+
} from './environment.types';
10+
211
export type TlsConfig = {
312
hostname: string,
413
port: number,
@@ -142,17 +151,26 @@ export type CardanoStatus = {
142151
cardanoWalletPID: number,
143152
};
144153

145-
// Cardano Mainet network magic
146-
export const MAINNET_MAGIC = [1, null];
147-
148-
// Cardano Byron Testnet network magic
149-
export const TESTNET_MAGIC = [1097911063, 0];
150-
151-
// Cardano Staging network magic
152-
export const STAGING_MAGIC = [633343913, 1];
154+
export type NetworkMagicType = Array<?number>;
153155

154-
// Cardano Alonzo Purple network magic
155-
export const ALONZO_PURPLE_MAGIC = [8, 0];
156-
157-
// Cardano Selfnode network magic
158-
export const SELFNODE_MAGIC = MAINNET_MAGIC;
156+
export const NetworkMagics: {
157+
mainnet: NetworkMagicType,
158+
testnet: NetworkMagicType,
159+
staging: NetworkMagicType,
160+
alonzo_purple: NetworkMagicType,
161+
shelley_qa: NetworkMagicType,
162+
selfnode: NetworkMagicType,
163+
} = {
164+
// Cardano Mainet network magic
165+
[MAINNET]: [1, null],
166+
// Cardano Staging network magic
167+
[STAGING]: [633343913, 1],
168+
// Cardano Byron Testnet network magic
169+
[TESTNET]: [1097911063, 0],
170+
// Cardano Alonzo Purple network magic
171+
[ALONZO_PURPLE]: [8, 0],
172+
// Cardano Shelley QA network magic
173+
[SHELLEY_QA]: [3, 0],
174+
// Cardano Selfnode network magic
175+
[SELFNODE]: [1, null],
176+
};

source/common/types/environment.types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type Environment = {
1212
isStaging: boolean,
1313
isTestnet: boolean,
1414
isAlonzoPurple: boolean,
15+
isShelleyQA: boolean,
1516
isSelfnode: boolean,
1617
isDevelopment: boolean,
1718
isWatchMode: boolean,

source/common/utils/environmentCheckers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { upperFirst } from 'lodash';
33
import {
44
ALONZO_PURPLE,
5+
SHELLEY_QA,
56
DEVELOPMENT,
67
LINUX,
78
MAC_OS,
@@ -54,6 +55,7 @@ export const checkIsMainnet = (network: string) => network === MAINNET;
5455
export const checkIsTestnet = (network: string) => network === TESTNET;
5556
export const checkIsAlonzoPurple = (network: string) =>
5657
network === ALONZO_PURPLE;
58+
export const checkIsShelleyQA = (network: string) => network === SHELLEY_QA;
5759
export const checkIsStaging = (network: string) => network === STAGING;
5860
export const checkIsSelfnode = (network: string) => network === SELFNODE;
5961
export const checkIsDevelopment = (network: string) => network === DEVELOPMENT;

source/main/environment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DEVELOPMENT, OS_NAMES } from '../common/types/environment.types';
77
import {
88
evaluateNetwork,
99
checkIsAlonzoPurple,
10+
checkIsShelleyQA,
1011
checkIsDev,
1112
checkIsTest,
1213
checkIsProduction,
@@ -34,6 +35,7 @@ const isMainnet = checkIsMainnet(NETWORK);
3435
const isStaging = checkIsStaging(NETWORK);
3536
const isTestnet = checkIsTestnet(NETWORK);
3637
const isAlonzoPurple = checkIsAlonzoPurple(NETWORK);
38+
const isShelleyQA = checkIsShelleyQA(NETWORK);
3739
const isSelfnode = checkIsSelfnode(NETWORK);
3840
const isDevelopment = checkIsDevelopment(NETWORK);
3941
const isWatchMode = process.env.IS_WATCH_MODE;
@@ -75,6 +77,7 @@ export const environment: Environment = Object.assign(
7577
isStaging,
7678
isTestnet,
7779
isAlonzoPurple,
80+
isShelleyQA,
7881
isSelfnode,
7982
isDevelopment,
8083
isWatchMode,

source/renderer/app/Routes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import WalletTokensPage from './containers/wallet/WalletTokensPage';
3434
import WalletSettingsPage from './containers/wallet/WalletSettingsPage';
3535
import WalletUtxoPage from './containers/wallet/WalletUtxoPage';
3636
import VotingRegistrationPage from './containers/voting/VotingRegistrationPage';
37+
import { IS_STAKING_INFO_PAGE_AVAILABLE } from './config/stakingConfig';
3738

3839
export const Routes = withRouter(() => (
3940
<Route path={ROUTES.ROOT}>
@@ -145,7 +146,9 @@ export const Routes = withRouter(() => (
145146
component={StakingRewardsPage}
146147
/>
147148
<Route path={ROUTES.STAKING.EPOCHS} component={StakingEpochsPage} />
148-
<Route path={ROUTES.STAKING.INFO} component={StakingInfoPage} />
149+
{IS_STAKING_INFO_PAGE_AVAILABLE && (
150+
<Route path={ROUTES.STAKING.INFO} component={StakingInfoPage} />
151+
)}
149152
</Staking>
150153
<Route
151154
path={ROUTES.REDEEM_ITN_REWARDS}

source/renderer/app/components/wallet/transactions/Transaction.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ export default class Transaction extends Component<Props, State> {
576576
<div className={styles.details}>
577577
<div className={styles.type}>
578578
{intl.formatMessage(messages.type, { typeOfTransaction })},{' '}
579-
{moment(data.date).format(currentTimeFormat)}
579+
{moment(data.date)
580+
.locale(intl.locale)
581+
.format(currentTimeFormat)}
580582
</div>
581583
{this.renderTxnStateTag()}
582584
</div>

source/renderer/app/config/hardwareWalletsConfig.js

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
const { isMainnet, isTestnet } = global.environment;
1+
// @flow
2+
import { get, map } from 'lodash';
3+
import { NetworkMagics } from '../../../common/types/cardano-node.types';
4+
import type { NetworkMagicType } from '../../../common/types/cardano-node.types';
5+
import type { Network } from '../../../common/types/environment.types';
26

37
export const HARDENED_HEX = 0x80000000;
48
export const HARDENED = 2147483648;
@@ -7,25 +11,18 @@ export const BYRON_PURPOSE_INDEX = 44;
711
export const ADA_COIN_TYPE = 1815;
812
export const DEFAULT_ADDRESS_INDEX = 0;
913

14+
const { isMainnet, isStaging, isSelfnode } = global.environment;
15+
const hardwareWalletNetworksConfig = {};
16+
map(NetworkMagics, (networkMagic: NetworkMagicType, network: Network) => {
17+
const isMainnetLikeNetwork = isMainnet || isSelfnode || isStaging;
18+
hardwareWalletNetworksConfig[network] = {
19+
networkId: isMainnetLikeNetwork ? 1 : networkMagic[1],
20+
protocolMagic: isMainnetLikeNetwork ? 764824073 : networkMagic[0],
21+
};
22+
});
23+
1024
export const HW_SHELLEY_CONFIG = {
11-
NETWORK: {
12-
MAINNET: {
13-
name: 'mainnet',
14-
networkId: 1,
15-
protocolMagic: 764824073,
16-
trezorProtocolMagic: 764824073,
17-
eraStartSlot: 4492800,
18-
ttl: 3600,
19-
},
20-
TESTNET: {
21-
name: 'testnet',
22-
networkId: 0,
23-
protocolMagic: 1097911063,
24-
trezorProtocolMagic: 1097911063,
25-
eraStartSlot: 4492800,
26-
ttl: 3600,
27-
},
28-
},
25+
NETWORK: hardwareWalletNetworksConfig,
2926
DEFAULT_DERIVATION_PATH: [
3027
HARDENED + SHELLEY_PURPOSE_INDEX,
3128
HARDENED + ADA_COIN_TYPE,
@@ -41,13 +38,7 @@ export const HW_SHELLEY_CONFIG = {
4138
};
4239

4340
export const HW_BYRON_CONFIG = {
44-
NETWORK: {
45-
MAINNET: {
46-
name: 'mainnet',
47-
networkId: 1,
48-
protocolMagic: 764824073,
49-
},
50-
},
41+
NETWORK: hardwareWalletNetworksConfig,
5142
DEFAULT_DERIVATION_PATH: [
5243
HARDENED + BYRON_PURPOSE_INDEX,
5344
HARDENED + ADA_COIN_TYPE,
@@ -80,6 +71,11 @@ export const isTrezorEnabled = true;
8071
export const isLedgerEnabled = true;
8172

8273
export const isHardwareWalletSupportEnabled =
83-
(isMainnet || isTestnet) && (isTrezorEnabled || isLedgerEnabled);
74+
isTrezorEnabled || isLedgerEnabled;
8475

8576
export const isHardwareWalletIndicatorEnabled = false;
77+
78+
export const getHardwareWalletsNetworkConfig = (network: Network) => {
79+
const networkConfig = get(HW_SHELLEY_CONFIG, ['NETWORK', network], {});
80+
return networkConfig;
81+
};

source/renderer/app/config/stakingConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ export const DELEGATION_ACTIONS: {
117117
export const IS_GRID_REWARDS_VIEW_AVAILABLE = !isMainnet && !isFlight;
118118
export const IS_RANKING_DATA_AVAILABLE = true;
119119
export const IS_SATURATION_DATA_AVAILABLE = true;
120+
export const IS_STAKING_INFO_PAGE_AVAILABLE = false;
120121

121122
export const EPOCH_COUNTDOWN_INTERVAL = 1 * 1000; // 1 second | unit: milliseconds
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @flow
2+
export const IS_TADA_ICON_AVAILABLE = false;

0 commit comments

Comments
 (0)