Struct fuel_core::database::transactional::DatabaseTransaction
source · pub struct DatabaseTransaction { /* private fields */ }
Methods from Deref<Target = Database>§
pub fn get_block_height(&self) -> Result<Option<BlockHeight>, Error>
sourcepub fn get_current_block(&self) -> Result<Option<Cow<'_, FuelBlockDb>>, Error>
pub fn get_current_block(&self) -> Result<Option<Cow<'_, FuelBlockDb>>, Error>
Get the current block at the head of the chain.
pub fn block_time(&self, height: u32) -> Result<Tai64, Error>
pub fn get_block_id(&self, height: BlockHeight) -> Result<Option<Bytes32>, Error>
pub fn all_block_ids(
&self,
start: Option<BlockHeight>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<(BlockHeight, Bytes32), Error>> + '_
pub fn genesis_block_ids(&self) -> Result<(BlockHeight, Bytes32), Error>
pub fn owned_coins_ids(
&self,
owner: &Address,
start_coin: Option<UtxoId>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<UtxoId, Error>> + '_
pub fn get_coin_config(&self) -> Result<Option<Vec<CoinConfig>>>
pub fn contract_balances(
&self,
contract: ContractId,
start_asset: Option<AssetId>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<(AssetId, Word), Error>> + '_
pub fn get_contract_config(&self) -> Result<Option<Vec<ContractConfig>>, Error>
pub fn owned_message_ids(
&self,
owner: &Address,
start_message_id: Option<MessageId>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<MessageId, Error>> + '_
pub fn all_messages(
&self,
start: Option<MessageId>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<Message, Error>> + '_
pub fn get_message_config(&self) -> Result<Option<Vec<MessageConfig>>, Error>
pub fn get_sealed_block(
&self,
block_id: &Bytes32
) -> Result<Option<SealedFuelBlock>, KvStoreError>
pub fn get_genesis(&self) -> Result<Genesis, KvStoreError>
pub fn get_sealed_block_header(
&self,
block_id: &Bytes32
) -> Result<Option<SealedFuelBlockHeader>, KvStoreError>
pub fn init(&self, config: &ChainConfig) -> Result<(), Error>
pub fn get_chain_name(&self) -> Result<Option<String>, Error>
pub fn get_starting_chain_height(&self) -> Result<Option<BlockHeight>, Error>
pub fn all_transactions(
&self,
start: Option<&Bytes32>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<Transaction, Error>> + '_
sourcepub fn owned_transactions(
&self,
owner: &Address,
start: Option<&OwnedTransactionIndexCursor>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<(OwnedTransactionIndexCursor, Bytes32), Error>> + '_
pub fn owned_transactions(
&self,
owner: &Address,
start: Option<&OwnedTransactionIndexCursor>,
direction: Option<IterDirection>
) -> impl Iterator<Item = Result<(OwnedTransactionIndexCursor, Bytes32), Error>> + '_
Iterates over a KV mapping of [address + block height + tx idx] => transaction id
. This
allows for efficient lookup of transaction ids associated with an address, sorted by
block age and ordering within a block. The cursor tracks the [block height + tx idx]
for
pagination purposes.
pub fn record_tx_id_owner(
&self,
owner: &Address,
block_height: BlockHeight,
tx_idx: TransactionIndex,
tx_id: &Bytes32
) -> Result<Option<Bytes32>, Error>
pub fn update_tx_status(
&self,
id: &Bytes32,
status: TransactionStatus
) -> Result<Option<TransactionStatus>, Error>
pub fn get_tx_status(
&self,
id: &Bytes32
) -> Result<Option<TransactionStatus>, Error>
pub fn transaction(&self) -> DatabaseTransaction
Trait Implementations§
source§impl AsMut<Database> for DatabaseTransaction
impl AsMut<Database> for DatabaseTransaction
source§impl AsRef<Database> for DatabaseTransaction
impl AsRef<Database> for DatabaseTransaction
source§impl Clone for DatabaseTransaction
impl Clone for DatabaseTransaction
source§fn clone(&self) -> DatabaseTransaction
fn clone(&self) -> DatabaseTransaction
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more