Commit 1eedfdd2 authored by suyanlong's avatar suyanlong

Fixed type word

parent 4571e7a4
Pipeline #7986 failed with stages
......@@ -81,8 +81,8 @@ func (g *Server) registerAppchain(c *gin.Context) {
}
func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) {
// target pier id
pierID := c.Query("pier_id")
// target sidecar id
sidecarID := c.Query("sidecar_id")
var res pb.Response
var appchain appchainmgr.Appchain
if err := c.BindJSON(&appchain); err != nil {
......@@ -96,7 +96,7 @@ func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) {
}
msg := pb.Msg(appchainType, true, data)
ackMsg, err := g.peerMgr.SendByID(pierID, msg)
ackMsg, err := g.peerMgr.SendByID(sidecarID, msg)
if err != nil {
res.Data = []byte(err.Error())
c.JSON(http.StatusInternalServerError, res)
......@@ -130,15 +130,15 @@ func (g *Server) handleAckAppchain(c *gin.Context, msg *pb.Message) {
func (g *Server) getAppchain(c *gin.Context) {
res := &response{}
// target pier id
selfPierID, err := g.getSelfPierID(c)
// target sidecar id
selfSidecarID, err := g.getSelfSidecarID(c)
if err != nil {
c.JSON(http.StatusInternalServerError, err.Error())
return
}
targetPierID := c.Query("pier_id")
targetSidecarID := c.Query("sidecar_id")
appchain := &appchainmgr.Appchain{
ID: selfPierID,
ID: selfSidecarID,
}
data, err := json.Marshal(appchain)
......@@ -148,7 +148,7 @@ func (g *Server) getAppchain(c *gin.Context) {
}
msg := pb.Msg(pb.Message_APPCHAIN_GET, true, data)
ackMsg, err := g.peerMgr.SendByID(targetPierID, msg)
ackMsg, err := g.peerMgr.SendByID(targetSidecarID, msg)
if err != nil {
res.Data = []byte(err.Error())
c.JSON(http.StatusInternalServerError, res)
......@@ -158,7 +158,7 @@ func (g *Server) getAppchain(c *gin.Context) {
g.handleAckAppchain(c, ackMsg)
}
func (g *Server) getSelfPierID(ctx *gin.Context) (string, error) {
func (g *Server) getSelfSidecarID(ctx *gin.Context) (string, error) {
repoRoot := g.config.RepoRoot
keyPath := filepath.Join(repoRoot, "key.json")
......
......@@ -17,7 +17,6 @@ type Router interface {
Adds(p []port.Port) error
//Route sends ibtp to the union pier in target relay chain
Route(ibtp *pb.Message) error
Load(key string) (value port.Port, ok bool)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment