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

panic in singlepass leads to GasDepletion #501

Closed
webmaster128 opened this issue Jul 30, 2020 · 1 comment · Fixed by #504
Closed

panic in singlepass leads to GasDepletion #501

webmaster128 opened this issue Jul 30, 2020 · 1 comment · Fixed by #504
Milestone

Comments

@webmaster128
Copy link
Member

When executing this test in singlepass, we get a GasDepletion error, which makes no sense:

#[test]
fn handle_panic() {
    let mut deps = mock_instance(WASM, &[]);

    let (init_msg, creator) = make_init_msg();
    let init_env = mock_env(creator.as_str(), &[]);
    let init_res: InitResponse = init(&mut deps, init_env, init_msg).unwrap();
    assert_eq!(0, init_res.messages.len());

    let handle_env = mock_env(creator.as_str(), &[]);
    // panic inside contract should not panic out here
    // Note: we need to use the production-call, not the testing call (which unwraps any vm error)
    let handle_res = call_handle::<_, _, _, Empty>(
        &mut deps,
        &handle_env,
        &to_vec(&HandleMsg::Panic {}).unwrap(),
    );
    match handle_res.unwrap_err() {
        VmError::RuntimeErr { .. } => {}
        err => panic!("Unexpected error: {:?}", err),
    }
}
@webmaster128 webmaster128 modified the milestones: 0.10.0, 1.0.0 Jul 30, 2020
@ethanfrey
Copy link
Member

I think this is a duplicate of #375

(Or should I say, a test case that demos the issue described there)

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 a pull request may close this issue.

2 participants