Skip to content

Commit

Permalink
refactor: simplify wasm build script
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Aug 16, 2024
1 parent b88473e commit d222eb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
11 changes: 2 additions & 9 deletions runtime/devnet/build.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}

/// The wasm builder is deactivated when compiling
Expand Down
11 changes: 2 additions & 9 deletions runtime/testnet/build.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
#[cfg(all(feature = "std", feature = "metadata-hash"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.build()
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
substrate_wasm_builder::WasmBuilder::build_using_defaults()
}

/// The wasm builder is deactivated when compiling
Expand Down

0 comments on commit d222eb6

Please sign in to comment.