Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Aug 14, 2024
1 parent 6579417 commit 915f888
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/taiko-client/preconfapi/server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"

"github.com/taikoxyz/taiko-mono/packages/taiko-client/preconfapi/builder"
"github.com/taikoxyz/taiko-mono/packages/taiko-client/preconfapi/model"
Expand Down Expand Up @@ -57,6 +58,8 @@ type buildBlockResponse struct {
// @Success 200 {object} buildBlockResponse
// @Router /block/build [post]
func (s *PreconfAPIServer) BuildBlock(c echo.Context) error {
log.Info("buildBlock req")

req := &buildBlockRequest{}
if err := c.Bind(req); err != nil {
return c.JSON(http.StatusUnprocessableEntity, err)
Expand Down Expand Up @@ -90,6 +93,8 @@ func (s *PreconfAPIServer) BuildBlock(c echo.Context) error {

hexEncodedTx := hex.EncodeToString(rlpEncodedTx.Bytes())

log.Info("buildBlock res", "tx", hexEncodedTx)

return c.JSON(http.StatusOK, buildBlockResponse{RLPEncodedTx: hexEncodedTx})
}

Expand All @@ -103,6 +108,8 @@ func (s *PreconfAPIServer) BuildBlock(c echo.Context) error {
// @Success 200 {object} buildBlockResponse
// @Router /blocks/build [post]
func (s *PreconfAPIServer) BuildBlocks(c echo.Context) error {
log.Info("buildBlocks req")

req := &buildBlocksRequest{}
if err := c.Bind(req); err != nil {
return c.JSON(http.StatusUnprocessableEntity, err)
Expand Down Expand Up @@ -130,6 +137,8 @@ func (s *PreconfAPIServer) BuildBlocks(c echo.Context) error {

hexEncodedTx := hex.EncodeToString(rlpEncodedTx.Bytes())

log.Info("buildBlocks res", "tx", hexEncodedTx)

return c.JSON(http.StatusOK, buildBlockResponse{RLPEncodedTx: hexEncodedTx})
}

Expand Down

0 comments on commit 915f888

Please sign in to comment.