penumbra_sct::component::source

Trait SourceContext

Source
pub trait SourceContext: StateWrite {
    // Provided methods
    fn put_current_source(&mut self, source: Option<CommitmentSource>) { ... }
    fn get_current_source(&self) -> Option<CommitmentSource> { ... }
    fn put_mock_source(&mut self, counter: u8) { ... }
}
Available on crate feature component only.
Expand description

A helper trait for placing a CommitmentSource as ambient context during execution.

Provided Methods§

Source

fn put_current_source(&mut self, source: Option<CommitmentSource>)

Source

fn get_current_source(&self) -> Option<CommitmentSource>

Source

fn put_mock_source(&mut self, counter: u8)

Sets a mock source, for testing.

The counter field allows distinguishing hashes at different stages of the test.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§