(&self)
| 41 | } |
| 42 | |
| 43 | pub(crate) fn get_current_block(&self) -> Result<Block> { |
| 44 | let block = self |
| 45 | .blocks |
| 46 | .last() |
| 47 | .ok_or_else(|| ChainError::BlockNotFound("current block".into()))?; |
| 48 | |
| 49 | Ok(block.to_owned()) |
| 50 | } |
| 51 | |
| 52 | pub(crate) fn get_block_by_number(&self, block_number: U64) -> Result<Block> { |
| 53 | let index = (block_number - 1).as_usize(); |
no outgoing calls
no test coverage detected