Closed Nick-1979 closed 1 month ago
The recent updates across multiple components in the Polkadot extension primarily enhance type safety, improve handling of staking inputs, and streamline import structures. A new StakingInputs
type has been introduced to replace the previous Inputs
type, allowing for more specific input structures in staking operations. Additionally, minor formatting adjustments have been made to improve code readability, alongside modifications to error handling and optional chaining for API interactions.
Files | Change Summary |
---|---|
packages/extension-polkagate/src/components/AccountHolder.tsx AccountHolderWithProxy.tsx |
Updated address prop type from string to string | undefined for flexibility. Minor formatting changes for readability. |
packages/extension-polkagate/src/components/SignArea2.tsx |
Changed extraInfo prop type from required to optional, enhancing flexibility. Added space in the export statement for readability. |
packages/extension-polkagate/src/fullscreen/stake/**/* |
Removed Inputs interface, introduced StakingInputs type for improved structure across various components. Adjusted type imports and state variables accordingly. |
packages/extension-polkagate/src/hooks/**/* |
Updated function signatures and parameter types for improved type safety. Removed // @ts-nocheck to enable TypeScript checks. |
packages/extension-polkagate/src/fullscreen/stake/type.ts |
Introduced StakingInputs interface defining structure for staking inputs, enhancing clarity for handling staking operations. |
packages/extension-polkagate/src/popup/staking/partial/SelectValidatorsReview.tsx |
Streamlined import statements; minor formatting changes for the Review component function signature, enhancing code clarity. |
sequenceDiagram
participant User
participant API
participant Component
participant State
User->>Component: Initiate staking operation
Component->>State: Set inputs using StakingInputs
State-->>Component: Return updated state
Component->>API: Call staking function with inputs
API-->>Component: Return transaction result
Component-->>User: Display staking result
π° In fields of green, I hop and play,
With types refined, letβs seize the day!
Staking safe, inputs neat,
In our code, we find the beat!
Hooray for changes, letβs all cheer,
For clarity blooms, spring is here! πΌ
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?
Summary by CodeRabbit
New Features
StakingInputs
interface to enhance the structure of staking-related inputs.Bug Fixes
.catch(console.error)
to log potential errors.Documentation
Style