Skip to content

Commit

Permalink
Clean up NetAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Sep 26, 2024
1 parent e91a1a8 commit ea6d19a
Show file tree
Hide file tree
Showing 12 changed files with 468 additions and 371 deletions.
4 changes: 2 additions & 2 deletions tm2/pkg/p2p/base_reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ type Reactor interface {
Receive(chID byte, peer Peer, msgBytes []byte)
}

//--------------------------------------
// --------------------------------------

type BaseReactor struct {
service.BaseService // Provides Start, Stop, .Quit
service.BaseService // Provides Start, Stop, Quit
Switch *Switch
}

Expand Down
22 changes: 22 additions & 0 deletions tm2/pkg/p2p/conn/conn.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package conn

import (
"net"
"time"
)

// pipe wraps the networking conn interface
type pipe struct {
net.Conn
}

func (p *pipe) SetDeadline(_ time.Time) error {
return nil
}

func NetPipe() (net.Conn, net.Conn) {
p1, p2 := net.Pipe()
return &pipe{p1}, &pipe{p2}
}

var _ net.Conn = (*pipe)(nil)
15 changes: 0 additions & 15 deletions tm2/pkg/p2p/conn/conn_go110.go

This file was deleted.

36 changes: 0 additions & 36 deletions tm2/pkg/p2p/conn/conn_notgo110.go

This file was deleted.

2 changes: 1 addition & 1 deletion tm2/pkg/p2p/mock/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewPeer(ip net.IP) *Peer {
if ip == nil {
_, netAddr = p2p.CreateRoutableAddr()
} else {
netAddr = p2p.NewNetAddressFromIPPort("", ip, 26656)
netAddr = p2p.NewNetAddressFromIPPort(ip, 26656)
}
nodeKey := p2p.NodeKey{PrivKey: ed25519.GenPrivKey()}
netAddr.ID = nodeKey.ID()
Expand Down
Loading

0 comments on commit ea6d19a

Please sign in to comment.