getMerkleProofsByStatus method

  1. @override
Future<List<MerkleProof>> getMerkleProofsByStatus(
  1. MerkleProofStatus status
)
override

Every proof row with status (for example the MerkleProofStatus.pendingHeader proofs to check once headers arrive).

Implementation

@override
Future<List<MerkleProof>> getMerkleProofsByStatus(MerkleProofStatus status) async {
  _ensureInitialized();

  final result = await _pool!.execute(
    Sql.named('''
      SELECT $_merkleProofColumns
      FROM merkle_proofs
      WHERE status = @status
      ORDER BY id
    '''),
    parameters: {'status': status.name},
  );
  return result.map(_rowToMerkleProof).toList();
}