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

Can't compile a clarity snippet with multiple principals #274

Closed
ameeratgithub opened this issue Jan 19, 2024 · 0 comments · Fixed by #325
Closed

Can't compile a clarity snippet with multiple principals #274

ameeratgithub opened this issue Jan 19, 2024 · 0 comments · Fixed by #325
Assignees
Labels
bug Something isn't working

Comments

@ameeratgithub
Copy link
Collaborator

While adding support for principals in property testing framework, I've found an issue in /src/vm/clarity_wasm.rs in Clarity VM. It panics with message

panicked at /home/user1/.cargo/git/checkouts/stacks-core-16deff9526aec9a7/fd73fd5/clarity/./src/vm/clarity_wasm.rs:1756:26:
index out of bounds: the len is 8 but the index is 40 

Steps To Reproduce

use clar2wasm::tools::evaluate;
evaluate("(default-to (tuple (baBoferTsDF 'S1G2081040G2081040G2081040G208105NK8PE5.proptest-principal) (jumFfDpQjCqqbZvd (list 'S1G2081040G2081040G2081040G208105NK8PE5.proptest-principal)) (muxnhYYQ -120162851495380370837027214342302802479) (qVETsQyzOAOR 'S1G2081040G2081040G2081040G208105NK8PE5.proptest-principal)) none)").unwrap();

Stack backtrace:

   0: rust_begin_unwind
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_bounds_check
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/panicking.rs:180:5
   3: clarity::vm::clarity_wasm::wasm_to_clarity_value
             at /home/user1/.cargo/git/checkouts/stacks-core-16deff9526aec9a7/fd73fd5/clarity/src/vm/clarity_wasm.rs:1756:26
   4: clarity::vm::clarity_wasm::wasm_to_clarity_value
             at /home/user1/.cargo/git/checkouts/stacks-core-16deff9526aec9a7/fd73fd5/clarity/src/vm/clarity_wasm.rs:1817:21
   5: clarity::vm::clarity_wasm::initialize_contract
             at /home/user1/.cargo/git/checkouts/stacks-core-16deff9526aec9a7/fd73fd5/clarity/src/vm/clarity_wasm.rs:459:9
   6: clar2wasm::tools::TestEnvironment::init_contract_with_snippet
             at ./src/tools.rs:116:26
   7: clar2wasm::tools::TestEnvironment::evaluate
             at ./src/tools.rs:145:9
   8: clar2wasm::tools::evaluate_at
             at ./src/tools.rs:172:5
   9: clar2wasm::tools::evaluate
             at ./src/tools.rs:179:5
  10: wasm_generation::default_to::testing_dummy
             at ./tests/wasm-generation/default_to.rs:25:5
  11: wasm_generation::default_to::testing_dummy::{{closure}}
             at ./tests/wasm-generation/default_to.rs:24:20
  12: core::ops::function::FnOnce::call_once
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5
  13: core::ops::function::FnOnce::call_once
             at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants