Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix path
  • Loading branch information
pgherveou committed Mar 31, 2023
commit d953ab8e8e4c6edfd18abefe6525bcc9daa5fb7f
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 = ["frame/contracts/fixtures/", fixture_name, ".wat"].concat();
let fixture_root = if std::env::var("CARGO_MANIFEST_DIR").is_ok() {
"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