summaryrefslogtreecommitdiff
path: root/srv/src/api/pow.go
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/api/pow.go')
-rw-r--r--srv/src/api/pow.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/srv/src/api/pow.go b/srv/src/api/pow.go
index 1b232b1..ae2d2f1 100644
--- a/srv/src/api/pow.go
+++ b/srv/src/api/pow.go
@@ -6,7 +6,7 @@ import (
"fmt"
"net/http"
- "github.com/mediocregopher/blog.mediocregopher.com/srv/api/apiutils"
+ "github.com/mediocregopher/blog.mediocregopher.com/srv/api/apiutil"
)
func (a *api) newPowChallengeHandler() http.Handler {
@@ -14,7 +14,7 @@ func (a *api) newPowChallengeHandler() http.Handler {
challenge := a.params.PowManager.NewChallenge()
- apiutils.JSONResult(rw, r, struct {
+ apiutil.JSONResult(rw, r, struct {
Seed string `json:"seed"`
Target uint32 `json:"target"`
}{
@@ -30,21 +30,21 @@ func (a *api) requirePowMiddleware(h http.Handler) http.Handler {
seedHex := r.FormValue("powSeed")
seed, err := hex.DecodeString(seedHex)
if err != nil || len(seed) == 0 {
- apiutils.BadRequest(rw, r, errors.New("invalid powSeed"))
+ apiutil.BadRequest(rw, r, errors.New("invalid powSeed"))
return
}
solutionHex := r.FormValue("powSolution")
solution, err := hex.DecodeString(solutionHex)
if err != nil || len(seed) == 0 {
- apiutils.BadRequest(rw, r, errors.New("invalid powSolution"))
+ apiutil.BadRequest(rw, r, errors.New("invalid powSolution"))
return
}
err = a.params.PowManager.CheckSolution(seed, solution)
if err != nil {
- apiutils.BadRequest(rw, r, fmt.Errorf("checking proof-of-work solution: %w", err))
+ apiutil.BadRequest(rw, r, fmt.Errorf("checking proof-of-work solution: %w", err))
return
}