getWitnessesForClaim function
Implementation
Future<List<String>> getWitnessesForClaim(
int epoch,
String identifier,
int timestampS,
) async {
try {
final beacon = await makeBeacon();
if (beacon == null) {
logger.info('No beacon available for getting witnesses');
throw Exception('No beacon available');
}
final state = await beacon.getState(epoch: epoch);
final witnessList = fetchWitnessListForClaim(state, identifier, timestampS);
final witnesses = witnessList.map((w) => w.id.toLowerCase()).toList();
return witnesses;
} catch (err) {
logger.info('Error getting witnesses for claim: $err');
throw Exception('Error getting witnesses for claim: $err');
}
}