Skip to content

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
Development

Successfully merging this pull request may close these issues.

2 participants