Skip to content

Commit

Permalink
The generic struct is not allowed except for the Option type. (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
steelgeek091 authored Jun 4, 2024
1 parent f5d183a commit dbfef6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions moveos/moveos-verifier/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 1 addition & 9 deletions moveos/moveos-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down

0 comments on commit dbfef6d

Please sign in to comment.