validateSolution function
Implementation
Future<bool> validateSolution(
Challenge config, Solution result, String serializedInput) async {
List<ChallengePieceResolver> challenges = ChallengePieceResolver.forChallenge(
config,
serializedInput,
);
for (int index = 0; index < challenges.length; index++) {
ChallengePieceResolver challenge = challenges[index];
int nonce = int.parse(result.nonces[index]);
bool isValid = await challenge.validate(nonce);
if (!isValid) {
return false;
}
}
return true;
}