Skip to content

Commit c3d7e4b

Browse files
authored
Merge pull request #51 from make-software/fix-issystem-typo
Fixes isSystem typo.
2 parents 661286a + f9f1e3a commit c3d7e4b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

Casper.Network.SDK.Test/NctlGetXTest.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ public async Task GetBlockTest()
161161
var response2 = await _client.GetBlock(1);
162162
var result2 = response2.Parse();
163163
Assert.IsNotNull(result2.Block.Hash);
164-
164+
165+
Assert.AreEqual(result2.Block.Body.Proposer.IsSystem, result2.Block.Body.Proposer.isSystem);
166+
165167
var response3 = await _client.GetBlock(result2.Block.Hash);
166168
var result3 = response3.Parse();
167169
Assert.AreEqual(result2.Block.Hash, result3.Block.Hash);
@@ -214,7 +216,8 @@ public async Task GetSystemBlockProposerTest()
214216
var response = await _client.GetBlock(0);
215217
var result = response.Parse();
216218
Assert.IsNotNull(result.Block.Hash);
217-
Assert.IsTrue(result.Block.Body.Proposer.isSystem);
219+
Assert.IsTrue(result.Block.Body.Proposer.IsSystem);
220+
Assert.AreEqual(result.Block.Body.Proposer.IsSystem, result.Block.Body.Proposer.isSystem);
218221
}
219222
catch (RpcClientException e)
220223
{

Casper.Network.SDK/Types/Block.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel;
34
using System.Text.Json;
45
using System.Text.Json.Serialization;
56

@@ -79,7 +80,15 @@ public class Proposer
7980
/// <summary>
8081
/// The block was proposed by the system, not a validator
8182
/// </summary>
82-
public bool isSystem { get; set; }
83+
public bool IsSystem { get; set; }
84+
85+
[EditorBrowsable(EditorBrowsableState.Never)]
86+
[Obsolete("Replaced with IsSystem")]
87+
public bool isSystem
88+
{
89+
get => this.IsSystem;
90+
set => this.IsSystem = value;
91+
}
8392

8493
/// <summary>
8594
/// Validator's public key
@@ -102,11 +111,11 @@ public override Proposer Read(
102111
if (pkhex == "00")
103112
return new Proposer()
104113
{
105-
isSystem = true,
114+
IsSystem = true,
106115
};
107116
return new Proposer()
108117
{
109-
isSystem = false,
118+
IsSystem = false,
110119
PublicKey = PublicKey.FromHexString(pkhex),
111120
};
112121
}
@@ -121,7 +130,7 @@ public override void Write(
121130
Proposer proposer,
122131
JsonSerializerOptions options)
123132
{
124-
writer.WriteStringValue(proposer.isSystem ? "00" : proposer.PublicKey.ToAccountHex());
133+
writer.WriteStringValue(proposer.IsSystem ? "00" : proposer.PublicKey.ToAccountHex());
125134
}
126135
}
127136
}

0 commit comments

Comments
 (0)