Skip to content

Commit

Permalink
feat(Claim): Accept more types for public input
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Oct 2, 2024
1 parent 0251592 commit 6451d76
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions triton-vm/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ impl Claim {
}

#[must_use]
pub fn with_input(mut self, input: Vec<BFieldElement>) -> Self {
self.input = input;
pub fn with_input(mut self, input: impl Into<Vec<BFieldElement>>) -> Self {
self.input = input.into();
self
}

Expand All @@ -90,6 +90,7 @@ mod tests {
use test_strategy::proptest;

use crate::proof_item::ProofItem;
use crate::vm::PublicInput;

use super::*;

Expand All @@ -100,6 +101,14 @@ mod tests {
}
}

#[test]
fn claim_accepts_various_types_for_public_input() {
let _claim = Claim::default()
.with_input(bfe_vec![42])
.with_input(bfe_array![42])
.with_input(PublicInput::new(bfe_vec![42]));
}

#[proptest]
fn decode_proof(#[strategy(arb())] proof: Proof) {
let encoded = proof.encode();
Expand Down

0 comments on commit 6451d76

Please sign in to comment.