Skip to content

Commit 76b7f08

Browse files
committed
2 parents 966b7a4 + d209d15 commit 76b7f08

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/Nethermind/Nethermind.Network.Test/ProtocolsManagerTests.cs

+22-3
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ public Context ReceiveHelloNoEth()
260260
return this;
261261
}
262262

263-
public Context ReceiveHelloWrongEth()
263+
public Context ReceiveHelloEth(int protocolVersion)
264264
{
265265
HelloMessage msg = new HelloMessage();
266-
msg.Capabilities = new List<Capability> {new Capability("eth", 61)};
266+
msg.Capabilities = new List<Capability> {new Capability("eth", protocolVersion)};
267267
msg.NodeId = TestItem.PublicKeyB;
268268
msg.ClientId = "other client v1";
269269
msg.P2PVersion = 5;
@@ -272,6 +272,12 @@ public Context ReceiveHelloWrongEth()
272272
return this;
273273
}
274274

275+
276+
public Context ReceiveHelloWrongEth()
277+
{
278+
return ReceiveHelloEth(61);
279+
}
280+
275281
public Context ReceiveStatusWrongChain()
276282
{
277283
StatusMessage msg = new StatusMessage();
@@ -450,7 +456,7 @@ public void Disconnects_on_wrong_eth()
450456
.ReceiveHelloWrongEth()
451457
.VerifyDisconnected();
452458
}
453-
459+
454460
[Test]
455461
public void Disconnects_on_wrong_chain_id()
456462
{
@@ -478,5 +484,18 @@ public void Disconnects_on_wrong_genesis_hash()
478484
.ReceiveStatusWrongGenesis()
479485
.VerifyDisconnected();
480486
}
487+
488+
[Test]
489+
public void Initialized_with_eth66_only()
490+
{
491+
When
492+
.CreateIncomingSession()
493+
.ActivateChannel()
494+
.Handshake()
495+
.Init()
496+
.VerifyInitialized()
497+
.ReceiveHelloEth(66)
498+
.VerifyInitialized();
499+
}
481500
}
482501
}

src/Nethermind/Nethermind.Network/ProtocolValidator.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ private bool ValidateCapabilities(IEnumerable<Capability> capabilities)
112112
x.Version == 62 ||
113113
x.Version == 63 ||
114114
x.Version == 64 ||
115-
x.Version == 65));
115+
x.Version == 65 ||
116+
x.Version == 66));
116117
}
117118

118119
private bool ValidateChainId(ulong chainId)

0 commit comments

Comments
 (0)