From de1bb44a1e7e93b7ca0e6a04f00117c4112163ae Mon Sep 17 00:00:00 2001 From: David Hernando Date: Thu, 11 Apr 2024 15:01:46 +0200 Subject: [PATCH] return invalid error instead of None (#133) --- cep18/src/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cep18/src/utils.rs b/cep18/src/utils.rs index 60ecbfa..bb6d74a 100644 --- a/cep18/src/utils.rs +++ b/cep18/src/utils.rs @@ -108,7 +108,8 @@ pub fn get_optional_named_arg_with_user_errors( ) -> Option { match get_named_arg_with_user_errors::(name, Cep18Error::Phantom, invalid) { Ok(val) => Some(val), - Err(_) => None, + Err(Cep18Error::Phantom) => None, + Err(_) => runtime::revert(invalid), } }