Open pauldelucia opened 1 month ago
The changes in this pull request involve significant modifications to the application state management and error handling mechanisms across multiple files. The AppState
structure now allows for an optional mainnet_app_context
, necessitating updates to initialization logic and context handling. The Config
struct has been enhanced with error reporting capabilities, while the AppContext
struct has been updated to handle configuration loading errors gracefully. Additionally, the NetworkChooserScreen
has been adjusted to accommodate the new optional context types, improving overall robustness and error handling.
File | Change Summary |
---|---|
src/app.rs |
Updated AppState struct to have mainnet_app_context as Option<Arc<AppContext>> . Refactored initialization logic to handle optional contexts. Updated current_app_context method for error handling. |
src/config.rs |
Modified load method to return Result<Self, ConfigError> . Introduced ConfigError enum for error handling during configuration loading. |
src/context.rs |
Updated AppContext::new method to handle errors from Config::load() using a match statement, ensuring the application exits on configuration errors. |
src/ui/network_chooser_screen.rs |
Changed mainnet_app_context to Option<Arc<AppContext>> . Updated constructor and methods to handle optional contexts, improving error handling and control flow. |
src/config.rs
regarding the error handling mechanism and the load
method are related to the main PR's updates in src/app.rs
, as both involve handling optional contexts and improving error reporting during configuration loading.src/app.rs
that enhance the initialization logic of AppState
and the handling of contexts are directly related to the changes made in the main PR, specifically regarding the initialization of mainnet_app_context
.In the burrow where changes bloom,
AppState's context finds more room.
Optional paths now softly tread,
Error handling, no more dread.
With screens that choose the way to go,
Our app hops high, with a joyful glow! 🐇✨
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?
Allow users to load the app with configs for testnet only (and no configs for mainnet)
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Refactor