Skip to content

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
uink45 committed Oct 17, 2024
1 parent 18ca316 commit 0555e66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Lantern.Beacon/BeaconClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ private async Task MonitorSyncStatus(CancellationToken token)
peer.Address.Get<IP4>().Value.ToString(),
peer.Address.Get<TCP>().Value.ToString(),
peer.Address.Get<P2P>().Value.ToString());

peerState.BootstrapPeers.TryRemove(peer.Address.GetPeerId()!, out _);
await DialPeerWithProtocol<GoodbyeProtocol>(peer, token);
}
Expand Down
3 changes: 2 additions & 1 deletion test/Lantern.Beacon.Tests/BeaconClientManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public async Task DialPeer_ShouldReturnIfPeerAddressIsNull()
[Test]
public async Task DialPeer_ShouldSaveValidPeerAsLivePeer()
{
var clientOptions = new BeaconClientOptions { EnableDiscovery = false, TargetPeerCount = 1, DialTimeoutSeconds = 1};
var clientOptions = new BeaconClientOptions { EnableDiscovery = false, TargetPeerCount = 1, DialTimeoutSeconds = 10};
var multiAddress = new Multiaddress().Add<IP4>("0.0.0.0").Add<TCP>(0);
var mockRemotePeer = new Mock<IRemotePeer>();
var syncOptions = new SyncProtocolOptions() { GenesisValidatorsRoot = new byte[32], GenesisTime = 1606824023, Preset = SizePreset.MainnetPreset };
Expand All @@ -480,6 +480,7 @@ public async Task DialPeer_ShouldSaveValidPeerAsLivePeer()
_mockPeerState.Setup(x => x.BootstrapPeers).Returns(new ConcurrentDictionary<PeerId, IRemotePeer>());
_mockPeerState.Setup(x => x.PeerProtocols).Returns(peerProtocols);
_mockSyncProtocol.Setup(x => x.DenebLightClientStore).Returns(denebLightClientStore);
_mockSyncProtocol.Setup(x => x.IsInitialised).Returns(true);
_mockSyncProtocol.Setup(x => x.Options).Returns(syncOptions);
_beaconClientManager = new BeaconClientManager(clientOptions, _mockManualDiscoveryProtocol.Object, _mockLiteDbService.Object, _mockCustomDiscoveryProtocol.Object, _mockPeerState.Object, _mockSyncProtocol.Object, _mockPeerFactory.Object, _mockIdentityManager.Object, _mockLoggerFactory.Object);

Expand Down

0 comments on commit 0555e66

Please sign in to comment.