pub trait TransactionDependencyProvider: Sync + Send {
// Required methods
fn get_transaction_async<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<TransactionView, TransactionDependencyError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_cell_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<CellOutput, TransactionDependencyError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_cell_data_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Bytes, TransactionDependencyError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_header_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<HeaderView, TransactionDependencyError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_block_extension_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, TransactionDependencyError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_transaction(
&self,
tx_hash: &Byte32,
) -> Result<TransactionView, TransactionDependencyError> { ... }
fn get_cell(
&self,
out_point: &OutPoint,
) -> Result<CellOutput, TransactionDependencyError> { ... }
fn get_cell_data(
&self,
out_point: &OutPoint,
) -> Result<Bytes, TransactionDependencyError> { ... }
fn get_header(
&self,
block_hash: &Byte32,
) -> Result<HeaderView, TransactionDependencyError> { ... }
fn get_block_extension(
&self,
block_hash: &Byte32,
) -> Result<Option<Bytes>, TransactionDependencyError> { ... }
}Expand description
Provider dependency information of a transaction:
- inputs
- cell_deps
- header_deps
Required Methods§
fn get_transaction_async<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<TransactionView, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_cell_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<CellOutput, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cell_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<CellOutput, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
For get the output information of inputs or cell_deps, those cell should be live cell
Sourcefn get_cell_data_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Bytes, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cell_data_async<'life0, 'life1, 'async_trait>(
&'life0 self,
out_point: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Bytes, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
For get the output data information of inputs or cell_deps
Sourcefn get_header_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<HeaderView, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_header_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<HeaderView, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
For get the header information of header_deps
Sourcefn get_block_extension_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_block_extension_async<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hash: &'life1 Byte32,
) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, TransactionDependencyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
For get_block_extension
Provided Methods§
Sourcefn get_transaction(
&self,
tx_hash: &Byte32,
) -> Result<TransactionView, TransactionDependencyError>
fn get_transaction( &self, tx_hash: &Byte32, ) -> Result<TransactionView, TransactionDependencyError>
For verify certain cell belong to certain transaction
Sourcefn get_cell(
&self,
out_point: &OutPoint,
) -> Result<CellOutput, TransactionDependencyError>
fn get_cell( &self, out_point: &OutPoint, ) -> Result<CellOutput, TransactionDependencyError>
For get the output information of inputs or cell_deps, those cell should be live cell
Sourcefn get_cell_data(
&self,
out_point: &OutPoint,
) -> Result<Bytes, TransactionDependencyError>
fn get_cell_data( &self, out_point: &OutPoint, ) -> Result<Bytes, TransactionDependencyError>
For get the output data information of inputs or cell_deps
Sourcefn get_header(
&self,
block_hash: &Byte32,
) -> Result<HeaderView, TransactionDependencyError>
fn get_header( &self, block_hash: &Byte32, ) -> Result<HeaderView, TransactionDependencyError>
For get the header information of header_deps
Sourcefn get_block_extension(
&self,
block_hash: &Byte32,
) -> Result<Option<Bytes>, TransactionDependencyError>
fn get_block_extension( &self, block_hash: &Byte32, ) -> Result<Option<Bytes>, TransactionDependencyError>
For get_block_extension
Trait Implementations§
Source§impl CellDataProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
impl CellDataProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
Source§fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>
fn get_cell_data_hash(&self, out_point: &OutPoint) -> Option<Byte32>
Fetch cell_data_hash from storage, please note that loading a large amount of cell data
and calculating hash may be a performance bottleneck, so here is a separate fn designed
to facilitate caching. Read more
Source§impl CellProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
impl CellProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
Source§impl ExtensionProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
impl ExtensionProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
Source§impl HeaderChecker for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
impl HeaderChecker for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
Source§fn check_valid(&self, block_hash: &Byte32) -> Result<(), OutPointError>
fn check_valid(&self, block_hash: &Byte32) -> Result<(), OutPointError>
Check if header in main chain
Source§impl HeaderProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
impl HeaderProvider for &dyn TransactionDependencyProvider
Available on non-WebAssembly only.
Source§fn get_header(&self, hash: &Byte32) -> Option<HeaderView>
fn get_header(&self, hash: &Byte32) -> Option<HeaderView>
Get the header of the given block hash