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) { ...@@ -81,8 +81,8 @@ func (g *Server) registerAppchain(c *gin.Context) {
} }
func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) { func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) {
// target pier id // target sidecar id
pierID := c.Query("pier_id") sidecarID := c.Query("sidecar_id")
var res pb.Response var res pb.Response
var appchain appchainmgr.Appchain var appchain appchainmgr.Appchain
if err := c.BindJSON(&appchain); err != nil { if err := c.BindJSON(&appchain); err != nil {
...@@ -96,7 +96,7 @@ func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) { ...@@ -96,7 +96,7 @@ func (g *Server) sendAppchain(c *gin.Context, appchainType pb.Message_Type) {
} }
msg := pb.Msg(appchainType, true, data) msg := pb.Msg(appchainType, true, data)
ackMsg, err := g.peerMgr.SendByID(pierID, msg) ackMsg, err := g.peerMgr.SendByID(sidecarID, msg)
if err != nil { if err != nil {
res.Data = []byte(err.Error()) res.Data = []byte(err.Error())
c.JSON(http.StatusInternalServerError, res) c.JSON(http.StatusInternalServerError, res)
...@@ -130,15 +130,15 @@ func (g *Server) handleAckAppchain(c *gin.Context, msg *pb.Message) { ...@@ -130,15 +130,15 @@ func (g *Server) handleAckAppchain(c *gin.Context, msg *pb.Message) {
func (g *Server) getAppchain(c *gin.Context) { func (g *Server) getAppchain(c *gin.Context) {
res := &response{} res := &response{}
// target pier id // target sidecar id
selfPierID, err := g.getSelfPierID(c) selfSidecarID, err := g.getSelfSidecarID(c)
if err != nil { if err != nil {
c.JSON(http.StatusInternalServerError, err.Error()) c.JSON(http.StatusInternalServerError, err.Error())
return return
} }
targetPierID := c.Query("pier_id") targetSidecarID := c.Query("sidecar_id")
appchain := &appchainmgr.Appchain{ appchain := &appchainmgr.Appchain{
ID: selfPierID, ID: selfSidecarID,
} }
data, err := json.Marshal(appchain) data, err := json.Marshal(appchain)
...@@ -148,7 +148,7 @@ func (g *Server) getAppchain(c *gin.Context) { ...@@ -148,7 +148,7 @@ func (g *Server) getAppchain(c *gin.Context) {
} }
msg := pb.Msg(pb.Message_APPCHAIN_GET, true, data) 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 { if err != nil {
res.Data = []byte(err.Error()) res.Data = []byte(err.Error())
c.JSON(http.StatusInternalServerError, res) c.JSON(http.StatusInternalServerError, res)
...@@ -158,7 +158,7 @@ func (g *Server) getAppchain(c *gin.Context) { ...@@ -158,7 +158,7 @@ func (g *Server) getAppchain(c *gin.Context) {
g.handleAckAppchain(c, ackMsg) 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 repoRoot := g.config.RepoRoot
keyPath := filepath.Join(repoRoot, "key.json") keyPath := filepath.Join(repoRoot, "key.json")
......
...@@ -17,7 +17,6 @@ type Router interface { ...@@ -17,7 +17,6 @@ type Router interface {
Adds(p []port.Port) error Adds(p []port.Port) error
//Route sends ibtp to the union pier in target relay chain
Route(ibtp *pb.Message) error Route(ibtp *pb.Message) error
Load(key string) (value port.Port, ok bool) 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