Chainers / Ditch

Create and broadcast transactions to Graphene-based blockchains
MIT License
33 stars 26 forks source link

System.InvalidCastException: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray' #17

Closed andidrea closed 6 years ago

andidrea commented 6 years ago

Hi,

I'm unable to run the following code:

var findAccountsArgs = new FindAccountsArgs()
{
    Accounts = new[] { "my_login" }
};
_operationManager.FindAccounts(findAccountsArgs, CancellationToken.None);

It gives the error:

System.InvalidCastException: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'

The error happens in the method:

\Sources\Ditch.Steem\Models\Other\LegacyAsset.cs

public void ReadJson(JsonReader reader, JsonSerializer serializer)
{
->    var arr = serializer.Deserialize<JArray>(reader);
Amount = arr[0].Value<long>();
Symbol = new AssetSymbolType(arr[2].Value<string>(), arr[1].Value<byte>());
}

I'm trying to get a single (existing) account as seen here: https://github.com/Chainers/Ditch/releases

Versions:

I'm not sure if I made a mistake or not.

Thank you

KorzunAV commented 6 years ago

Hi! Steemdev team is deploy a new node release on their servers. It has a new format for asset, which leads to the client's downfall :( Until the release becomes stable, there is no sense to updating the current client code. Now, only the condenser_api is stable on the node.

andidrea commented 6 years ago

Thank you very much! :)

I highly appreciate your work and help.

I'm looking forward to the newest release.

KorzunAV commented 6 years ago

v4.0.0 adds BroadcastOperationsSynchronousLikeSteemit function to solve issues with steemit + assets accept several formats now