Skip to content

Commit

Permalink
fixed isSystem typo.
Browse files Browse the repository at this point in the history
Signed-off-by: David Hernando <david.hernando@make.services>
  • Loading branch information
davidatwhiletrue committed Feb 9, 2024
1 parent 661286a commit f9f1e3a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Casper.Network.SDK.Test/NctlGetXTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 165 in Casper.Network.SDK.Test/NctlGetXTest.cs

View workflow job for this annotation

GitHub Actions / buildntest

'Proposer.isSystem' is obsolete: 'Replaced with IsSystem'

var response3 = await _client.GetBlock(result2.Block.Hash);
var result3 = response3.Parse();
Assert.AreEqual(result2.Block.Hash, result3.Block.Hash);
Expand Down Expand Up @@ -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);

Check warning on line 220 in Casper.Network.SDK.Test/NctlGetXTest.cs

View workflow job for this annotation

GitHub Actions / buildntest

'Proposer.isSystem' is obsolete: 'Replaced with IsSystem'
}
catch (RpcClientException e)
{
Expand Down
17 changes: 13 additions & 4 deletions Casper.Network.SDK/Types/Block.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text.Json;
using System.Text.Json.Serialization;

Expand Down Expand Up @@ -79,7 +80,15 @@ public class Proposer
/// <summary>
/// The block was proposed by the system, not a validator
/// </summary>
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;
}

/// <summary>
/// Validator's public key
Expand All @@ -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),
};
}
Expand All @@ -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());
}
}
}
Expand Down

0 comments on commit f9f1e3a

Please sign in to comment.