Skip to content

Commit

Permalink
chore: mark add_uri as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Nov 8, 2024
1 parent b8a887e commit cea6ca9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/rs-dapi-client/src/address_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ impl AddressList {
self.addresses.insert(address)
}

#[deprecated]
// TODO: Remove in favor of add
/// Add a node [Address] to [AddressList] by [Uri].
/// Returns false if the address is already in the list.
pub fn add_uri(&mut self, uri: Uri) -> bool {
self.addresses.insert(uri.try_into().expect("valid uri"))
}

/// Randomly select a not banned address.
pub fn get_live_address(&self) -> Option<&Address> {
let mut rng = SmallRng::from_entropy();
Expand Down

0 comments on commit cea6ca9

Please sign in to comment.