mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
Add function to test whether function is exported in wasm blob (#9093)
* Add function to test whether function is exported in wasm blob * Address Feedback * Update based on feedback
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user