⚙️ CAIRO RUNE DIFFICULTY: Adept Behavioral

The Chain of Responsibility

Passing a STARK proof through sequential validation filters.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Chain of Responsibility
ARCANUM SCHOOL: Evocation // Flow
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CAIRO PATTERN //
#[derive(Drop)]
enum HandlerResult {
    Passed: felt252,
    Failed,
}
trait IHandler<T> { fn handle(self: @T, proof: felt252) -> HandlerResult; }

#[derive(Copy, Drop)]
struct SignatureHandler {}
impl SigHandlerImpl of IHandler<SignatureHandler> {
    fn handle(self: @SignatureHandler, proof: felt252) -> HandlerResult {
        if proof != 0 { HandlerResult::Passed(proof) } else { HandlerResult::Failed }
    }
}

A sequence of mystical wards, where each decides whether to bless the proof or pass it to the next authority.

Runic Tags: #cairo #design-pattern #chain-of-responsibility