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.
[adapter][verifier] allow option and ID arguments in entry points (My…
- Loading branch information
Showing
11 changed files
with
189 additions
and
47 deletions.
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.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,7 @@ | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 6-16: | ||
Error: Failed to verify the Move module, reason: "Invalid entry point parameter type. Expected primitive or object type. Got: Std::Option::Option<T0>". | ||
|
||
task 1 'publish'. lines 18-28: | ||
Error: Failed to verify the Move module, reason: "Invalid entry point parameter type. Expected primitive or object type. Got: vector<Std::Option::Option<T0>>". |
28 changes: 28 additions & 0 deletions
28
crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_invalid.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 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// invalid, type parameters with key are not valid when nested as no primitive has key | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.TxContext; | ||
import 0x1.Option; | ||
|
||
public(script) no<T:key>(l0: Option.Option<T>, ctx: &mut TxContext.TxContext) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
} | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.TxContext; | ||
import 0x1.Option; | ||
|
||
public(script) no<T:key>(l0: vector<Option.Option<T>>, ctx: &mut TxContext.TxContext) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.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 6-16: | ||
created: object(103) | ||
written: object(102) |
16 changes: 16 additions & 0 deletions
16
crates/sui-verifier-transactional-tests/tests/entry_points/generic_with_key_valid.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,16 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// valid, type parameters with key are valid as long as they are not nested | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.TxContext; | ||
import 0x1.Option; | ||
|
||
public(script) yes<T:key>(l0: T, l1: &T, l2: &mut T, ctx: &mut TxContext.TxContext) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
crates/sui-verifier-transactional-tests/tests/entry_points/id.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 6-21: | ||
created: object(103) | ||
written: object(102) |
21 changes: 21 additions & 0 deletions
21
crates/sui-verifier-transactional-tests/tests/entry_points/id.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,21 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// valid, ID is allowed | ||
|
||
//# publish | ||
module 0x0.M { | ||
import 0x2.TxContext; | ||
import 0x2.ID; | ||
|
||
public(script) yes<T>( | ||
l0: ID.ID, | ||
l1: vector<ID.ID>, | ||
l2: vector<vector<ID.ID>>, | ||
ctx: &mut TxContext.TxContext, | ||
) { | ||
label l0: | ||
abort 0; | ||
} | ||
|
||
} |
5 changes: 3 additions & 2 deletions
5
crates/sui-verifier-transactional-tests/tests/entry_points/option.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,4 +1,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 6-16: | ||
Error: Failed to verify the Move module, reason: "Invalid entry point parameter type. Expected primitive or object type. Got: Std::Option::Option<u64>". | ||
task 0 'publish'. lines 6-23: | ||
created: object(103) | ||
written: object(102) |
11 changes: 9 additions & 2 deletions
11
crates/sui-verifier-transactional-tests/tests/entry_points/option.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
Oops, something went wrong.