From 6180f2a26fbc0067dcaf6d39b22a490a307ed2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Holm=20Gj=C3=B8rup?= Date: Wed, 11 Sep 2024 15:43:28 +0200 Subject: [PATCH] Address review comments --- src/Types/BlockHashInput.cs | 8 ++++---- src/Types/BlockHeight.cs | 6 +++--- src/Types/CcdAmount.cs | 12 +----------- src/Types/ReceiveName.cs | 2 +- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/Types/BlockHashInput.cs b/src/Types/BlockHashInput.cs index 4c3cdb7d..f8aaaaaa 100644 --- a/src/Types/BlockHashInput.cs +++ b/src/Types/BlockHashInput.cs @@ -8,7 +8,7 @@ namespace Concordium.Sdk.Types; public interface IBlockHashInput { /// - /// Convert this into type expected by the gRPC. + /// Convert this into the type expected by the gRPC API. /// BlockHashInput Into(); } @@ -21,7 +21,7 @@ public sealed record Best : IBlockHashInput private static readonly Empty _empty = new(); /// - /// Convert this into type expected by the gRPC. + /// Convert this into the type expected by the gRPC API. /// public BlockHashInput Into() => new() { @@ -38,7 +38,7 @@ public sealed record LastFinal : IBlockHashInput private static readonly Empty _empty = new(); /// - /// Convert this into type expected by the gRPC. + /// Convert this into the type expected by the gRPC API. /// public BlockHashInput Into() => new() { @@ -52,7 +52,7 @@ public sealed record LastFinal : IBlockHashInput public sealed record Given(BlockHash BlockHash) : IBlockHashInput { /// - /// Convert this into type expected by the gRPC. + /// Convert this into the type expected by the gRPC API. /// public BlockHashInput Into() => new() { Given = this.BlockHash.ToProto() }; } diff --git a/src/Types/BlockHeight.cs b/src/Types/BlockHeight.cs index 9e976f85..e1d74aeb 100644 --- a/src/Types/BlockHeight.cs +++ b/src/Types/BlockHeight.cs @@ -8,7 +8,7 @@ namespace Concordium.Sdk.Types; public interface IBlockHeight { /// - /// Convert into a request for blocks at height. + /// Convert into a BlocksAtHeightRequest. /// BlocksAtHeightRequest Into(); } @@ -22,7 +22,7 @@ public sealed record AbsoluteHeight(ulong Height) : IBlockHeight internal static AbsoluteHeight From(AbsoluteBlockHeight blockHeight) => new(blockHeight.Value); /// - /// Convert an AbsoluteHeight into a request for blocks at height. + /// Convert an AbsoluteHeight into a BlocksAtHeightRequest. /// public BlocksAtHeightRequest Into() => new() @@ -47,7 +47,7 @@ public BlocksAtHeightRequest Into() => public sealed record RelativeHeight(ulong Height, uint GenesisIndex, bool Restrict) : IBlockHeight { /// - /// Convert an RelativeHeight into a request for blocks at height. + /// Convert a RelativeHeight into a BlocksAtHeightRequest. /// public BlocksAtHeightRequest Into() => new() diff --git a/src/Types/CcdAmount.cs b/src/Types/CcdAmount.cs index c1753f02..cf5ca11b 100644 --- a/src/Types/CcdAmount.cs +++ b/src/Types/CcdAmount.cs @@ -139,17 +139,7 @@ public static bool TryDeserial(ReadOnlySpan bytes, out (CcdAmount? Amount, /// /// Return the largest of two amounts. /// - public static CcdAmount Max(CcdAmount first, CcdAmount second) - { - if (first < second) - { - return second; - } - else - { - return first; - } - } + public static CcdAmount Max(CcdAmount first, CcdAmount second) => first < second ? second : first; /// Determines whether one CcdAmount is less than a second CcdAmount. public static bool operator <(CcdAmount left, CcdAmount right) => left.Value.CompareTo(right.Value) < 0; diff --git a/src/Types/ReceiveName.cs b/src/Types/ReceiveName.cs index 42ea99d4..d3ba1615 100644 --- a/src/Types/ReceiveName.cs +++ b/src/Types/ReceiveName.cs @@ -71,7 +71,7 @@ public enum ValidationError MissingDotSeparator, /// The receive name is more than 100 characters. TooLong, - /// The receive name contained invalid characters. + /// The receive name contained characters that are not ASCII alphanumeric or ASCII punctuation. InvalidCharacters, }