forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[verifier] Migrate id_leak tests (MystenLabs#2016)
- Migrated to expected output tests
- Loading branch information
Showing
13 changed files
with
152 additions
and
202 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...rifier-transactional-tests/transactional-tests/tests/id_leak/direct_leak_through_call.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 4-25: | ||
Error: Failed to verify the Move module, reason: "ID leak detected in function foo: ID leaked through function call.". |
25 changes: 25 additions & 0 deletions
25
...ifier-transactional-tests/transactional-tests/tests/id_leak/direct_leak_through_call.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,25 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
transfer(id: ID.VersionedID) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
foo(f: Self.Foo, v: &mut vector<ID.VersionedID>) { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
Self.transfer(move(id)); | ||
return; | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...fier-transactional-tests/transactional-tests/tests/id_leak/indirect_leak_through_call.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 4-25: | ||
Error: Failed to verify the Move module, reason: "ID leak detected in function foo: ID leaked through function call.". |
25 changes: 25 additions & 0 deletions
25
...ier-transactional-tests/transactional-tests/tests/id_leak/indirect_leak_through_call.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,25 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
transfer(id: Self.Foo) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
foo(f: Self.Foo, v: &mut vector<ID.VersionedID>) { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
Self.transfer(Foo { id: move(id) }); | ||
return; | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...-verifier-transactional-tests/transactional-tests/tests/id_leak/through_direct_return.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 4-19: | ||
Error: Failed to verify the Move module, reason: "ID leak detected in function foo: ID leaked through function return.". |
19 changes: 19 additions & 0 deletions
19
...verifier-transactional-tests/transactional-tests/tests/id_leak/through_direct_return.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,19 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo): ID.VersionedID { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
return move(id); | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...erifier-transactional-tests/transactional-tests/tests/id_leak/through_indirect_return.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 4-19: | ||
Error: Failed to verify the Move module, reason: "ID leak detected in function foo: ID leaked through function return.". |
19 changes: 19 additions & 0 deletions
19
...rifier-transactional-tests/transactional-tests/tests/id_leak/through_indirect_return.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,19 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo): Self.Foo { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
return Foo { id: move(id) }; | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
.../sui-verifier-transactional-tests/transactional-tests/tests/id_leak/through_reference.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 4-20: | ||
Error: Failed to publish the Move module(s), reason: "VMError with status WRITEREF_WITHOUT_DROP_ABILITY at location Module ModuleId { address: _, name: Identifier(\"M\") } at index 0 for function definition at code offset 5 in function definition 0". |
20 changes: 20 additions & 0 deletions
20
...sui-verifier-transactional-tests/transactional-tests/tests/id_leak/through_reference.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,20 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo, ref: &mut ID.VersionedID) { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
*move(ref) = move(id); | ||
return; | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
crates/sui-verifier-transactional-tests/transactional-tests/tests/id_leak/through_vector.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 4-20: | ||
Error: Failed to verify the Move module, reason: "ID leak detected in function foo: ID is leaked into a vector". |
20 changes: 20 additions & 0 deletions
20
...es/sui-verifier-transactional-tests/transactional-tests/tests/id_leak/through_vector.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,20 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.ID; | ||
|
||
struct Foo has key { | ||
id: ID.VersionedID, | ||
} | ||
|
||
foo(f: Self.Foo, v: &mut vector<ID.VersionedID>) { | ||
let id: ID.VersionedID; | ||
label l0: | ||
Foo { id } = move(f); | ||
vec_push_back<ID.VersionedID>(move(v), move(id)); | ||
return; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.