Open shumkov opened 2 weeks ago
The changes in this pull request primarily focus on enhancing the Address
and AddressList
structures within the rs-dapi-client
module. Key modifications include transitioning from From
to TryFrom
for Address
, updating error handling to improve clarity, and refining the conversion processes. The EvoNode
struct and related test cases have also been adapted to utilize the new Address
type. Additionally, adjustments in the gRPC transport layer have altered error reporting formats. Overall, these changes improve type safety and error handling across the affected components.
File Path | Change Summary |
---|---|
packages/rs-dapi-client/src/address_list.rs |
- Modified FromStr implementation for Address to TryFrom<Uri> with improved error handling. - Updated FromStr for AddressList to parse Address instead of Uri . - Changed InvalidAddressUri to accept String . - Updated from_iter method to accept Address . |
packages/rs-dapi-client/src/transport/grpc.rs |
- Changed error handling in with_uri and with_uri_and_settings methods from failed_precondition to invalid_argument . - Updated error message formatting. |
packages/rs-sdk/examples/read_contract.rs |
- Updated import statement to include Address . - Changed URI construction to use Address directly instead of http::Uri . |
packages/rs-sdk/src/platform/types/evonode.rs |
- Updated example usage to instantiate EvoNode with Address instead of http::Uri . |
packages/rs-sdk/src/sync.rs |
- Expanded AsyncError enum to include Generic(String) . - Updated logic in block_on and retry functions for improved error handling and retry mechanisms. |
packages/rs-sdk/tests/fetch/config.rs |
- Updated import statement to include Address . - Changed variable type from String to Address in address_list method. |
packages/rs-sdk/tests/fetch/evonode.rs |
- Updated tests to replace http::Uri with Address . - Modified error handling in tests to reflect the change to Address . |
Address
and AddressList
structures, affecting how addresses are handled.AddressList
struct, directly related to the changes in the main PR.AddressList
struct, relevant to the main PR's changes.DapiClient
that returns a reference to the address_list
, related to the main PR.Address
and AddressList
.AddressListError
type, enhancing error handling related to address list operations, aligning with the main PR's changes.rs-sdk
, enhancement
🐰 In the land of code where rabbits play,
New structures hop in, brightening the day.
From strings to addresses, we leap with delight,
Error handling's clearer, everything feels right!
With each little change, our code's a bit spry,
A hop and a skip, watch our features fly! 🐇✨
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?
Issue being fixed or feature implemented
New SDK 1.5.1 fails on android with:
What was done?
Address
TransportClient::new_with_uri
AddressList::add_uri
is deprecatedHow Has This Been Tested?
Running tests
Breaking Changes
From<Uri> for Address
replaced withTryFrom<Uri> for Address
From<&str> for AddressList
replaced withFromStr for AddressList
FromIterator<Uri> for AddressList
replaced withFromIterator<Address> for AddressList
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
Release Notes
New Features
Address
type for improved type safety.Bug Fixes
Documentation
Address
type usage.Tests