-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prosopo error simplification #930
Conversation
Pull Request ReviewHey there! 👋 I've summarized the previous results for your pull request review. Take a look: Changes
Suggestions
Bugs
Improvements
function calculateTimeSinceCompletion(currentBlockNumber: number, completedAt: number, blockTimeMs: number): number {
return (currentBlockNumber - completedAt) * blockTimeMs;
}
export function prosopoRouter(env: ProviderEnvironment): Router {
// ...
if (parsed.maxVerifiedTime) {
const currentBlockNumber = await tasks.getCurrentBlockNumber();
const blockTimeMs = await tasks.getBlockTimeMs();
const timeSinceCompletion = calculateTimeSinceCompletion(currentBlockNumber, solution.completedAt, blockTimeMs);
if (timeSinceCompletion > parsed.maxVerifiedTime) {
return res.json({ status: req.t('API.USER_NOT_VERIFIED'), solutionApproved: false });
}
}
// ...
} This refactoring separates the calculation of RatingOverall rating: 7.5/10 Please note that the security rating is difficult to assess without more context on the overall system architecture and security measures in place. That's it! Let me know if you need anything else. 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really tidies things up. A few small changes required.
❌ Deploy Preview for provider-gui failed.
|
No description provided.