Skip to content

Commit

Permalink
modify for supporting added ip parameter of BuildResponsePeerInfo fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
owljoa committed Nov 4, 2018
1 parent 85927f2 commit 7880078
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func waitServer(streamWrapper bifrost.StreamWrapper) error {

// handShake 두번째 과정 함수. client 의 peer info 메세지를 server 에게 전달한다.
func sendInfo(streamWrapper bifrost.StreamWrapper, clientOpts ClientOpts, metaData map[string]string) error {
env, err := bifrost.BuildResponsePeerInfo(clientOpts.PubKey, metaData)
env, err := bifrost.BuildResponsePeerInfo(clientOpts.Ip, clientOpts.PubKey, metaData)

if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func requestInfo(streamWrapper bifrost.StreamWrapper) error {

func (s Server) sendInfo(streamWrapper bifrost.StreamWrapper, metaData map[string]string) error {

envelope, err := bifrost.BuildResponsePeerInfo(s.pubKey, metaData)
envelope, err := bifrost.BuildResponsePeerInfo(s.ip, s.pubKey, metaData)

if err != nil {
return errors.New("fail to build info")
Expand Down
3 changes: 2 additions & 1 deletion util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import (

func TestBuildResponsePeerInfo(t *testing.T) {
//given
ip := "127.0.0.1:2323"
keyOpt := mocks.NewMockKeyOpts()

//when
envelope, err := bifrost.BuildResponsePeerInfo(keyOpt.PubKey, nil)
envelope, err := bifrost.BuildResponsePeerInfo(ip, keyOpt.PubKey, nil)
assert.NoError(t, err)

//then
Expand Down

0 comments on commit 7880078

Please sign in to comment.