Put api DBs into struct

This commit is contained in:
Arnau B
2020-11-06 11:57:57 +01:00
parent 3591e3c2a2
commit 1112ded933
18 changed files with 172 additions and 172 deletions

View File

@@ -1,16 +1,11 @@
package api
import (
"github.com/hermeznetwork/hermez-node/common"
"github.com/hermeznetwork/hermez-node/db/historydb"
"net/http"
"github.com/gin-gonic/gin"
)
// Status define status of the network
type Status struct {
Network historydb.Network `json:"network"`
Metrics historydb.Metrics `json:"metrics"`
Rollup common.RollupVariables `json:"rollup"`
Auction common.AuctionVariables `json:"auction"`
WithdrawalDelayer common.WDelayerVariables `json:"withdrawalDelayer"`
RecommendedFee common.RecommendedFee `json:"recommendedFee"`
func (a *API) getState(c *gin.Context) {
c.JSON(http.StatusOK, a.status)
}