Skip to content

Commit a9e5ae2

Browse files
authored
api: update root endpoint to have correct query func (#80)
1 parent 013c72c commit a9e5ae2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api/root.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77

88
"github.com/ethereum/go-ethereum/common/hexutil"
9+
"github.com/jackc/pgx/v4"
910
)
1011

1112
func proofURLToDBQuery(param string) string {
@@ -53,6 +54,11 @@ func (s *Server) GetRoot(w http.ResponseWriter, r *http.Request) {
5354
roots := make([]hexutil.Bytes, 0)
5455
rb := make(hexutil.Bytes, 0)
5556

57+
_, err := s.db.QueryFunc(ctx, q, []interface{}{dbQuery}, []interface{}{&rb}, func(qfr pgx.QueryFuncRow) error {
58+
roots = append(roots, rb)
59+
return nil
60+
})
61+
5662
if err != nil {
5763
s.sendJSONError(r, w, err, http.StatusInternalServerError, "selecting root")
5864
return

0 commit comments

Comments
 (0)