Closed kpob closed 5 months ago
The recent changes primarily enhance error handling and improve feature management across various components. Key modifications include refining command line options, updating function return types to use Result
for better error propagation, and adding the anyhow
dependency for more robust error context management. These updates collectively aim to make the system more resilient and maintainable.
File Path | Change Summary |
---|---|
examples/.env.sample |
Changed command line option from --feature livenet to --features livenet . |
odra-casper/livenet-env/src/livenet_contract_env.rs |
Modified get_value function to include .ok() for improved error handling. |
odra-casper/livenet-env/src/livenet_host.rs |
Updated get_events_count function to handle None case using unwrap_or_default() . |
odra-casper/rpc-client/Cargo.toml |
Added anyhow dependency version 1.0.86 . |
odra-casper/rpc-client/src/casper_client.rs |
Added anyhow::Context and anyhow::Result imports, and changed various function return types to Result . |
sequenceDiagram
participant User
participant LivenetContractEnv
participant CasperClient
User->>LivenetContractEnv: get_value()
LivenetContractEnv->>CasperClient: get_value()
CasperClient-->>LivenetContractEnv: Result<Value, Error>
LivenetContractEnv-->>User: Option<Value>
User->>LivenetHost: get_events_count()
LivenetHost->>CasperClient: events_count()
CasperClient-->>LivenetHost: Result<Option<u32>, Error>
LivenetHost-->>User: u32 (using unwrap_or_default)
In code's deep forest, changes bloom, With
anyhow
to chase the gloom. FromOption
's nest toResult
's flight, Error handling now feels right. Features toggled, commands refined, A smoother path for all to find. 🐇✨
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
Chores
anyhow
dependency for enhanced error context handling.