mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
5bdc115943
Overview of changes: - ClientIdentity has been removed, use discover.NodeID - Server now requires a private key to be set (instead of public key) - Server performs the encryption handshake before launching Peer - Dial logic takes peers from discover table - Encryption handshake code has been cleaned up a bit - baseProtocol is gone because we don't exchange peers anymore - Some parts of baseProtocol have moved into Peer instead
29 lines
520 B
Go
29 lines
520 B
Go
package p2p
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/ethereum/go-ethereum/logger"
|
|
)
|
|
|
|
type testLogger struct{ t *testing.T }
|
|
|
|
func testlog(t *testing.T) testLogger {
|
|
logger.Reset()
|
|
l := testLogger{t}
|
|
logger.AddLogSystem(l)
|
|
return l
|
|
}
|
|
|
|
func (testLogger) GetLogLevel() logger.LogLevel { return logger.DebugDetailLevel }
|
|
func (testLogger) SetLogLevel(logger.LogLevel) {}
|
|
|
|
func (l testLogger) LogPrint(level logger.LogLevel, msg string) {
|
|
l.t.Logf("%s", msg)
|
|
}
|
|
|
|
func (testLogger) detach() {
|
|
logger.Flush()
|
|
logger.Reset()
|
|
}
|