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.
[sui-verifier] Small cleanup + comments (MystenLabs#3076)
* [sui-verifier] Small cleanup + comments - Removed id_immutable pass, it is covered by `VersionedID` not having `drop` - Removed check for types with `key` not having `drop`, it is covered by `VersionedID` - Added doc comment to `struct_with_key_verifier` * Update crates/sui-verifier/src/struct_with_key_verifier.rs Co-authored-by: Sam Blackshear <[email protected]>
- Loading branch information
1 parent
7ff03e1
commit d50faf8
Showing
11 changed files
with
49 additions
and
81 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...erifier-transactional-tests/tests/id_immutable/mut_borrow_generic_key_struct_id_field.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-18: | ||
Error: Transaction Effects Status: MiscellaneousError | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: ModuleVerificationFailure, source: Some("In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.") } } | ||
created: object(103) | ||
written: object(102) |
4 changes: 2 additions & 2 deletions
4
...es/sui-verifier-transactional-tests/tests/id_immutable/mut_borrow_key_struct_id_field.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-18: | ||
Error: Transaction Effects Status: MiscellaneousError | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: ModuleVerificationFailure, source: Some("In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.") } } | ||
created: object(103) | ||
written: object(102) |
5 changes: 5 additions & 0 deletions
5
crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.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,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-20: | ||
Error: Transaction Effects Status: MiscellaneousError | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VmError, source: Some(VMError { major_status: WRITEREF_WITHOUT_DROP_ABILITY, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(FunctionDefinition, 0)], offsets: [(FunctionDefinitionIndex(0), 5)] }) } } |
20 changes: 20 additions & 0 deletions
20
crates/sui-verifier-transactional-tests/tests/id_immutable/write_id_field.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, id: id.VersionedID) { | ||
let x: &mut id.VersionedID; | ||
label l0: | ||
x = &mut (&mut f).Foo::id; | ||
*move(x) = move(id); | ||
abort 0; | ||
} | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
crates/sui-verifier-transactional-tests/tests/struct_with_key/key_struct_with_drop.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-10: | ||
task 0 'publish'. lines 4-11: | ||
Error: Transaction Effects Status: MiscellaneousError | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: ModuleVerificationFailure, source: Some("Struct S cannot have both key and drop abilities") } } | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VmError, source: Some(VMError { major_status: FIELD_MISSING_TYPE_ABILITY, sub_status: None, message: None, exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [(StructDefinition, 0)], offsets: [] }) } } |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
module 0x0.m { | ||
import 0x2.id; | ||
struct S has key, drop { | ||
id: id.VersionedID, | ||
flag: bool | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
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