mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Merge pull request #486 from hermeznetwork/fix/api-hardcoded-bootcoordinator
Stop using hardcoded bootcoordinator in api
This commit is contained in:
@@ -465,9 +465,8 @@ func TestMain(m *testing.M) {
|
|||||||
}
|
}
|
||||||
bootForger := NextForger{
|
bootForger := NextForger{
|
||||||
Coordinator: historydb.CoordinatorAPI{
|
Coordinator: historydb.CoordinatorAPI{
|
||||||
Bidder: ethCommon.HexToAddress("0x0111111111111111111111111111111111111111"),
|
Forger: auctionVars.BootCoordinator,
|
||||||
Forger: ethCommon.HexToAddress("0x0111111111111111111111111111111111111111"),
|
URL: auctionVars.BootCoordinatorURL,
|
||||||
URL: "https://bootCoordinator",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// Set next forgers: set all as boot coordinator then replace the non boot coordinators
|
// Set next forgers: set all as boot coordinator then replace the non boot coordinators
|
||||||
|
|||||||
13
api/state.go
13
api/state.go
@@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
ethCommon "github.com/ethereum/go-ethereum/common"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/hermeznetwork/hermez-node/apitypes"
|
"github.com/hermeznetwork/hermez-node/apitypes"
|
||||||
"github.com/hermeznetwork/hermez-node/common"
|
"github.com/hermeznetwork/hermez-node/common"
|
||||||
@@ -39,13 +38,6 @@ type Period struct {
|
|||||||
ToTimestamp time.Time `json:"toTimestamp"`
|
ToTimestamp time.Time `json:"toTimestamp"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var bootCoordinator historydb.CoordinatorAPI = historydb.CoordinatorAPI{
|
|
||||||
ItemID: 0,
|
|
||||||
Bidder: ethCommon.HexToAddress("0x111111111111111111111111111111111111111"),
|
|
||||||
Forger: ethCommon.HexToAddress("0x111111111111111111111111111111111111111"),
|
|
||||||
URL: "https://bootCoordinator",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *API) getState(c *gin.Context) {
|
func (a *API) getState(c *gin.Context) {
|
||||||
// TODO: There are no events for the buckets information, so now this information will be 0
|
// TODO: There are no events for the buckets information, so now this information will be 0
|
||||||
a.status.RLock()
|
a.status.RLock()
|
||||||
@@ -266,7 +258,10 @@ func (a *API) getNextForgers(lastBlock common.Block, currentSlot, lastClosedSlot
|
|||||||
}
|
}
|
||||||
// If there is no bid, the coordinator that will forge is boot coordinator
|
// If there is no bid, the coordinator that will forge is boot coordinator
|
||||||
if !foundForger {
|
if !foundForger {
|
||||||
nextForger.Coordinator = bootCoordinator
|
nextForger.Coordinator = historydb.CoordinatorAPI{
|
||||||
|
Forger: a.status.Auction.BootCoordinator,
|
||||||
|
URL: a.status.Auction.BootCoordinatorURL,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nextForgers = append(nextForgers, nextForger)
|
nextForgers = append(nextForgers, nextForger)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user