From dbfef6d6cb1e9822adc8adfe0f9349c84732d519 Mon Sep 17 00:00:00 2001 From: steelgeek091 <130330379+steelgeek091@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:06:14 +0800 Subject: [PATCH] The generic struct is not allowed except for the Option type. (#1811) --- moveos/moveos-verifier/src/metadata.rs | 4 ++++ moveos/moveos-verifier/src/verifier.rs | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/moveos/moveos-verifier/src/metadata.rs b/moveos/moveos-verifier/src/metadata.rs index b6c2876a97..01506492a1 100644 --- a/moveos/moveos-verifier/src/metadata.rs +++ b/moveos/moveos-verifier/src/metadata.rs @@ -1102,6 +1102,10 @@ fn check_data_struct_fields_type( return false; } + if !ty_args.is_empty() { + return false; + } + if !is_data_struct_annotation(&struct_env, module_env) { return false; } diff --git a/moveos/moveos-verifier/src/verifier.rs b/moveos/moveos-verifier/src/verifier.rs index 5873814e31..5907757277 100644 --- a/moveos/moveos-verifier/src/verifier.rs +++ b/moveos/moveos-verifier/src/verifier.rs @@ -1335,15 +1335,7 @@ where ); } } - - validate_struct( - &struct_full_name, - struct_handle_idx, - current_module, - module_bin_view, - verified_modules, - db, - ) + (false, ErrorCode::INVALID_DATA_STRUCT_NOT_ALLOWED_TYPE) } _ => (false, ErrorCode::INVALID_DATA_STRUCT_NOT_ALLOWED_TYPE), }