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

Function get_ctors

crates/ixon/src/proof.rs:426–438  ·  view source on GitHub ↗
(
  buf: &mut &[u8],
)

Source from the content-addressed store, hash-verified

424// ============================================================================
425// Helper: put/get rules and ctors arrays
426// ============================================================================
427
428fn put_rules(rules: &[RevealRecursorRule], buf: &mut Vec<u8>) {
429 TagN::put(0, 0, rules.len() as u64, buf);
430 for rule in rules {
431 rule.put(buf);
432 }
433}
434
435fn get_rules(buf: &mut &[u8]) -> Result<Vec<RevealRecursorRule>, String> {
436 let count =
437 usize::try_from(TagN::get(0, buf)?.value).map_err(|e| e.to_string())?;
438 let mut rules = Vec::with_capacity(count);
439 for _ in 0..count {
440 rules.push(RevealRecursorRule::get(buf)?);
441 }

Callers 1

getMethod · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected