Skip to main content

TrellisHarness

Struct TrellisHarness 

Source
pub struct TrellisHarness<G, C = (), O = ()> { /* private fields */ }
Expand description

Scenario runner for deterministic transaction scripts.

Implementations§

Source§

impl<G, C, O> TrellisHarness<G, C, O>
where G: ScenarioTarget<C, O>, C: Clone + Debug + PartialEq, O: Clone + Debug + PartialEq,

Source

pub fn new(build: impl FnOnce() -> G) -> Self

Builds a harness from an application-supplied constructor.

Source

pub fn from_target(target: G) -> Self

Builds a harness around an already-constructed target.

Source

pub fn target(&self) -> &G

Returns the wrapped application target.

Source

pub fn scenario(&self) -> &Scenario

Returns the recorded scenario.

Source

pub fn resource_ledger(&self) -> &ResourceLedger<C>

Returns the resource ledger updated after each committed step.

Source

pub fn output_ledger(&self) -> &OutputLedger<O>

Returns the output ledger updated after each committed step.

Source

pub fn step(&mut self, name: impl Into<String>) -> HarnessStep<'_, G, C, O>

Starts a named single-transaction step.

Source

pub fn run_script( &mut self, script: &TransactionScript<C, O>, ) -> Result<(), ScenarioError>

Runs every step in a replayable transaction script.

Source

pub fn replay( build: impl FnOnce() -> G, script: &TransactionScript<C, O>, ) -> Result<Self, ScenarioError>

Replays a transaction script against a fresh application graph.

Source

pub fn assert_replay_matches(&self, other: &Self) -> Result<(), ScenarioError>

Compares replay traces and final graph state.

Source

pub fn final_state_debug_dump(&self) -> String

Returns a deterministic graph metadata dump for final-state comparison.

Source

pub fn assert_oracle<Oracle>( &self, inputs: &Oracle::CanonicalInputs, ) -> Result<OracleCheck<Oracle::ExpectedState>, OracleMismatch<Oracle::ExpectedState>>
where Oracle: FullRecomputeOracle<G>,

Runs an app-owned full-recompute oracle against the wrapped target.

Auto Trait Implementations§

§

impl<G, C, O> Freeze for TrellisHarness<G, C, O>
where G: Freeze,

§

impl<G, C, O> RefUnwindSafe for TrellisHarness<G, C, O>

§

impl<G, C, O> Send for TrellisHarness<G, C, O>
where G: Send, C: Send, O: Send,

§

impl<G, C, O> Sync for TrellisHarness<G, C, O>
where G: Sync, C: Sync, O: Sync,

§

impl<G, C, O> Unpin for TrellisHarness<G, C, O>
where G: Unpin, C: Unpin, O: Unpin,

§

impl<G, C, O> UnsafeUnpin for TrellisHarness<G, C, O>
where G: UnsafeUnpin,

§

impl<G, C, O> UnwindSafe for TrellisHarness<G, C, O>

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
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.

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.