Skip to content

Commit

Permalink
add eth debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhiran committed Oct 12, 2024
1 parent f3200e6 commit 2033c45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/apinode/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type httpServer struct {

func (s *httpServer) handleMessage(c *gin.Context) {
req := &HandleMessageReq{}
if err := c.ShouldBind(req); err != nil {
if err := c.ShouldBindJSON(req); err != nil {
slog.Error("failed to bind request", "error", err)
c.JSON(http.StatusBadRequest, NewErrResp(errors.Wrap(err, "invalid request payload")))
return
Expand Down Expand Up @@ -124,7 +124,7 @@ func (s *httpServer) handleMessage(c *gin.Context) {

func (s *httpServer) queryTask(c *gin.Context) {
req := &QueryTaskReq{}
if err := c.ShouldBind(req); err != nil {
if err := c.ShouldBindJSON(req); err != nil {
slog.Error("failed to bind request", "error", err)
c.JSON(http.StatusBadRequest, NewErrResp(errors.Wrap(err, "invalid request payload")))
return
Expand Down
5 changes: 5 additions & 0 deletions task/assigner/assigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ import (
"github.com/pkg/errors"
"golang.org/x/exp/rand"

"github.com/ethereum/go-ethereum/log"
"github.com/iotexproject/w3bstream/block"
"github.com/iotexproject/w3bstream/cmd/sequencer/api"
"github.com/iotexproject/w3bstream/smartcontracts/go/minter"
)

func init() {
log.Root().SetHandler(log.StdoutHandler)
}

type DB interface {
BlockHead() (uint64, common.Hash, error)
NBits() (uint32, error)
Expand Down

0 comments on commit 2033c45

Please sign in to comment.