pub trait HoprDbLogOperations {
// Required methods
fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait;
fn set_log_processed<'life0, 'async_trait>(
&'life0 self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
Sourcefn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ensures that logs in this database have been created by scanning the given contract address and their corresponding topics. If the log DB is empty, the given addresses and topics are used to prime the table.
§Arguments
contract_address_topics
- list of topics for a contract address. There may be multiple topics with the same contract address.
§Returns
A Result
which is Ok(())
if the database contains correct log data,
or it has been primed successfully. An Err
is returned otherwise.
Sourcefn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sourcefn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a specific log entry from the database.
§Arguments
block_number
- The block number of the log entry.tx_index
- The transaction index of the log entry.log_index
- The log index of the log entry.
§Returns
A Result
containing the SerializableLog
if the operation succeeds or an error if it fails.
Sourcefn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sourcefn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves block numbers of log entries from the database.
§Arguments
block_number
- An optional block number filter.block_offset
- An optional block offset filter.processed
- An optional processed filter.
§Returns
A Result
containing a Vec
of block numbers if the operation succeeds or an error if it fails.
Sourcefn set_log_processed<'life0, 'async_trait>(
&'life0 self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_log_processed<'life0, 'async_trait>(
&'life0 self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the last checksummed log entry from the database.
§Returns
A Result
containing an Option<SerializableLog>
if the operation succeeds or an error if it fails.
Sourcefn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates checksums for log entries in the database.
§Returns
A Result
which is Ok(Hash)
if the operation succeeds or an error if it fails.