getBlock method Null safety
- Uint8List id
Gets a serialized block by its id
.
Implementation
Uint8List? getBlock(Uint8List id) {
BlockModel? header = _blockService.get(id);
if (header == null) return null;
List<TransactionModel> transactions = _transactionService.getByBlock(id);
if (transactions.isEmpty) return null;
return _serializeBlock(header, transactions);
}