-
Notifications
You must be signed in to change notification settings - Fork 231
feat: add Unit Zero and Unit Zero Testnet networks #669
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughTwo new Ethereum-compatible networks, "Unit Zero" and "Unit Zero Testnet," are added to the supported chains. This involves updating the documentation, extending network enums, creating configuration files for both networks, and registering them in the network provider index for use within the application. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant NetworksIndex
participant UnitZeroConfig
participant UnitZeroTestnetConfig
User->>App: Selects network (Unit Zero or Unit Zero Testnet)
App->>NetworksIndex: Requests network configuration
NetworksIndex->>UnitZeroConfig: If Unit Zero selected, provide config
NetworksIndex->>UnitZeroTestnetConfig: If Unit Zero Testnet selected, provide config
App-->>User: Connects to selected network using provided configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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
🧹 Nitpick comments (3)
packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts (2)
22-22: Variable name should match the network type.The variable name
unitZerodoesn't match the network it represents (testnet). This could lead to confusion, especially since there's another file defining the actual Unit Zero mainnet.-const unitZero = new EvmNetwork(unitZeroTestnetOptions); +const unitZeroTestnet = new EvmNetwork(unitZeroTestnetOptions);
24-24: Export variable name should match network type.The export should use the correct variable name to properly represent the testnet network.
-export default unitZero; +export default unitZeroTestnet;packages/extension/src/providers/ethereum/networks/unitzero.ts (1)
7-7: Remove extra blank line for consistency.There's an unnecessary blank line that could be removed to maintain consistent formatting.
import { EvmNetwork, EvmNetworkOptions } from '../types/evm-network'; - const unitZeroOptions: EvmNetworkOptions = {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
README.md(1 hunks)packages/extension/src/providers/common/libs/new-features.ts(1 hunks)packages/extension/src/providers/ethereum/networks/index.ts(2 hunks)packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts(1 hunks)packages/extension/src/providers/ethereum/networks/unitzero.ts(1 hunks)packages/types/src/networks.ts(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts (2)
packages/extension/src/providers/ethereum/types/evm-network.ts (2)
EvmNetworkOptions(25-56)EvmNetwork(58-293)packages/extension/src/providers/ethereum/libs/activity-handlers/index.ts (1)
EtherscanActivity(10-10)
🪛 LanguageTool
README.md
[grammar] ~119-~119: This phrase is duplicated. You should probably use “Unit Zero” only once.
Context: ...in - Ink Onchain - Unichain - Gravity - Unit Zero - Unit Zero Testnet - More coming soon! Looking to...
(PHRASE_REPETITION)
🔇 Additional comments (8)
packages/extension/src/providers/common/libs/new-features.ts (1)
12-12: LGTM! Network added correctly to newNetworks array.The Unit Zero network has been properly added to the
newNetworksarray, which is used to track newly added networks in the system.README.md (1)
119-120: LGTM! New networks correctly added to supported chains list.Both "Unit Zero" and "Unit Zero Testnet" have been properly added to the list of supported chains in the README. The placement and formatting are consistent with other entries.
🧰 Tools
🪛 LanguageTool
[grammar] ~119-~119: This phrase is duplicated. You should probably use “Unit Zero” only once.
Context: ...in - Ink Onchain - Unichain - Gravity - Unit Zero - Unit Zero Testnet - More coming soon! Looking to...(PHRASE_REPETITION)
packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts (1)
1-20: Configuration for Unit Zero Testnet looks good.The network configuration includes all required properties for an EvmNetwork: name, homepage URL, block explorer URLs, chain ID, currency details, and node URL. The testnet is properly marked with
isTestNetwork: true.packages/extension/src/providers/ethereum/networks/unitzero.ts (1)
1-23: Configuration for Unit Zero mainnet looks good.The network configuration includes all required properties for an EvmNetwork: name, homepage URL, block explorer URLs, chain ID, currency details, and node URL. Additionally, proper coingeckoID and coingeckoPlatform values are included, which is appropriate for mainnet networks.
packages/types/src/networks.ts (2)
109-110: Correctly implemented network name additionsThe new
UnitZeroandUnitZeroTestnetentries have been properly added to the NetworkNames enum following the established pattern in the codebase.
176-177: Coingecko platform identifiers properly addedThe Coingecko platform identifiers for Unit Zero and Unit Zero Testnet follow the existing kebab-case naming convention used throughout the enum.
packages/extension/src/providers/ethereum/networks/index.ts (2)
74-75: Network imports correctly addedThe imports for Unit Zero and Unit Zero Testnet networks are properly defined following the existing import pattern.
159-161: Network exports properly configuredThe Unit Zero and Unit Zero Testnet networks have been correctly added to the exports object. The trailing comma after the
cotientry has been properly added to support the new entries.
Added support for Unit Zero and Unit Zero Testnet networks from the Units Network ecosystem
Summary by CodeRabbit