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.
[move][adapter] Improve type argument errors (MystenLabs#6286)
* [move][adapter] Improve type argument errors - A missing type in a module currently throws an invariant violation from the Move VM, this catches that error and produces a better error
- Loading branch information
Showing
14 changed files
with
188 additions
and
33 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
Empty file.
28 changes: 28 additions & 0 deletions
28
crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.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,28 @@ | ||
processed 7 tasks | ||
|
||
init: | ||
A: object(100) | ||
|
||
task 1 'publish'. lines 8-15: | ||
created: object(104) | ||
written: object(103) | ||
|
||
task 2 'run'. lines 17-17: | ||
Error: Transaction Effects Status: Entry Type Argument Error. Error for type argument at index 0: A package (or module) in the type argument was not found | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryTypeArgumentError(EntryTypeArgumentError { argument_idx: 0, kind: ModuleNotFound }), source: None } } | ||
|
||
task 3 'run'. lines 19-19: | ||
Error: Transaction Effects Status: Entry Type Argument Error. Error for type argument at index 0: A type was not found in the module specified | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryTypeArgumentError(EntryTypeArgumentError { argument_idx: 0, kind: TypeNotFound }), source: None } } | ||
|
||
task 4 'run'. lines 21-21: | ||
Error: Transaction Effects Status: Entry Type Argument Error. Error for type argument at index 0: Mismatch between the number of actual versus expected type arguments. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryTypeArgumentError(EntryTypeArgumentError { argument_idx: 0, kind: ArityMismatch }), source: None } } | ||
|
||
task 5 'run'. lines 23-23: | ||
Error: Transaction Effects Status: Entry Type Argument Error. Error for type argument at index 0: Mismatch between the number of actual versus expected type arguments. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryTypeArgumentError(EntryTypeArgumentError { argument_idx: 0, kind: ArityMismatch }), source: None } } | ||
|
||
task 6 'run'. lines 25-25: | ||
Error: Transaction Effects Status: Entry Type Argument Error. Error for type argument at index 0: A type provided did not match the specified constraints. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: EntryTypeArgumentError(EntryTypeArgumentError { argument_idx: 0, kind: ConstraintNotSatisfied }), source: None } } |
25 changes: 25 additions & 0 deletions
25
crates/sui-adapter-transactional-tests/tests/entry_points/missing_type.move
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) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// tests invalid type args | ||
|
||
//# init --addresses test=0x0 --accounts A | ||
|
||
//# publish | ||
module test::m { | ||
|
||
struct S<phantom T: copy> {} | ||
|
||
entry fun foo<T>() {} | ||
|
||
} | ||
|
||
//# run test::m::foo --type-args test::x::x | ||
|
||
//# run test::m::foo --type-args test::m::SUI | ||
|
||
//# run test::m::foo --type-args test::m::S | ||
|
||
//# run test::m::foo --type-args test::m::S<u64,u8> | ||
|
||
//# run test::m::foo --type-args test::m::S<signer> |
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
Empty file.
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
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
Oops, something went wrong.