MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / extract_controller

Function extract_controller

validation/src/test.rs:77–90  ·  view source on GitHub ↗
(event: &unvalidated::Event<Ipld>)

Source from the content-addressed store, hash-verified

75}
76
77fn extract_controller(event: &unvalidated::Event<Ipld>) -> String {
78 match event {
79 unvalidated::Event::Time(_) => unreachable!("not a time event"),
80 unvalidated::Event::Signed(s) => match s.payload() {
81 unvalidated::Payload::Data(_) => {
82 unreachable!("should not have data event: {:?}", event)
83 }
84 unvalidated::Payload::Init(init) => {
85 init.header().controllers().first().cloned().unwrap()
86 }
87 },
88 unvalidated::Event::Unsigned(_) => unreachable!("not unsigned event"),
89 }
90}
91
92fn extract_init_controller(
93 signing_type: SigningType,

Callers 1

extract_init_controllerFunction · 0.85

Calls 5

unwrapMethod · 0.80
controllersMethod · 0.80
payloadMethod · 0.45
firstMethod · 0.45
headerMethod · 0.45

Tested by

no test coverage detected