-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into taikoon-ui-setup
- Loading branch information
Showing
58 changed files
with
995 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/guardian-prover-health-check/http/get_health_checks_by_guardian_prover_address.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package http | ||
|
||
import ( | ||
"errors" | ||
"net/http" | ||
|
||
echo "github.com/labstack/echo/v4" | ||
) | ||
|
||
// GetHealthChecksByGuardianProverAddress | ||
// | ||
// returns the health checks. | ||
// | ||
// @Summary Get health checks by guardian prover address | ||
// @ID get-health-checks-by-guardian-prover-address | ||
// @Accept json | ||
// @Produce json | ||
// @Success 200 {object} paginate.Page | ||
// @Router /healthchecks [get] | ||
// @Param address string true "guardian prover address with which to query" | ||
|
||
func (srv *Server) GetHealthChecksByGuardianProverAddress(c echo.Context) error { | ||
address := c.Param("address") | ||
if address == "" { | ||
return c.JSON(http.StatusBadRequest, errors.New("no address provided")) | ||
} | ||
|
||
page, err := srv.healthCheckRepo.GetByGuardianProverAddress(c.Request().Context(), c.Request(), address) | ||
if err != nil { | ||
return c.JSON(http.StatusBadRequest, err) | ||
} | ||
|
||
return c.JSON(http.StatusOK, page) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
packages/guardian-prover-health-check/http/get_health_checks_by_guardian_prover_id.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...rdian-prover-health-check/http/get_most_recent_signed_block_by_guardian_prover_address.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package http | ||
|
||
import ( | ||
"errors" | ||
"net/http" | ||
|
||
echo "github.com/labstack/echo/v4" | ||
"github.com/labstack/gommon/log" | ||
) | ||
|
||
// GetMostRecentSignedBlockByGuardianProverID | ||
// | ||
// returns signed block data by each guardian prover. | ||
// | ||
// @Summary Get most recent signed block by guardian prover address | ||
// @ID get-most-recent-signed-block-by-guardian-prover-address | ||
// @Accept json | ||
// @Produce json | ||
// @Success 200 {object} block | ||
// @Router /signedBlocks/:address[get] | ||
|
||
func (srv *Server) GetMostRecentSignedBlockByGuardianProverAddress(c echo.Context) error { | ||
address := c.Param("address") | ||
if address == "" { | ||
return c.JSON(http.StatusBadRequest, errors.New("no address provided")) | ||
} | ||
|
||
signedBlock, err := srv.signedBlockRepo.GetMostRecentByGuardianProverAddress( | ||
address, | ||
) | ||
|
||
if err != nil { | ||
log.Error("Failed to most recent block by guardian prover address", "error", err) | ||
return echo.NewHTTPError(http.StatusInternalServerError, err) | ||
} | ||
|
||
return c.JSON(http.StatusOK, signedBlock) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
...s/guardian-prover-health-check/http/get_most_recent_signed_block_by_guardian_prover_id.go
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...s/guardian-prover-health-check/http/get_most_recent_startup_by_guardian_prover_address.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package http | ||
|
||
import ( | ||
"errors" | ||
"net/http" | ||
|
||
echo "github.com/labstack/echo/v4" | ||
) | ||
|
||
// GetMostRecentStartupByGuardianProverAddress | ||
// | ||
// returns the startup | ||
// | ||
// @Summary GetMostRecentStartupByGuardianProverAddress | ||
// @ID get-most-recent-startup-by-guardian-prover-address | ||
// @Accept json | ||
// @Produce json | ||
// @Success 200 {object} guardianproverhealthcheck.Startup | ||
// @Router /mostRecentStartup/:address [get] | ||
|
||
func (srv *Server) GetMostRecentStartupByGuardianProverAddress( | ||
c echo.Context, | ||
) error { | ||
address := c.Param("address") | ||
if address == "" { | ||
return c.JSON(http.StatusBadRequest, errors.New("no address provided")) | ||
} | ||
|
||
startup, err := srv.startupRepo.GetMostRecentByGuardianProverAddress( | ||
c.Request().Context(), address, | ||
) | ||
if err != nil { | ||
return c.JSON(http.StatusBadRequest, err) | ||
} | ||
|
||
return c.JSON(http.StatusOK, startup) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
packages/guardian-prover-health-check/http/get_most_recent_startup_by_guardian_prover_id.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.