pub struct LocalStateProvider { /* private fields */ }Expand description
Local-only chain state provider for offline/testing use.
Uses the in-memory balance tracker and nonce manager as the “source of truth” — no actual chain connection.
Implementations§
Source§impl LocalStateProvider
impl LocalStateProvider
Sourcepub fn new(balances: Arc<BalanceTracker>, nonces: Arc<NonceManager>) -> Self
pub fn new(balances: Arc<BalanceTracker>, nonces: Arc<NonceManager>) -> Self
Create a new local state provider.
Trait Implementations§
Source§impl ChainStateProvider for LocalStateProvider
impl ChainStateProvider for LocalStateProvider
Source§fn get_on_chain_balance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
asset_id: &'life2 AssetId,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_on_chain_balance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
asset_id: &'life2 AssetId,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the current balance for an address and asset from on-chain state.
Source§fn get_on_chain_balances<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AssetId, u128)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_on_chain_balances<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<(AssetId, u128)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all asset balances for an address from on-chain state.
Source§fn get_on_chain_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_on_chain_nonce<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the current confirmed nonce for an address.
Source§fn get_transaction_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_tx_hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<TxStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_tx_hash: &'life1 Hash,
) -> Pin<Box<dyn Future<Output = Result<TxStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the status of a transaction by its hash.
Source§fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current block height.
Source§fn submit_signed_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
_classical_sig: &'life2 Signature,
_pq_sig: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn submit_signed_transaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
_classical_sig: &'life2 Signature,
_pq_sig: &'life3 [u8],
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Submit a hybrid post-quantum signed transaction to the network. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LocalStateProvider
impl !UnwindSafe for LocalStateProvider
impl Freeze for LocalStateProvider
impl Send for LocalStateProvider
impl Sync for LocalStateProvider
impl Unpin for LocalStateProvider
impl UnsafeUnpin for LocalStateProvider
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