2022-06-18 00:09:23 +08:00
|
|
|
package canonicallog
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2022-06-24 22:46:19 +08:00
|
|
|
"net"
|
2022-06-18 00:09:23 +08:00
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/libp2p/go-libp2p-core/test"
|
|
|
|
"github.com/multiformats/go-multiaddr"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestLogs(t *testing.T) {
|
|
|
|
LogMisbehavingPeer(test.RandPeerIDFatal(t), multiaddr.StringCast("/ip4/1.2.3.4"), "somecomponent", fmt.Errorf("something"), "hi")
|
|
|
|
|
2022-06-24 22:46:19 +08:00
|
|
|
netAddr := &net.TCPAddr{IP: net.ParseIP("127.0.0.1"), Port: 80}
|
|
|
|
LogMisbehavingPeerNetAddr(test.RandPeerIDFatal(t), netAddr, "somecomponent", fmt.Errorf("something"), "hi")
|
|
|
|
}
|