Skip to content

Commit

Permalink
EthSyncing convert response
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfranblanco committed Jul 25, 2023
1 parent d9f7404 commit b1a51c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Nethereum.RPC/Eth/EthSyncing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ public EthSyncing(IClient client) : base(client, ApiMethods.eth_syncing.ToString
public new async Task<SyncingOutput> SendRequestAsync(object id = null)
{
var response = await base.SendRequestAsync(id).ConfigureAwait(false);
return ConvertResponseToSyncingOutput(response);
}

if (response is bool && (bool) response == false) return new SyncingOutput {IsSyncing = (bool) response};
public static SyncingOutput ConvertResponseToSyncingOutput(object response)
{
if (response is bool && (bool)response == false) return new SyncingOutput { IsSyncing = (bool)response };

var syncingResponse = (JObject) response;
var syncingResponse = (JObject)response;

return new SyncingOutput
{
Expand Down

0 comments on commit b1a51c6

Please sign in to comment.