mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 18:01:04 +00:00
contracts: make test work with debugger (#13776)
* contracts: make test work with debugger * fix path * PR review * Add comment * space * Update frame/contracts/src/tests.rs * lint * spelling
This commit is contained in:
@@ -456,7 +456,14 @@ fn compile_module<T>(fixture_name: &str) -> wat::Result<(Vec<u8>, <T::Hashing as
|
|||||||
where
|
where
|
||||||
T: frame_system::Config,
|
T: frame_system::Config,
|
||||||
{
|
{
|
||||||
let fixture_path = ["fixtures/", fixture_name, ".wat"].concat();
|
let fixture_path = [
|
||||||
|
// When `CARGO_MANIFEST_DIR` is not set, Rust resolves relative paths from the root folder
|
||||||
|
std::env::var("CARGO_MANIFEST_DIR").as_deref().unwrap_or("frame/contracts"),
|
||||||
|
"/fixtures/",
|
||||||
|
fixture_name,
|
||||||
|
".wat",
|
||||||
|
]
|
||||||
|
.concat();
|
||||||
let wasm_binary = wat::parse_file(fixture_path)?;
|
let wasm_binary = wat::parse_file(fixture_path)?;
|
||||||
let code_hash = T::Hashing::hash(&wasm_binary);
|
let code_hash = T::Hashing::hash(&wasm_binary);
|
||||||
Ok((wasm_binary, code_hash))
|
Ok((wasm_binary, code_hash))
|
||||||
|
|||||||
Reference in New Issue
Block a user