Skip to main content

TestResult

Struct TestResult 

Source
pub struct TestResult {
    pub scheme_name: String,
    pub scheme_version: String,
    pub parties: u32,
    pub threshold: u32,
    pub outcome: Outcome,
    pub output: Vec<u8>,
    pub messages_exchanged: u64,
    pub bytes_exchanged: u64,
    pub rounds: u8,
    pub elapsed: Duration,
    pub note: Option<String>,
}
Expand description

Result of executing one TestVector against one scheme.

Fields§

§scheme_name: String§scheme_version: String§parties: u32§threshold: u32§outcome: Outcome§output: Vec<u8>

Bytes the protocol produced (signature, DKG output, …). Empty for aborted runs.

§messages_exchanged: u64

Total messages exchanged across all rounds, all parties.

§bytes_exchanged: u64

Total bytes carried by those messages.

§rounds: u8

Number of rounds the protocol ran before completing or aborting.

§elapsed: Duration

Wall time of the run, captured by the runner.

§note: Option<String>

Human-readable note — e.g. mismatch detail, abort reason.

Implementations§

Source§

impl TestResult

Source

pub fn from_run( vector: &TestVector, output: Vec<u8>, messages_exchanged: u64, bytes_exchanged: u64, rounds: u8, elapsed: Duration, ) -> Self

Build a result from a vector + the runtime observations. The caller supplies the produced output and the observed round count; this constructor decides Pass / Fail / Warn by comparing against the vector’s expected bytes and conformance level:

  • Output matches (or no expected bytes) and round count matches (or no expected_round_count set) → Pass.
  • Output mismatches on a must_pass vector → Fail.
  • Output mismatches on a should_pass vector → Warn.
  • Output mismatches on an informational vector → Pass (the mismatch is recorded in note but never gates the candidate).
  • Round count differs from expected_round_countWarn even on a must_pass vector (the implementation produced a valid signature; it just took a different number of rounds). The mismatch is appended to the note.
Source

pub fn aborted( vector: &TestVector, reason: impl Into<String>, rounds: u8, elapsed: Duration, ) -> Self

Construct an aborted result (no output, scheme signaled misbehavior). Used by the runner when the configured Byzantine behavior tripped the scheme’s abort path.

Trait Implementations§

Source§

impl Clone for TestResult

Source§

fn clone(&self) -> TestResult

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TestResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&TestResult> for ReportEntry

Source§

fn from(r: &TestResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V