pub fn add_hints_for_input(&mut self, index: usize, hints_bag: HintsBag) {
        let mut public: Vec<Hint> = hints_bag
            .hints
            .clone()
            .into_iter()
            .filter(|hint| matches!(hint, Hint::CommitmentHint(_)))
            .collect();
        let mut secret: Vec<Hint> = hints_bag
            .hints
            .into_iter()
            .filter(|hint| matches!(hint, Hint::SecretProven(_)))
            .collect();
        let secret_bag = HintsBag::empty();
        let public_bag = HintsBag::empty();
        let old_secret: &Vec<Hint> = &self.secret_hints.get(&index).unwrap_or(&secret_bag).hints;
        for hint in old_secret {
            secret.push(hint.clone());
        }

        let old_public: &Vec<Hint> = &self.public_hints.get(&index).unwrap_or(&public_bag).hints;
        for hint in old_public {
            public.push(hint.clone());
        }
        self.secret_hints.insert(index, HintsBag { hints: secret });
        self.public_hints.insert(index, HintsBag { hints: public });
    }
/// Adding hints for a input index
Adding hints for a input index
Adding hints for a input index
pub fn add_hints_for_input(&mut self, index: usize, hints_bag: HintsBag) {
        let mut public: Vec<Hint> = hints_bag
            .hints
            .clone()
            .into_iter()
            .filter(|hint| matches!(hint, Hint::CommitmentHint(_)))
            .collect();
        let mut secret: Vec<Hint> = hints_bag
            .hints
            .into_iter()
            .filter(|hint| matches!(hint, Hint::SecretProven(_)))
            .collect();
        let secret_bag = HintsBag::empty();
        let public_bag = HintsBag::empty();
        let old_secret: &Vec<Hint> = &self.secret_hints.get(&index).unwrap_or(&secret_bag).hints;
        for hint in old_secret {
            secret.push(hint.clone());
        }
        let old_public: &Vec<Hint> = &self.public_hints.get(&index).unwrap_or(&public_bag).hints;
        for hint in old_public {
            public.push(hint.clone());
        }
        self.secret_hints.insert(index, HintsBag { hints: secret });
        self.public_hints.insert(index, HintsBag { hints: public });
    }
pub fn add_hints_for_input ( & mut self , index : usize , hints_bag : HintsBag ) { let mut public : Vec < Hint > = hints_bag . hints . clone ( ) . into_iter ( ) . filter ( | hint | matches ! ( hint Hint CommitmentHint ( ) ) ) . collect ( ) ; let mut secret : Vec < Hint > = hints_bag . hints . into_iter ( ) . filter ( | hint | matches ! ( hint Hint SecretProven ( ) ) ) . collect ( ) ; let secret_bag = HintsBag :: empty ( ) ; let public_bag = HintsBag :: empty ( ) ; let old_secret : & Vec < Hint > = & self . secret_hints . get ( & index ) . unwrap_or ( & secret_bag ) . hints ; for hint in old_secret { secret . push ( hint . clone ( ) ) ; } let old_public : & Vec < Hint > = & self . public_hints . get ( & index ) . unwrap_or ( & public_bag ) . hints ; for hint in old_public { public . push ( hint . clone ( ) ) ; } self . secret_hints . insert ( index , HintsBag { hints : secret } ) ; self . public_hints . insert ( index , HintsBag { hints : public } ) ; }
Adding hints for a input index
Adding hints for a input index
&mut self
index
usize
hints_bag
HintsBag
&mut self
index
usize
hints_bag
HintsBag