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

HostRef::deploy should validate arguments. #409

Closed
zie1ony opened this issue Apr 19, 2024 · 0 comments · Fixed by #418
Closed

HostRef::deploy should validate arguments. #409

zie1ony opened this issue Apr 19, 2024 · 0 comments · Fixed by #418

Comments

@zie1ony
Copy link
Contributor

zie1ony commented Apr 19, 2024

When deploying contract in tests, it is possible to pass NoArgs when args are needed.
Deploy method should catch that at the runtime and produce error that make sense.

At the moment on odra-vm I get that kind of error:

---- register::tests::initialize::should_set_correct_name_and_symbol stdout ----
thread 'register::tests::initialize::should_set_correct_name_and_symbol' panicked at /Users/ziel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/odra-vm-0.9.1/src/vm/odra_vm.rs:94:9:
Revert: ExecutionError(User(31000)) - Contract(ContractPackageHash(1000000000000000000000000000000000000000000000000000000000000000))::name
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'register::tests::initialize::should_set_correct_name_and_symbol' panicked at src/register.rs:48:1:
called `Result::unwrap()` on an `Err` value: ExecutionError(User(31000))

and on casper-vm;

thread 'register::tests::initialize::should_set_correct_name_and_symbol' panicked at /Users/ziel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/casper-engine-test-support-5.0.0/src/wasm_test_builder.rs:842:13:
Expected successful execution result, but instead got: Failure {
    error: Exec(
        Revert(
            ApiError::MissingArgument [2],
        ),
    ),
    transfers: [],
    cost: Gas(
...
@github-project-automation github-project-automation bot moved this to 🆕 Discuss in ⚔️Tavern 🐉 Apr 19, 2024
@kpob kpob linked a pull request Apr 26, 2024 that will close this issue
@kpob kpob closed this as completed in #418 May 7, 2024
@github-project-automation github-project-automation bot moved this from 🆕 Discuss to ✅ Done in ⚔️Tavern 🐉 May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant