Struct ckb_sdk::traits::default_impls::DefaultCellCollector
source · pub struct DefaultCellCollector { /* private fields */ }Expand description
A cell collector use ckb-indexer as backend
Implementations§
source§impl DefaultCellCollector
impl DefaultCellCollector
pub fn new(ckb_client: &str) -> DefaultCellCollector
sourcepub fn acceptable_indexer_leftbehind(&self) -> u64
pub fn acceptable_indexer_leftbehind(&self) -> u64
THe acceptable ckb-indexer leftbehind block number (default = 1)
sourcepub fn set_acceptable_indexer_leftbehind(&mut self, value: u64)
pub fn set_acceptable_indexer_leftbehind(&mut self, value: u64)
Set the acceptable ckb-indexer leftbehind block number
sourcepub fn check_ckb_chain(&mut self) -> Result<(), CellCollectorError>
pub fn check_ckb_chain(&mut self) -> Result<(), CellCollectorError>
Check if ckb-indexer synced with ckb node. This will check every 50ms for 100 times (more than 5s in total, since ckb-indexer’s poll interval is 2.0s).
Trait Implementations§
source§impl CellCollector for DefaultCellCollector
impl CellCollector for DefaultCellCollector
source§fn collect_live_cells(
&mut self,
query: &CellQueryOptions,
apply_changes: bool
) -> Result<(Vec<LiveCell>, u64), CellCollectorError>
fn collect_live_cells(
&mut self,
query: &CellQueryOptions,
apply_changes: bool
) -> Result<(Vec<LiveCell>, u64), CellCollectorError>
Collect live cells by query options, if
apply_changes is true will
mark all collected cells as dead cells.source§fn lock_cell(&mut self, out_point: OutPoint) -> Result<(), CellCollectorError>
fn lock_cell(&mut self, out_point: OutPoint) -> Result<(), CellCollectorError>
Mark this cell as dead cell
source§fn apply_tx(&mut self, tx: Transaction) -> Result<(), CellCollectorError>
fn apply_tx(&mut self, tx: Transaction) -> Result<(), CellCollectorError>
Mark all inputs as dead cells and outputs as live cells in the transaction.