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

The initial implementation of advanced test environment. #4

Draft
wants to merge 1 commit into
base: release/3.3.1
Choose a base branch
from

Conversation

xgreenx
Copy link

@xgreenx xgreenx commented Oct 2, 2022

No description provided.

@xgreenx xgreenx self-assigned this Oct 2, 2022
Comment on lines +240 to +242
if flags.is_reverted() {
panic!("the off-chain env does not implement revert in `seal_return_value`")
}
Copy link

@h4x3rotab h4x3rotab Oct 19, 2022

Choose a reason for hiding this comment

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

Just tested it out in a relatively large project. This is the only problem I've encountered so far. If this one is not implemented, if any function returns an Err, the unit test will be interrupted by the panic. So there's no way to test any error case like below:

assert_eq!(contract.func(), Err(Error::SomeErr));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants