From edf8226a1c170e269389f6c836a0585e4272ef75 Mon Sep 17 00:00:00 2001 From: Erik Zhang Date: Fri, 2 Sep 2022 08:28:06 +0800 Subject: [PATCH] Fix RpcClient --- src/RpcClient/RpcClient.cs | 2 +- tests/Neo.Network.RPC.Tests/UT_RpcClient.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RpcClient/RpcClient.cs b/src/RpcClient/RpcClient.cs index b21a17a36..b8a6f31ac 100644 --- a/src/RpcClient/RpcClient.cs +++ b/src/RpcClient/RpcClient.cs @@ -206,7 +206,7 @@ public async Task GetBlockCountAsync() /// /// Returns the hash value of the corresponding block, based on the specified index. /// - public async Task GetBlockHashAsync(int index) + public async Task GetBlockHashAsync(uint index) { var result = await RpcSendAsync(GetRpcName(), index).ConfigureAwait(false); return result.AsString(); diff --git a/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs b/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs index 7e4e9d0e1..f4de96f66 100644 --- a/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs +++ b/tests/Neo.Network.RPC.Tests/UT_RpcClient.cs @@ -137,7 +137,7 @@ public async Task TestGetBlockCount() public async Task TestGetBlockHash() { var test = TestUtils.RpcTestCases.Find(p => p.Name == nameof(rpc.GetBlockHashAsync).ToLower()); - var result = await rpc.GetBlockHashAsync((int)test.Request.Params[0].AsNumber()); + var result = await rpc.GetBlockHashAsync((uint)test.Request.Params[0].AsNumber()); Assert.AreEqual(test.Response.Result.AsString(), result.ToString()); }