Browse Source

migrate to consolidated types; add travis config. (#2)

pull/1439/head
Raúl Kripalani 6 years ago
committed by GitHub
parent
commit
cb81de4268
  1. 8
      p2p/muxer/yamux/yamux.go
  2. 4
      p2p/muxer/yamux/yamux_test.go

8
p2p/muxer/yamux/yamux.go

@ -4,7 +4,7 @@ import (
"io/ioutil"
"net"
smux "github.com/libp2p/go-stream-muxer"
mux "github.com/libp2p/go-libp2p-core/mux"
yamux "github.com/libp2p/go-yamux"
)
@ -24,7 +24,7 @@ func (c *conn) IsClosed() bool {
}
// OpenStream creates a new stream.
func (c *conn) OpenStream() (smux.Stream, error) {
func (c *conn) OpenStream() (mux.MuxedStream, error) {
s, err := c.yamuxSession().OpenStream()
if err != nil {
return nil, err
@ -34,7 +34,7 @@ func (c *conn) OpenStream() (smux.Stream, error) {
}
// AcceptStream accepts a stream opened by the other side.
func (c *conn) AcceptStream() (smux.Stream, error) {
func (c *conn) AcceptStream() (mux.MuxedStream, error) {
s, err := c.yamuxSession().AcceptStream()
return s, err
}
@ -61,7 +61,7 @@ func init() {
DefaultTransport = (*Transport)(config)
}
func (t *Transport) NewConn(nc net.Conn, isServer bool) (smux.Conn, error) {
func (t *Transport) NewConn(nc net.Conn, isServer bool) (mux.MuxedConn, error) {
var s *yamux.Session
var err error
if isServer {

4
p2p/muxer/yamux/yamux_test.go

@ -3,9 +3,9 @@ package sm_yamux
import (
"testing"
test "github.com/libp2p/go-stream-muxer/test"
tmux "github.com/libp2p/go-libp2p-testing/suites/mux"
)
func TestYamuxTransport(t *testing.T) {
test.SubtestAll(t, DefaultTransport)
tmux.SubtestAll(t, DefaultTransport)
}

Loading…
Cancel
Save