diff --git a/Cargo.lock b/Cargo.lock index 7eb584c..d0cf256 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1085,6 +1085,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/Cargo.toml b/Cargo.toml index 5ab19dc..bc94a2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ serde_json = { version = "1.0" } syn = { version = "2" } thiserror = { version = "1.0.40" } wat = { version = "1.0.71" } +wasm-instrument = { version = "0.4.0", features = ["sign_ext"] } # Substrate dependencies diff --git a/drink/Cargo.toml b/drink/Cargo.toml index 567adcf..d47a5f4 100644 --- a/drink/Cargo.toml +++ b/drink/Cargo.toml @@ -10,7 +10,7 @@ version.workspace = true description = "Minimal sufficient architecture that allows for a fully functional ink! contract development" [dependencies] -contract-metadata = { workspace = true, optional = true} +contract-metadata = { workspace = true, optional = true } contract-transcode = { workspace = true, optional = true } frame-metadata = { workspace = true } frame-support = { workspace = true } @@ -29,6 +29,7 @@ serde_json = { workspace = true, optional = true } scale-info = { workspace = true } thiserror = { workspace = true } wat = { workspace = true } +wasm-instrument = { workspace = true } drink-test-macro = { workspace = true } diff --git a/drink/test-macro/src/contract_building.rs b/drink/test-macro/src/contract_building.rs index e052fb5..6d1357b 100644 --- a/drink/test-macro/src/contract_building.rs +++ b/drink/test-macro/src/contract_building.rs @@ -6,8 +6,8 @@ use std::{ use cargo_metadata::{Metadata, MetadataCommand, Package}; use contract_build::{ - BuildArtifacts, BuildMode, ExecuteArgs, Features, ManifestPath, Network, - OptimizationPasses, OutputType, Target, UnstableFlags, Verbosity, + BuildArtifacts, BuildMode, ExecuteArgs, Features, ManifestPath, Network, OptimizationPasses, + OutputType, Target, UnstableFlags, Verbosity, }; use crate::bundle_provision::BundleProviderGenerator; @@ -60,11 +60,11 @@ fn get_contract_crates(metadata: &Metadata) -> (Option<&Package>, impl Iterator< let contract_deps = dep_graph .nodes .iter() - .filter_map(|node| { + .filter(|node| { node.features .contains(&INK_AS_DEPENDENCY_FEATURE.to_string()) - .then(|| node.id.clone()) }) + .map(|node| node.id.clone()) .map(pkg_lookup); let root = dep_graph diff --git a/examples/chain-extension/Cargo.lock b/examples/chain-extension/Cargo.lock index 179e380..fbab2c7 100644 --- a/examples/chain-extension/Cargo.lock +++ b/examples/chain-extension/Cargo.lock @@ -1078,6 +1078,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/contract-events/Cargo.lock b/examples/contract-events/Cargo.lock index f2aa39f..67d2212 100644 --- a/examples/contract-events/Cargo.lock +++ b/examples/contract-events/Cargo.lock @@ -1076,6 +1076,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/cross-contract-call-tracing/Cargo.lock b/examples/cross-contract-call-tracing/Cargo.lock index da61704..977786c 100644 --- a/examples/cross-contract-call-tracing/Cargo.lock +++ b/examples/cross-contract-call-tracing/Cargo.lock @@ -1076,6 +1076,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/flipper/Cargo.lock b/examples/flipper/Cargo.lock index 303139b..a1abbdf 100644 --- a/examples/flipper/Cargo.lock +++ b/examples/flipper/Cargo.lock @@ -1066,6 +1066,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/mocking/Cargo.lock b/examples/mocking/Cargo.lock index b0739fa..1d46740 100644 --- a/examples/mocking/Cargo.lock +++ b/examples/mocking/Cargo.lock @@ -1066,6 +1066,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/quick-start-with-drink/Cargo.lock b/examples/quick-start-with-drink/Cargo.lock index 44a3b5a..acd7c34 100644 --- a/examples/quick-start-with-drink/Cargo.lock +++ b/examples/quick-start-with-drink/Cargo.lock @@ -1066,6 +1066,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ] diff --git a/examples/runtime-interaction/Cargo.lock b/examples/runtime-interaction/Cargo.lock index 19da6f5..02e0901 100644 --- a/examples/runtime-interaction/Cargo.lock +++ b/examples/runtime-interaction/Cargo.lock @@ -1060,6 +1060,7 @@ dependencies = [ "sp-io", "sp-runtime-interface", "thiserror", + "wasm-instrument", "wat", ]