diff --git a/crypto/addresses/src/lib.rs b/crypto/addresses/src/lib.rs index df98ab399..8aca86386 100644 --- a/crypto/addresses/src/lib.rs +++ b/crypto/addresses/src/lib.rs @@ -230,18 +230,8 @@ impl Address { } #[wasm_bindgen(js_name=validate)] - pub fn validate(address: &str, prefix: Option) -> bool { - let address = Self::try_from(address).ok(); - - if let Some(address) = address { - if let Some(prefix) = prefix { - let prefix = Prefix::try_from(prefix.as_str()).expect("Address::verify() - invalid network prefix"); - return address.prefix == prefix; - } - return true; - } - - false + pub fn validate(address: &str) -> bool { + Self::try_from(address).is_ok() } /// Convert an address to a string.