Skip to content

Commit

Permalink
Replace getvalidators by getnextblockvalidators (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommo-L committed Oct 12, 2020
1 parent fed3f7a commit 81e07af
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/RpcClient/RpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ public uint GetTransactionHeight(string txHash)
}

/// <summary>
/// Returns the current NEO consensus nodes information and voting status.
/// Returns the next NEO consensus nodes information and voting status.
/// </summary>
public RpcValidator[] GetValidators()
public RpcValidator[] GetNextBlockValidators()
{
return ((JArray)RpcSend("getvalidators")).Select(p => RpcValidator.FromJson(p)).ToArray();
return ((JArray)RpcSend("getnextblockvalidators")).Select(p => RpcValidator.FromJson(p)).ToArray();
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions tests/Neo.Network.RPC.Tests/RpcTestCases.json
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@
}
},
{
"Name": "getvalidators",
"Name": "getnextblockvalidators",
"Request": {
"jsonrpc": "2.0",
"method": "getvalidators",
"method": "getnextblockvalidators",
"params": [],
"id": 1
},
Expand Down
6 changes: 3 additions & 3 deletions tests/Neo.Network.RPC.Tests/UT_RpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ public void TestGetTransactionHeight()
}

[TestMethod]
public void TestGetValidators()
public void TestGetNextBlockValidators()
{
var test = TestUtils.RpcTestCases.Find(p => p.Name == nameof(rpc.GetValidators).ToLower());
var result = rpc.GetValidators();
var test = TestUtils.RpcTestCases.Find(p => p.Name == nameof(rpc.GetNextBlockValidators).ToLower());
var result = rpc.GetNextBlockValidators();
Assert.AreEqual(test.Response.Result.ToString(), ((JArray)result.Select(p => p.ToJson()).ToArray()).ToString());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Neo.Network.RPC.Tests/UT_RpcModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void TestRpcValidateAddressResult()
[TestMethod()]
public void TestRpcValidator()
{
JObject json = TestUtils.RpcTestCases.Find(p => p.Name == nameof(RpcClient.GetValidators).ToLower()).Response.Result;
JObject json = TestUtils.RpcTestCases.Find(p => p.Name == nameof(RpcClient.GetNextBlockValidators).ToLower()).Response.Result;
var item = ((JArray)json).Select(p => RpcValidator.FromJson(p));
Assert.AreEqual(json.ToString(), ((JArray)item.Select(p => p.ToJson()).ToArray()).ToString());
}
Expand Down

0 comments on commit 81e07af

Please sign in to comment.