From fb61ea9c692a0d2628b2b6cbb8420a40fb875f09 Mon Sep 17 00:00:00 2001 From: KaffinPX Date: Sat, 19 Oct 2024 22:37:55 +0300 Subject: [PATCH] Revert "Address.validate with network (prefix)" --- crypto/addresses/src/lib.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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.