peer test: set TrickleTimeout for test configs

This commit is contained in:
Johan T. Halseth 2018-07-24 13:10:28 +02:00
parent 08619220b4
commit ee0740a289
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ func mockRemotePeer() error {
UserAgentName: "peer", // User agent name to advertise.
UserAgentVersion: "1.0.0", // User agent version to advertise.
ChainParams: &chaincfg.SimNetParams,
TrickleTimeout: time.Second * 10,
}
// Accept connections on the simnet port.
@ -69,6 +70,7 @@ func Example_newOutboundPeer() {
UserAgentVersion: "1.0.0", // User agent version to advertise.
ChainParams: &chaincfg.SimNetParams,
Services: 0,
TrickleTimeout: time.Second * 10,
Listeners: peer.MessageListeners{
OnVersion: func(p *peer.Peer, msg *wire.MsgVersion) {
fmt.Println("outbound: received version")

View File

@ -236,6 +236,7 @@ func TestPeerConnection(t *testing.T) {
ChainParams: &chaincfg.MainNetParams,
ProtocolVersion: wire.RejectVersion, // Configure with older version
Services: 0,
TrickleTimeout: time.Second * 10,
}
peer2Cfg := &peer.Config{
Listeners: peer1Cfg.Listeners,
@ -244,6 +245,7 @@ func TestPeerConnection(t *testing.T) {
UserAgentComments: []string{"comment"},
ChainParams: &chaincfg.MainNetParams,
Services: wire.SFNodeNetwork | wire.SFNodeWitness,
TrickleTimeout: time.Second * 10,
}
wantStats1 := peerStats{
@ -447,6 +449,7 @@ func TestPeerListeners(t *testing.T) {
UserAgentComments: []string{"comment"},
ChainParams: &chaincfg.MainNetParams,
Services: wire.SFNodeBloom,
TrickleTimeout: time.Second * 10,
}
inConn, outConn := pipe(
&conn{raddr: "10.0.0.1:8333"},
@ -617,6 +620,7 @@ func TestOutboundPeer(t *testing.T) {
UserAgentComments: []string{"comment"},
ChainParams: &chaincfg.MainNetParams,
Services: 0,
TrickleTimeout: time.Second * 10,
}
r, w := io.Pipe()
@ -757,6 +761,7 @@ func TestUnsupportedVersionPeer(t *testing.T) {
UserAgentComments: []string{"comment"},
ChainParams: &chaincfg.MainNetParams,
Services: 0,
TrickleTimeout: time.Second * 10,
}
localNA := wire.NewNetAddressIPPort(