Skip to content

feat(frontend): wire frontend to backend pow API #5889

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

Closed
wants to merge 17 commits into from

Conversation

DecentAgeCoder
Copy link
Collaborator

@DecentAgeCoder DecentAgeCoder commented Apr 16, 2025

feat(frontend): wire frontend to backend pow API

Motivation

  • The Pull Request addresses the improvements that have already been discussed before splitting the PR. The backend API for createPowChallenge and allowSigning return the response object and not the result, makes the nonce parameter optional for allowSigning, and and refining error handling for better reliability.

Changes

  • allowSigning() can now be called without any parameters
  • Removed AllowSigningResult and CreateChallengeResult since they are not needed any longer
  • Refactored createPowChallenge and allowSigning functions to improve clarity and reliability.
  • Introduced dedicated error handling for CreateChallengeError
  • Updated test implementations for createPowChallenge and allowSigning to reflect changes.
  • Simplified test cases by focusing on updated logic and removing obsolete portions.

Tests

  • Updated tests for allowSigning to match new behavior with simplified parameters.
  • Enhanced createPowChallenge tests to verify proper error handling for specific error cases (e.g., "Challenge in Progress," missing user profile, randomness error).

@DecentAgeCoder DecentAgeCoder marked this pull request as ready for review April 22, 2025 08:52
@DecentAgeCoder DecentAgeCoder requested a review from a team as a code owner April 22, 2025 08:52
…ation of the allowSigning function."

This reverts commit 0f19642.
@DecentAgeCoder DecentAgeCoder force-pushed the feat/frontend/pow/protect-allow-signing-6 branch from 51d24ed to ddd1684 Compare April 22, 2025 09:08
@DecentAgeCoder DecentAgeCoder enabled auto-merge (squash) April 22, 2025 10:06
Copy link
Collaborator

@AntonioVentilii AntonioVentilii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May you please split it between changes for createPowChallenge and changes to allowSigning?

Furthermore, i see that you are removing allowSigningResult: this should go in a separate PR

auto-merge was automatically disabled April 23, 2025 13:20

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants