From 50d9fde8f7d0667fa8aa23230640214a0d0b6b2e Mon Sep 17 00:00:00 2001 From: dylanverstraete Date: Thu, 23 Feb 2023 13:44:12 +0100 Subject: [PATCH] chore: remove serial valdiation --- substrate-node/pallets/pallet-tfgrid/src/node.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/substrate-node/pallets/pallet-tfgrid/src/node.rs b/substrate-node/pallets/pallet-tfgrid/src/node.rs index 5816df042..146017820 100644 --- a/substrate-node/pallets/pallet-tfgrid/src/node.rs +++ b/substrate-node/pallets/pallet-tfgrid/src/node.rs @@ -317,10 +317,6 @@ impl TryFrom for SerialNumber { value.len() <= MAX_SERIAL_NUMBER_LENGTH.saturated_into(), Self::Error::SerialNumberTooLong ); - ensure!( - validate_serial_number(&value), - Self::Error::InvalidSerialNumber - ); Ok(Self(value, PhantomData)) } @@ -351,13 +347,6 @@ impl Clone for SerialNumber { } } -pub fn validate_serial_number(input: &[u8]) -> bool { - input == DEFAULT_SERIAL_NUMBER - || input.iter().all(|c| { - c.is_ascii_alphanumeric() || c.is_ascii_whitespace() || matches!(c, b'-' | b'_' | b'.') - }) -} - #[test] fn test_validate_city_name_works() { assert_eq!(validate_city_name(b"Rio de Janeiro"), true);