pub struct ProvableQuery {
pub state_root: <TestnetV0 as Network>::StateRoot,
pub block_height: u32,
pub api_base_url: String,
/* private fields */
}Expand description
A custom query that fetches Merkle state paths from the Provable API v2
statePath/{commitment} endpoint during trace.prepare().
The state root returned by [current_state_root] is cached from the most
recently fetched state path — ensuring the Merkle proof and the root it
verifies against are consistent.
Fields§
§state_root: <TestnetV0 as Network>::StateRoot§block_height: u32§api_base_url: StringProvable API v2 base URL (e.g. https://api.provable.com/v2/testnet)
Implementations§
Trait Implementations§
Source§impl Clone for ProvableQuery
impl Clone for ProvableQuery
Source§impl Debug for ProvableQuery
impl Debug for ProvableQuery
Source§impl QueryTrait<TestnetV0> for ProvableQuery
impl QueryTrait<TestnetV0> for ProvableQuery
Source§fn current_state_root(&self) -> Result<<TestnetV0 as Network>::StateRoot>
fn current_state_root(&self) -> Result<<TestnetV0 as Network>::StateRoot>
Returns the current state root.
Source§fn current_block_height(&self) -> Result<u32>
fn current_block_height(&self) -> Result<u32>
Returns the current block height
Source§fn get_state_path_for_commitment(
&self,
commitment: &Field<TestnetV0>,
) -> Result<StatePath<TestnetV0>>
fn get_state_path_for_commitment( &self, commitment: &Field<TestnetV0>, ) -> Result<StatePath<TestnetV0>>
Returns a state path for the given
commitment.Source§fn get_state_paths_for_commitments(
&self,
commitments: &[Field<TestnetV0>],
) -> Result<Vec<StatePath<TestnetV0>>>
fn get_state_paths_for_commitments( &self, commitments: &[Field<TestnetV0>], ) -> Result<Vec<StatePath<TestnetV0>>>
Returns a list of state paths for the given list of
commitments.Source§fn current_state_root_async<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<TestnetV0 as Network>::StateRoot>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_state_root_async<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<<TestnetV0 as Network>::StateRoot>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the current state root.
Source§fn current_block_height_async<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_block_height_async<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the current block height
Source§fn get_state_path_for_commitment_async<'life0, 'life1, 'async_trait>(
&'life0 self,
commitment: &'life1 Field<TestnetV0>,
) -> Pin<Box<dyn Future<Output = Result<StatePath<TestnetV0>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_state_path_for_commitment_async<'life0, 'life1, 'async_trait>(
&'life0 self,
commitment: &'life1 Field<TestnetV0>,
) -> Pin<Box<dyn Future<Output = Result<StatePath<TestnetV0>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a state path for the given
commitment.Source§fn get_state_paths_for_commitments_async<'life0, 'life1, 'async_trait>(
&'life0 self,
commitments: &'life1 [Field<TestnetV0>],
) -> Pin<Box<dyn Future<Output = Result<Vec<StatePath<TestnetV0>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_state_paths_for_commitments_async<'life0, 'life1, 'async_trait>(
&'life0 self,
commitments: &'life1 [Field<TestnetV0>],
) -> Pin<Box<dyn Future<Output = Result<Vec<StatePath<TestnetV0>>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a list of state paths for the given list of
commitments.Auto Trait Implementations§
impl !Freeze for ProvableQuery
impl RefUnwindSafe for ProvableQuery
impl Send for ProvableQuery
impl Sync for ProvableQuery
impl Unpin for ProvableQuery
impl UnsafeUnpin for ProvableQuery
impl UnwindSafe for ProvableQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more