-
Notifications
You must be signed in to change notification settings - Fork 5
support Paseo #1401
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
support Paseo #1401
Conversation
add paseo and its asset hub
Warning Review failedThe pull request is closed. WalkthroughThis update primarily enhances versioning, refines handling and display of validator data, incorporates new constants, and heightens type safety across various modules. Notable improvements include the integration of new constants, such as the Paseo Asset Hub, refined state handling, and safer property access methods. These adjustments bolster overall stability and prepare for broader chain support. Changes
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
packages/extension-polkagate/src/hooks/useValidatorSuggestion.ts (1)
Line range hint
19-19
: Fix the optional chaining.Change to an optional chain to handle potential null values.
- const allValidatorsAccountIds = useMemo(() => allValidatorsInfo && allValidatorsInfo.current.concat(allValidatorsInfo.waiting)?.map((v) => v.accountId), [allValidatorsInfo]); + const allValidatorsAccountIds = useMemo(() => allValidatorsInfo?.current.concat(allValidatorsInfo.waiting)?.map((v) => v.accountId), [allValidatorsInfo]);
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (10)
- package.json (1 hunks)
- packages/extension-polkagate/src/fullscreen/stake/easyMode/index.tsx (5 hunks)
- packages/extension-polkagate/src/fullscreen/stake/solo/partials/ShowValidator.tsx (1 hunks)
- packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx (3 hunks)
- packages/extension-polkagate/src/hooks/usePeopleChain.ts (3 hunks)
- packages/extension-polkagate/src/hooks/useValidatorSuggestion.ts (4 hunks)
- packages/extension-polkagate/src/popup/staking/partial/ShowValidator.tsx (1 hunks)
- packages/extension-polkagate/src/util/constants.tsx (4 hunks)
- packages/extension-polkagate/src/util/utils.ts (1 hunks)
- replacements/interfaces.js (4 hunks)
Files skipped from review due to trivial changes (1)
- package.json
Additional context used
Biome
packages/extension-polkagate/src/hooks/useValidatorSuggestion.ts
[error] 19-19: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
[error] 101-101: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
GitHub Check: build
packages/extension-polkagate/src/fullscreen/stake/easyMode/index.tsx
[failure] 72-72:
Argument of type 'Codec' is not assignable to parameter of type 'SetStateAction<Balance | undefined>'.
[failure] 76-76:
Argument of type 'Codec' is not assignable to parameter of type 'SetStateAction<Balance | undefined>'.
Additional comments not posted (31)
packages/extension-polkagate/src/hooks/usePeopleChain.ts (2)
10-10
: Import looks good.The import of
PASEO_GENESIS_HASH
from../util/constants
is appropriate and necessary for the subsequent logic.
36-37
: Case addition looks good.The case for
Paseo
in thegetPeopleChainGenesisHash
function to returnPASEO_GENESIS_HASH
is correctly integrated.replacements/interfaces.js (4)
50-52
: Genesis hash addition looks good.The addition of
paseo
to theknownGenesis
object with the specified genesis hash is correctly integrated.
53-55
: Genesis hash addition looks good.The addition of
paseoAssetHub
to theknownGenesis
object with the specified genesis hash is correctly integrated.
67-74
: Testnet addition looks good.The addition of the Paseo Testnet to the
testnets
array is correctly integrated with the appropriate configuration.
104-110
: Asset Hub addition looks good.The addition of the Paseo Asset Hub to the
assetHubs
array is correctly integrated with the appropriate configuration.packages/extension-polkagate/src/hooks/useValidatorSuggestion.ts (3)
25-25
: Filtering logic update looks good.The update to handle
validatorPrefs.blocked
as a boolean ensures type safety and correct filtering.
40-40
: Sorting logic update looks good.The update to include an optional chaining operator ensures that potential null values are handled correctly.
67-67
: Filtering logic update looks good.The update to include an optional chaining operator ensures that potential null values are handled correctly.
packages/extension-polkagate/src/popup/staking/partial/ShowValidator.tsx (1)
103-103
: Use of Optional Chaining for Null SafetyThe update to use optional chaining (
v.exposure.others?.length
) improves null safety and prevents potential runtime errors ifv.exposure.others
is undefined.packages/extension-polkagate/src/fullscreen/stake/solo/partials/ShowValidator.tsx (1)
111-111
: Use of Optional Chaining for Null SafetyThe update to use optional chaining (
v.exposure.others?.length
) improves null safety and prevents potential runtime errors ifv.exposure.others
is undefined.packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx (4)
10-10
: Use of Optional Chaining for Null SafetyThe update to use optional chaining (
v.exposure.others?.length
) improves null safety and prevents potential runtime errors ifv.exposure.others
is undefined.
13-13
: Change Import Statement to Use Type Only ImportsChanging the import statement to use
import type
forDeriveAccountInfo
helps to optimize the code by ensuring that only the type information is imported, which can result in better performance and reduced bundle size.
58-58
: Use of Optional Chaining for Null SafetyThe update to use optional chaining (
v.exposure.others?.sort
) improves null safety and prevents potential runtime errors ifv.exposure.others
is undefined.
62-63
: Use of Optional Chaining for Null SafetyThe update to use optional chaining (
v.exposure.others?.length
) improves null safety and prevents potential runtime errors ifv.exposure.others
is undefined.packages/extension-polkagate/src/fullscreen/stake/easyMode/index.tsx (5)
20-20
: Import POLKAGATE_POOL_IDS from constantsThe constant
POLKAGATE_POOL_IDS
is now imported from../../../util/constants
, which improves maintainability by centralizing constant definitions.
34-34
: Type assertion for chainNameThe type assertion
chainName as string
ensures thatchainName
is treated as a string, which can help prevent type errors.
39-39
: Bracket notation for dynamic propertyUsing bracket notation
inputs?.extraInfo?.['amount']
ensures that theamount
property is correctly accessed, especially if it is dynamic or contains special characters.
52-52
: Bracket notation for dynamic propertyUsing bracket notation
inputs?.extraInfo?.['amount']
ensures that theamount
property is correctly accessed for calculatingisBusy
.
100-100
: Simplified console logThe console log statement is simplified to
console.log('waiting for pool:', pool);
, reducing noise in the console output.packages/extension-polkagate/src/util/constants.tsx (10)
10-15
: New constant for pool IDsThe
POLKAGATE_POOL_IDS
constant is added to store pool IDs for Kusama, Polkadot, Westend, and Paseo. This centralizes the pool ID definitions and improves maintainability.
42-42
: New constant for Paseo Asset Hub genesis hashThe
PASEO_ASSET_HUB_GENESIS_HASH
constant is added, which is necessary for identifying the Paseo Asset Hub.
49-49
: Updated relay chains namesThe
RELAY_CHAINS_NAMES
array is updated to include Paseo, ensuring that Paseo is recognized as a relay chain.
55-55
: New constant for Paseo genesis hashThe
PASEO_GENESIS_HASH
constant is added, which is necessary for identifying the Paseo chain.
61-61
: Updated relay chains genesis hashesThe
RELAY_CHAINS_GENESISHASH
array is updated to includePASEO_GENESIS_HASH
, ensuring that Paseo's genesis hash is recognized.
68-68
: Updated asset hubsThe
ASSET_HUBS
array is updated to includePASEO_ASSET_HUB_GENESIS_HASH
, ensuring that Paseo Asset Hub is recognized.
76-76
: Updated test netsThe
TEST_NETS
array is updated to includePASEO_GENESIS_HASH
andPASEO_ASSET_HUB_GENESIS_HASH
, ensuring that both Paseo and Paseo Asset Hub are recognized as test nets.
83-83
: Updated proxy chainsThe
PROXY_CHAINS
array is updated to includePASEO_GENESIS_HASH
, ensuring that Paseo is recognized as a proxy chain.
108-108
: Updated staking chainsThe
STAKING_CHAINS
array is updated to includePASEO_GENESIS_HASH
, ensuring that Paseo is recognized as a staking chain.
153-153
: Updated chain proxy typesThe
CHAIN_PROXY_TYPES
object is updated to includeAssetHubs
, ensuring that AssetHubs are recognized as a proxy type.packages/extension-polkagate/src/util/utils.ts (1)
339-339
: Updated sanitizeChainName functionThe
sanitizeChainName
function is updated to include replacement for' Testnet'
, ensuring that ' Testnet' is removed from chain names.
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx (3 hunks)
Additional context used
Biome
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
[error] 101-101: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
GitHub Check: build
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
[failure] 98-98:
'v' is possibly 'undefined'.
[failure] 99-99:
Argument of type 'ValidatorInfo | undefined' is not assignable to parameter of type 'ValidatorInfo'.
[failure] 101-101:
Argument of type 'ValidatorInfo | undefined' is not assignable to parameter of type 'ValidatorInfo'.
[failure] 102-102:
'v' is possibly 'undefined'.
[failure] 118-118:
Type 'ValidatorInfo | undefined' is not assignable to type 'ValidatorInfo'.
[failure] 120-120:
Argument of type 'ValidatorInfo | undefined' is not assignable to parameter of type 'ValidatorInfo'.
Additional comments not posted (1)
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx (1)
62-63
: Use Optional Chaining for Null SafetyThe use of optional chaining for
v.exposure.others
ensures that the code handles potential null or undefined values gracefully. This is a good practice to avoid runtime errors.
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Outdated
Show resolved
Hide resolved
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- packages/extension-polkagate/src/fullscreen/stake/easyMode/index.tsx (6 hunks)
- packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/extension-polkagate/src/fullscreen/stake/easyMode/index.tsx
Additional context used
Biome
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
[error] 101-101: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Show resolved
Hide resolved
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Show resolved
Hide resolved
packages/extension-polkagate/src/fullscreen/stake/solo/partials/ValidatorsTable.tsx
Show resolved
Hide resolved
Proxy type list issue found |
Fix Paseo proxy type issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/extension-polkagate/src/util/constants.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/extension-polkagate/src/util/constants.tsx
add paseo and its asset hub
Governance is disabled for Paseo atm intentionally
closes #1398
Summary by CodeRabbit
New Features
Enhancements
@polkagate/apps-config
to version^0.140.2
.Bug Fixes
Refactor