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

Function block_of_addr

crates/kernel/src/anon_work.rs:308–320  ·  view source on GitHub ↗

The ingress-block address that owns `addr`: a projection (IPrj/CPrj/RPrj/ DPrj) maps to its Muts `block`; anything else is its own block. Used to map a resolved constant address to the `build_anon_work` item that covers it (standalone → itself; a mutual-block member → the whole block).

(env: &IxonEnv, addr: &Address)

Source from the content-addressed store, hash-verified

306/// a resolved constant address to the `build_anon_work` item that covers it
307/// (standalone → itself; a mutual-block member → the whole block).
308pub fn block_of_addr(env: &IxonEnv, addr: &Address) -> Address {
309 use ixon::constant::ConstantInfo as CI;
310 match env.get_const(addr) {
311 Some(c) => match &c.info {
312 CI::IPrj(p) => p.block.clone(),
313 CI::CPrj(p) => p.block.clone(),
314 CI::RPrj(p) => p.block.clone(),
315 CI::DPrj(p) => p.block.clone(),
316 _ => addr.clone(),
317 },
318 None => addr.clone(),
319 }
320}
321
322/// The ingress-block address of a work item's `primary` — the key for matching
323/// a resolved target constant to the work item that covers it.

Callers 3

constant_inputsFunction · 0.85
run_constantFunction · 0.85
work_block_addrFunction · 0.85

Calls 2

get_constMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected