MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / find_node

Method find_node

fendermint/testing/materializer/src/materializer.rs:274–286  ·  view source on GitHub ↗

Map over the internal and external target configurations to find a first non-empty result.

(&self, f: F, g: G)

Source from the content-addressed store, hash-verified

272impl<'a, M: Materials> SubmitConfig<'a, M> {
273 /// Map over the internal and external target configurations to find a first non-empty result.
274 pub fn find_node<F, G, T>(&self, f: F, g: G) -> Option<T>
275 where
276 F: Fn(&M::Node) -> Option<T>,
277 G: Fn(&Url) -> Option<T>,
278 {
279 self.nodes
280 .iter()
281 .filter_map(|tc| match tc {
282 TargetConfig::Internal(n) => f(n),
283 TargetConfig::External(u) => g(u),
284 })
285 .next()
286 }
287}

Callers 2

create_subnet_genesisMethod · 0.80
create_relayerMethod · 0.80

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected