MCPcopy Create free account
hub / github.com/argumentcomputer/ix / build_sub_env

Function build_sub_env

crates/kernel/src/anon_work.rs:278–302  ·  view source on GitHub ↗
(
  source: &IxonEnv,
  roots: &[Address],
)

Source from the content-addressed store, hash-verified

276 // names section, so each key's component chain must be interned too.
277 fn intern_chain(sub: &IxonEnv, name: &ix_common::env::Name) {
278 let addr = Address::from_blake3_hash(*name.get_hash());
279 if sub.get_name(&addr).is_some() {
280 return;
281 }
282 match name.as_data() {
283 NameData::Anonymous(_) => {},
284 NameData::Str(parent, _, _) | NameData::Num(parent, _, _) => {
285 intern_chain(sub, parent);
286 },
287 }
288 sub.store_name(addr, name.clone());
289 }
290 for e in full.named.iter() {
291 if sub.get_const(&e.value().addr).is_some() {
292 intern_chain(&sub, e.key());
293 sub.register_name(
294 e.key().clone(),
295 ixon::env::Named::with_addr(e.value().addr.clone()),
296 );
297 }
298 }
299 let mut buf = Vec::new();
300 sub.put(&mut buf).map_err(|e| format!("sub-env serialize: {e}"))?;
301 Ok(buf)
302}
303
304/// The ingress-block address that owns `addr`: a projection (IPrj/CPrj/RPrj/
305/// DPrj) maps to its Muts `block`; anything else is its own block. Used to map

Callers 3

constant_inputsFunction · 0.85
run_constantFunction · 0.85
run_shard_planFunction · 0.85

Calls 9

closure_addrsFunction · 0.85
store_const_lazyMethod · 0.80
store_blobMethod · 0.80
get_const_bytesMethod · 0.45
cloneMethod · 0.45
get_blobMethod · 0.45
getMethod · 0.45
insertMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected