Skip to content

Commit

Permalink
api: use hex encoding in postage api (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralph-pichler authored and acud committed Feb 1, 2021
1 parent 9137466 commit a1094ff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/api/postage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package api

import (
"encoding/hex"
"encoding/json"
"errors"
"math/big"
"net/http"
Expand All @@ -15,8 +17,14 @@ import (
"github.com/gorilla/mux"
)

type batchID []byte

func (b batchID) MarshalJSON() ([]byte, error) {
return json.Marshal(hex.EncodeToString(b))
}

type postageCreateResponse struct {
BatchID []byte `json:"batchID"`
BatchID batchID `json:"batchID"`
}

func (s *server) postageCreateHandler(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit a1094ff

Please sign in to comment.