diff --git a/Casper.Network.SDK.Test/NctlGetXTest.cs b/Casper.Network.SDK.Test/NctlGetXTest.cs index 5b740e4..1dda357 100644 --- a/Casper.Network.SDK.Test/NctlGetXTest.cs +++ b/Casper.Network.SDK.Test/NctlGetXTest.cs @@ -161,7 +161,9 @@ public async Task GetBlockTest() var response2 = await _client.GetBlock(1); var result2 = response2.Parse(); Assert.IsNotNull(result2.Block.Hash); - + + Assert.AreEqual(result2.Block.Body.Proposer.IsSystem, result2.Block.Body.Proposer.isSystem); + var response3 = await _client.GetBlock(result2.Block.Hash); var result3 = response3.Parse(); Assert.AreEqual(result2.Block.Hash, result3.Block.Hash); @@ -214,7 +216,8 @@ public async Task GetSystemBlockProposerTest() var response = await _client.GetBlock(0); var result = response.Parse(); Assert.IsNotNull(result.Block.Hash); - Assert.IsTrue(result.Block.Body.Proposer.isSystem); + Assert.IsTrue(result.Block.Body.Proposer.IsSystem); + Assert.AreEqual(result.Block.Body.Proposer.IsSystem, result.Block.Body.Proposer.isSystem); } catch (RpcClientException e) { diff --git a/Casper.Network.SDK/Types/Block.cs b/Casper.Network.SDK/Types/Block.cs index f9f7f32..0233bfe 100644 --- a/Casper.Network.SDK/Types/Block.cs +++ b/Casper.Network.SDK/Types/Block.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Text.Json; using System.Text.Json.Serialization; @@ -79,7 +80,15 @@ public class Proposer /// /// The block was proposed by the system, not a validator /// - public bool isSystem { get; set; } + public bool IsSystem { get; set; } + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Replaced with IsSystem")] + public bool isSystem + { + get => this.IsSystem; + set => this.IsSystem = value; + } /// /// Validator's public key @@ -102,11 +111,11 @@ public override Proposer Read( if (pkhex == "00") return new Proposer() { - isSystem = true, + IsSystem = true, }; return new Proposer() { - isSystem = false, + IsSystem = false, PublicKey = PublicKey.FromHexString(pkhex), }; } @@ -121,7 +130,7 @@ public override void Write( Proposer proposer, JsonSerializerOptions options) { - writer.WriteStringValue(proposer.isSystem ? "00" : proposer.PublicKey.ToAccountHex()); + writer.WriteStringValue(proposer.IsSystem ? "00" : proposer.PublicKey.ToAccountHex()); } } }