package server

import (
	"github.com/gofiber/fiber/v2"
)

func (s *Server) handleVerifyPow(c *fiber.Ctx) error {
	// Get id, nonce and proof from the request
	id := c.Params("id")
	nonce := c.Params("nonce")

	// Verify the proof of work
	valid := s.PowChallenger.PowVerifyProof(id, nonce)

	// Return the result
	return c.JSON(fiber.Map{
		"valid": valid,
	})
}
