pub fn type_check(&self, param_type: &ParamType) -> bool {
		match *self {
			Token::Address(_) => *param_type == ParamType::Address,
			Token::Bytes(_) => *param_type == ParamType::Bytes,
			Token::Int(_) => {
				matches!(*param_type, ParamType::Int(_))
			}
			Token::Uint(_) => {
				matches!(*param_type, ParamType::Uint(_))
			}
			Token::Bool(_) => *param_type == ParamType::Bool,
			Token::String(_) => *param_type == ParamType::String,
			Token::FixedBytes(ref bytes) => {
				if let ParamType::FixedBytes(size) = *param_type {
					size >= bytes.len()
				} else {
					false
				}
			}
			Token::Array(ref tokens) => {
				if let ParamType::Array(ref param_type) = *param_type {
					tokens.iter().all(|t| t.type_check(param_type))
				} else {
					false
				}
			}
			Token::FixedArray(ref tokens) => {
				if let ParamType::FixedArray(ref param_type, size) = *param_type {
					size == tokens.len() && tokens.iter().all(|t| t.type_check(param_type))
				} else {
					false
				}
			}
			Token::Tuple(ref tokens) => {
				if let ParamType::Tuple(ref param_type) = *param_type {
					tokens.iter().enumerate().all(|(i, t)| t.type_check(&param_type[i]))
				} else {
					false
				}
			}
		}
	}
/// Check whether the type of the token matches the given parameter type.
///
/// Numeric types (`Int` and `Uint`) type check if the size of the token
/// type is of greater or equal size than the provided parameter type.
Check whether the type of the token matches the given parameter type.
Numeric types (`Int` and `Uint`) type check if the size of the token
type is of greater or equal size than the provided parameter type.
Check whether the type of the token matches the given parameter type . Numeric types ( ` Int ` and ` Uint ` ) type check if the size of the token type is of greater or equal size than the provided parameter type .
pub fn type_check(&self, param_type: &ParamType) -> bool {
		match *self {
			Token::Address(_) => *param_type == ParamType::Address,
			Token::Bytes(_) => *param_type == ParamType::Bytes,
			Token::Int(_) => {
				matches!(*param_type, ParamType::Int(_))
			}
			Token::Uint(_) => {
				matches!(*param_type, ParamType::Uint(_))
			}
			Token::Bool(_) => *param_type == ParamType::Bool,
			Token::String(_) => *param_type == ParamType::String,
			Token::FixedBytes(ref bytes) => {
				if let ParamType::FixedBytes(size) = *param_type {
					size >= bytes.len()
				} else {
					false
				}
			}
			Token::Array(ref tokens) => {
				if let ParamType::Array(ref param_type) = *param_type {
					tokens.iter().all(|t| t.type_check(param_type))
				} else {
					false
				}
			}
			Token::FixedArray(ref tokens) => {
				if let ParamType::FixedArray(ref param_type, size) = *param_type {
					size == tokens.len() && tokens.iter().all(|t| t.type_check(param_type))
				} else {
					false
				}
			}
			Token::Tuple(ref tokens) => {
				if let ParamType::Tuple(ref param_type) = *param_type {
					tokens.iter().enumerate().all(|(i, t)| t.type_check(&param_type[i]))
				} else {
					false
				}
			}
		}
	}
pub fn type_check ( & self , param_type : & ParamType ) -> bool { match * self { Token :: Address ( _ ) => * param_type == ParamType :: Address , Token :: Bytes ( _ ) => * param_type == ParamType :: Bytes , Token :: Int ( _ ) => { matches ! ( param_type ParamType Int ( ) ) } Token :: Uint ( _ ) => { matches ! ( param_type ParamType Uint ( ) ) } Token :: Bool ( _ ) => * param_type == ParamType :: Bool , Token :: String ( _ ) => * param_type == ParamType :: String , Token :: FixedBytes ( ref bytes ) => { if let ParamType :: FixedBytes ( size ) = * param_type { size >= bytes . len ( ) } else { false } } Token :: Array ( ref tokens ) => { if let ParamType :: Array ( ref param_type ) = * param_type { tokens . iter ( ) . all ( | t | t . type_check ( param_type ) ) } else { false } } Token :: FixedArray ( ref tokens ) => { if let ParamType :: FixedArray ( ref param_type , size ) = * param_type { size == tokens . len ( ) && tokens . iter ( ) . all ( | t | t . type_check ( param_type ) ) } else { false } } Token :: Tuple ( ref tokens ) => { if let ParamType :: Tuple ( ref param_type ) = * param_type { tokens . iter ( ) . enumerate ( ) . all ( | ( i , t ) | t . type_check ( & param_type [ i ] ) ) } else { false } } } }
Check whether the type of the token matches the given parameter type.
Check whether the type of the token matches the given parameter type .
&self
param_type
&ParamType