Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

contracts: make test work with debugger #13776

Merged
merged 8 commits into from
Mar 31, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion frame/contracts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,12 @@ fn compile_module<T>(fixture_name: &str) -> wat::Result<(Vec<u8>, <T::Hashing as
where
T: frame_system::Config,
{
let fixture_path = ["fixtures/", fixture_name, ".wat"].concat();
pgherveou marked this conversation as resolved.
Show resolved Hide resolved
let fixture_root = if std::env::var("CARGO_MANIFEST_DIR").is_ok() {
pgherveou marked this conversation as resolved.
Show resolved Hide resolved
"fixtures/"
} else {
"frame/contracts/fixtures/"
};
let fixture_path = [fixture_root, fixture_name, ".wat"].concat();
let wasm_binary = wat::parse_file(fixture_path)?;
let code_hash = T::Hashing::hash(&wasm_binary);
Ok((wasm_binary, code_hash))
Expand Down