diff --git a/substrate/client/executor/common/src/runtime_blob/runtime_blob.rs b/substrate/client/executor/common/src/runtime_blob/runtime_blob.rs index aac023e960..82b9312dec 100644 --- a/substrate/client/executor/common/src/runtime_blob/runtime_blob.rs +++ b/substrate/client/executor/common/src/runtime_blob/runtime_blob.rs @@ -81,6 +81,15 @@ impl RuntimeBlob { export_mutable_globals(&mut self.raw_module, "exported_internal_global"); } + /// Perform an instrumentation that makes sure that a specific function `entry_point` is exported + pub fn entry_point_exists(&self, entry_point: &str) -> bool { + self.raw_module.export_section().map(|e| { + e.entries() + .iter() + .any(|e| matches!(e.internal(), Internal::Function(_)) && e.field() == entry_point) + }).unwrap_or_default() + } + /// Returns an iterator of all globals which were exported by [`expose_mutable_globals`]. pub(super) fn exported_internal_global_names<'module>( &'module self,