-
Notifications
You must be signed in to change notification settings - Fork 431
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
Add example for mocking chain extensions in off-chain tests #882
Add example for mocking chain extensions in off-chain tests #882
Conversation
fn chain_extension_works() { | ||
// given | ||
struct MockedExtension; | ||
impl ink_env::test::ChainExtension for MockedExtension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to mock chain extension inside every test function? Is there anyway to define outside and use that in all functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also define it outside, I just mocked it in here since it's only used in this one test.
I'm getting the following error
I think, this PR covers the above issue but does it mean that once the PR is merged, I need to use the latest ink? |
@frankli-dev Yes, until we release the next release candidate you need to reference the git repository for your |
No description provided.