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

chore: hydraDX renamed to hydration #1582

Merged
merged 2 commits into from
Oct 7, 2024
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
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"@polkadot/types-codec": "^11.2.1",
"@polkadot/types-known": "^11.2.1",
"@polkadot/types-support": "^11.2.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkagate/apps-config": "^0.140.5",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkagate/apps-config": "^0.140.7",
Comment on lines +68 to +70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Deprecated API usages detected in updated @PolkaDot libraries

The following deprecated APIs were found after updating @polkadot/util and @polkadot/util-crypto to version ^13.1.1:

  • packages/extension-polkagate/src/util/workers/getStakingConsts.js: apiAt.consts.staking.maxNominatorRewardedPerValidator is deprecated.
  • packages/extension-polkagate/src/util/types.ts: Controller is deprecated.
  • packages/extension-polkagate/src/util/ledger/base.ts: u2f is deprecated.
  • packages/extension-polkagate/src/fullscreen/stake/type.ts: amount is deprecated and moved to extraInfo.

Please address these deprecated API usages to ensure compatibility with the updated library versions.

🔗 Analysis chain

Verify compatibility with updated @PolkaDot libraries

The dependencies have been updated as follows:

  • @polkadot/util and @polkadot/util-crypto: ^12.6.2 -> ^13.1.1
  • @polkagate/apps-config: ^0.140.5 -> ^0.140.7

While these updates align with the PR objective and likely include necessary changes for renaming "hydraDX" to "hydration", please note the following:

  1. The major version change (12 to 13) for @PolkaDot libraries might introduce breaking changes.
  2. Ensure that your code is compatible with these new versions and that all functionality remains intact after the update.

To verify the impact of these changes, you can run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in @polkadot libraries

# Test: Search for any usage of deprecated or removed APIs
rg --type typescript --type javascript 'deprecated|removed' packages

# Test: Check if there are any TypeScript errors after the update
tsc --noEmit

Length of output: 191


Script:

#!/bin/bash
# Description: Check for breaking changes in @polkadot libraries

# Test: Search for any usage of deprecated or removed APIs in .ts and .js files
rg --glob '*.ts' --glob '*.js' 'deprecated|removed' packages

Length of output: 498

"@substrate/connect": "^0.7.32",
"@vaadin/icons": "^23.2.3",
"babel-plugin-transform-import-meta": "^2.1.1",
Expand Down Expand Up @@ -116,14 +116,14 @@
},
"resolutions": {
"@polkadot/api": "^11.2.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/keyring": "^13.1.1",
"@polkadot/networks": "^13.1.1",
"@polkadot/types": "^11.2.1",
"@polkadot/types-augment": "^11.2.1",
"@polkadot/ui-keyring": "^3.6.6",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-fetch": "^12.6.2",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/x-fetch": "^13.1.1",
"babel-core": "^7.0.0-bridge.0",
"safe-buffer": "^5.2.1",
"typescript": "^5.3.3"
Expand Down
6 changes: 3 additions & 3 deletions packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"@polkadot/extension-dapp": "^0.47.5",
"@polkadot/extension-inject": "^0.47.5",
"@polkadot/keyring": "12.3.2",
"@polkadot/networks": "^12.6.2",
"@polkadot/networks": "^13.1.1",
"@polkadot/phishing": "^0.22.8",
"@polkadot/rpc-provider": "^11.2.1",
"@polkadot/types": "^11.2.1",
"@polkadot/ui-keyring": "^3.6.6",
"@polkadot/ui-settings": "^3.6.6",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"eventemitter3": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
Expand Down
6 changes: 3 additions & 3 deletions packages/extension-chains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"main": "index.js",
"dependencies": {
"@polkadot/extension-inject": "^0.47.5",
"@polkadot/networks": "^12.6.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/networks": "^13.1.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"tslib": "^2.6.2"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/extension-inject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"@polkadot/api": "^11.2.1",
"@polkadot/rpc-provider": "^11.2.1",
"@polkadot/types": "^11.2.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-global": "^12.6.2",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/x-global": "^13.1.1",
"tslib": "^2.6.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface Props {
}

// There are two Bifrost chains, but we only support Polkadot-Bifrost
const SUBSQUARE_SUPPORTED_CHAINS = ['Polkadot', 'Polkadot Collectives', 'Acala', 'Bifrost', 'Centrifuge', 'Darwinia2', 'HydraDX', 'Interlay', 'Litentry', 'Phala', 'Zeitgeist', 'Kusama', 'Altair', 'Basilisk', 'Litmus', 'Karura', 'Khala', 'Turing', 'Kintsugi', 'Curst', 'Rococo'];
const SUBSQUARE_SUPPORTED_CHAINS = ['Polkadot', 'Polkadot Collectives', 'Acala', 'Bifrost', 'Centrifuge', 'Darwinia2', 'Hydration', 'Interlay', 'Litentry', 'Phala', 'Zeitgeist', 'Kusama', 'Altair', 'Basilisk', 'Litmus', 'Karura', 'Khala', 'Turing', 'Kintsugi', 'Curst', 'Rococo'];

export default function ExternalLinks({ address }: Props): React.ReactElement {
const theme = useTheme();
Expand Down
6 changes: 3 additions & 3 deletions packages/extension-polkagate/src/hooks/useAssetsBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const DEFAULT_SAVED_ASSETS = { balances: {} as AssetsBalancesPerAddress, timeSta
export const ASSETS_NAME_IN_STORAGE = 'assets';
const BALANCE_VALIDITY_PERIOD = 1 * 1000 * 60;

const isUpToDate = (date?: number): boolean | undefined => date ? Date.now() - date < BALANCE_VALIDITY_PERIOD : undefined;
export const isUpToDate = (date?: number): boolean | undefined => date ? Date.now() - date < BALANCE_VALIDITY_PERIOD : undefined;

function allHexToBN (balances: object | string | undefined): BalancesDetails | {} {
if (!balances) {
Expand Down Expand Up @@ -489,7 +489,7 @@ export default function useAssetsBalances (accounts: AccountJson[] | null, setAl
const chainName = getChainName(genesisHash);

if (!chainName) {
console.error('can not find chain name by genesis hash!');
console.error('can not find chain name by genesis hash!', genesisHash);

return;
}
Expand All @@ -499,7 +499,7 @@ export default function useAssetsBalances (accounts: AccountJson[] | null, setAl
return fetchAssetOnAssetHubs(addresses!, chainName, assetsToBeFetched);
}

/** Checking assets balances on chains with more than one assets such as Acala, hydradx, etc, */
/** Checking assets balances on chains with more than one assets such as Acala, Hydration, etc, */
if (maybeMultiAssetChainName) {
fetchMultiAssetChainAssets(maybeMultiAssetChainName);
}
Expand Down
1 change: 1 addition & 0 deletions packages/extension-polkagate/src/util/api/getPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import request from 'umi-request';
/** some chains have a different priceId than its sanitizedChainName,
* hence we will replace their price Id using EXTRA_PRICE_IDS */
export const EXTRA_PRICE_IDS: Record<string, string> = {
hydration: 'hydradx',
nodle: 'nodle-network',
parallel: 'parallel-finance',
pendulum: 'pendulum-chain'
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-polkagate/src/util/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const IDENTITY_CHAINS = [
'0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b', // Bifrost
'0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755', // Basilic
'0xb3db41421702df9a7fcac62b53ffeac85f7853cc4e689e0b93aeb3db18c09d82', // Centrifuge
'0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d', // HydraDx
'0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d', // Hydration
'0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b', // Edgeware
'0xe61a41c53f5dcd0beb09df93b34402aada44cb05117b71059cce40a2723a4e97', // Parallel
'0x1bb969d85965e4bb5a651abbedf21a54b6b31a21f66b5401cc3f1e286268d736', // Phala
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const DEFAULT_SELECTED_CHAINS: DropdownOption[] = [
value: '0x9eb76c5184c4ab8679d2d5d819fdf90b9c001403e9e17da2e14b6d8aec4029c6'
},
{
text: 'HydraDX',
text: 'Hydration',
value: '0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d'
},
{
Expand Down
Loading
Loading