Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Move call type checking part1 #529

Merged
merged 4 commits into from
Feb 23, 2022
Merged

Conversation

oxade
Copy link
Contributor

@oxade oxade commented Feb 23, 2022

This is the first step in having a unified way to check move call args both in the client and authorities.
Here we separate out the logic for type checking so that other modules can use it.
We also make MovePackage a concrete type (instead of just a BTreeMap alias) which we will add more functionality to the checker in future.

The next step is to flesh out the checks, and use this check module in the client for arg linting.

Note:

  1. move_call_type_check.rs name is not the best. Open to suggestions.
  2. Some of the functionality here will be moved to impl MovePackage
  3. Some Move call tests were operating on private functions, which is now disallowed by the checker. This is why I had to make some Move functions public. If we really want these functions to be private, but only used in test, we should devise a way around this.

Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks like what we need!

@@ -273,7 +273,7 @@ module Examples::Hero {
}

// --- Testing functions ---
fun assert_hero_strength(hero: &Hero, strength: u64, _: &mut TxContext) {
public fun assert_hero_strength(hero: &Hero, strength: u64, _: &mut TxContext) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally fine to make all of these public--thanks!

@oxade oxade merged commit ae20572 into main Feb 23, 2022
@oxade oxade deleted the improve-type-checking-part1 branch February 23, 2022 01:58
@oxade oxade mentioned this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants