util: drop Endpoint structure, fix #321

I think it's useless, buggy and hides parsing errors for no good reason.
This commit is contained in:
Roman Khimov 2019-09-09 17:54:38 +03:00
parent a039ae6cdb
commit 8d9bc83214
9 changed files with 50 additions and 85 deletions

View file

@ -1,10 +1,10 @@
package network
import (
"net"
"testing"
"github.com/CityOfZion/neo-go/pkg/network/payload"
"github.com/CityOfZion/neo-go/pkg/util"
"github.com/stretchr/testify/assert"
)
@ -39,7 +39,8 @@ func TestVerackAfterHandleVersionCmd(t *testing.T) {
s = newTestServer()
p = newLocalPeer(t)
)
p.endpoint = util.NewEndpoint("0.0.0.0:3000")
na, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:3000")
p.netaddr = *na
// Should have a verack
p.messageHandler = func(t *testing.T, msg *Message) {
@ -62,7 +63,8 @@ func TestServerNotSendsVerack(t *testing.T) {
s.id = 1
go s.run()
p.endpoint = util.NewEndpoint("0.0.0.0:3000")
na, _ := net.ResolveTCPAddr("tcp", "0.0.0.0:3000")
p.netaddr = *na
s.register <- p
// Port should mismatch