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

[verifier] Add module builder for easier testing #100

Merged
merged 1 commit into from
Dec 29, 2021
Merged

[verifier] Add module builder for easier testing #100

merged 1 commit into from
Dec 29, 2021

Conversation

lxfind
Copy link
Contributor

@lxfind lxfind commented Dec 29, 2021

One thing that has been holding me back from adding more verifier tests is the difficulty of constructing test modules. Trying to remember and get all the handles right was very confusing, and the code wasn't very readable. It will be very difficult to maintain as well.
Before it's too late, add a module builder that helps build modules for testing.
Note that due to a bug in Rust, we have to do pub use in every test when importing the common library.

SignatureIndex((self.module.signatures.len() - 1) as u16)
}

fn add_address(&mut self, address: AccountAddress) -> AddressIdentifierIndex {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a similar function here--probably not worth unifying because this one is for testing + they do slightly different things, but wanted to point it out in case more unification is desired in the future.

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 does indeed look like it will make testing more fun...

@lxfind lxfind merged commit 445cfa2 into MystenLabs:main Dec 29, 2021
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.

2 participants