Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marc <[email protected]>
  • Loading branch information
flcl42 and Marchhill authored Oct 15, 2024
1 parent 1197d1c commit 5a07992
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libp2p/Libp2p.Core/Discovery/PeerStore.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
// SPDX-License-Identifier: MIT

using Google.Protobuf;
Expand Down
4 changes: 2 additions & 2 deletions src/libp2p/Libp2p.Protocols.MDns/MDnsDiscoveryProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class MDnsDiscoveryProtocol(PeerStore peerStore, ILoggerFactory? loggerFa

public static string Id => "mdns";

private readonly string ServiceName = "_p2p._udp.local";
private const string ServiceName = "_p2p._udp.local";

private readonly string? ServiceNameOverride = "pubsub-chat-example";
private const string? ServiceNameOverride = "pubsub-chat-example";

private string PeerName = null!;

Expand Down
4 changes: 2 additions & 2 deletions src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.Topics.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
// SPDX-License-Identifier: MIT

using Nethermind.Libp2p.Core;
Expand Down Expand Up @@ -118,7 +118,7 @@ public void Publish(string topicId, byte[] message)
topicState.GetOrAdd(topicId, (id) => new Topic(this, topicId));

ulong seqNo = this.seqNo++;
byte[] seqNoBytes = new byte[8];
byte[] seqNoBytes = stackalloc byte[8];

Check failure on line 121 in src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.Topics.cs

View workflow job for this annotation

GitHub Actions / Test

Conversion of a stackalloc expression of type 'byte' to type 'byte[]' is not possible.

Check failure on line 121 in src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.Topics.cs

View workflow job for this annotation

GitHub Actions / Test

Conversion of a stackalloc expression of type 'byte' to type 'byte[]' is not possible.

Check failure on line 121 in src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.Topics.cs

View workflow job for this annotation

GitHub Actions / Test and publish

Conversion of a stackalloc expression of type 'byte' to type 'byte[]' is not possible.

Check failure on line 121 in src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.Topics.cs

View workflow job for this annotation

GitHub Actions / Test and publish

Conversion of a stackalloc expression of type 'byte' to type 'byte[]' is not possible.
BinaryPrimitives.WriteUInt64BigEndian(seqNoBytes, seqNo);
Rpc rpc = new Rpc().WithMessages(topicId, seqNo, localPeer!.Address.GetPeerId()!.Bytes, message, localPeer.Identity);

Expand Down

0 comments on commit 5a07992

Please sign in to comment.