-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the type depth checking for data_struct. (#1947)
* Add the type depth checking for data_struct * cargo clippy * get the struct definition from correct path * add missed files * The native struct is not allowed
- Loading branch information
1 parent
fafb4bb
commit e74a7f4
Showing
6 changed files
with
324 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ests/tests/cases/mvir_tests/data_struct/data_struct_invalid_over_max_type_depth_limit.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-27: | ||
status ABORTED with code 10019 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
28 changes: 28 additions & 0 deletions
28
...sts/tests/cases/mvir_tests/data_struct/data_struct_invalid_over_max_type_depth_limit.mvir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//# publish | ||
module 0x11.TestModule0 { | ||
// error code 10019: INVALID_DATA_STRUCT_OVER_MAX_TYPE_DEPTH | ||
struct S16 has copy,drop {v: u64} | ||
struct S15 has copy,drop {v: Self.S16} | ||
struct S14 has copy,drop {v: Self.S15} | ||
struct S13 has copy,drop {v: Self.S14} | ||
struct S12 has copy,drop {v: Self.S13} | ||
struct S11 has copy,drop {v: Self.S12} | ||
struct S10 has copy,drop {v: Self.S11} | ||
struct S9 has copy,drop {v: Self.S10} | ||
struct S8 has copy,drop {v: Self.S9} | ||
struct S7 has copy,drop {v: Self.S8} | ||
struct S6 has copy,drop {v: Self.S7} | ||
struct S5 has copy,drop {v: Self.S6} | ||
struct S4 has copy,drop {v: Self.S5} | ||
struct S3 has copy,drop {v: Self.S4} | ||
struct S2 has copy,drop {v: Self.S3} | ||
struct S1 has copy,drop {v: Self.S2} | ||
struct S0 has copy,drop {v: Self.S1} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule0::S0 -> true; | ||
} | ||
} | ||
} | ||
|
4 changes: 4 additions & 0 deletions
4
...sts/cases/mvir_tests/data_struct/data_struct_invalid_vector_over_max_type_depth_limit.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 1-12: | ||
status ABORTED with code 10019 in 0000000000000000000000000000000000000000000000000000000000000002::move_module |
13 changes: 13 additions & 0 deletions
13
...ts/cases/mvir_tests/data_struct/data_struct_invalid_vector_over_max_type_depth_limit.mvir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//# publish | ||
module 0x11.TestModule0 { | ||
// error code 10019: INVALID_DATA_STRUCT_OVER_MAX_TYPE_DEPTH | ||
struct S1 has copy,drop {v: u32} | ||
struct S0 has copy,drop {v: vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<vector<Self.S1>>>>>>>>>>>>>>>>>>} | ||
|
||
metadata { | ||
data_struct { | ||
0x11::TestModule0::S0 -> true; | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters