Failed to "LoadAllOperationsForLedger" with `Invalid operation 'type_i'='22'`
See original GitHub issueDescribe the bug
Latest SDK (stellar-dotnet-sdk version 7.2.0) not able to decode LoadAllOperationsForLedger
To Reproduce Run code:
using System;
using System.Linq;
using System.Threading.Tasks;
using stellar_dotnet_sdk;
using Xunit;
using stellar_dotnet_sdk.xdr;
namespace Tests
{
public class DecodeFail
{
[Fact]
public async Task FailsToLoadAllOperationsForLedger()
{
var server = new Server("https://horizon-testnet.stellar.org/");
var page = await server.Operations.ForLedger(351182).IncludeFailed(true)
.Limit(100)
.Execute();
}
}
}
And receive error:
Tests.BlockReaderTests.FailsToLoadAllOperationsForLedger
Newtonsoft.Json.JsonSerializationException: Invalid operation 'type_i'='22'
Newtonsoft.Json.JsonSerializationException
Invalid operation 'type_i'='22'
at stellar_dotnet_sdk.responses.OperationDeserializer.CreateResponse(Int32 type)
at stellar_dotnet_sdk.responses.OperationDeserializer.ReadJson(JsonReader reader, Type objectType, OperationResponse existingValue, Boolean hasExistingValue, JsonSerializer serializer)
at Newtonsoft.Json.JsonConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonConverter[] converters)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters)
at stellar_dotnet_sdk.responses.JsonSingleton.GetInstance[T](String content)
at stellar_dotnet_sdk.requests.ResponseHandler`1.HandleResponse(HttpResponseMessage response)
at stellar_dotnet_sdk.requests.RequestBuilder`1.Execute[TZ](Uri uri)
at stellar_dotnet_sdk.requests.RequestBuilderExecutePageable`2.Execute()
at Tests.BlockReaderTests.FailsToLoadAllOperationsForLedger() in D:\Projects\Swisschain\Sirius.Integrations.Stellar\tests\Tests\BlockReaderTests.cs:line 51
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_1.<<InvokeTestMethodAsync>b__1>d.MoveNext() in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\Runners\TestInvoker.cs:line 264
--- End of stack trace from previous location ---
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\ExecutionTimer.cs:line 48
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in C:\Dev\xunit\xunit\src\xunit.core\Sdk\ExceptionAggregator.cs:line 90
Expected behavior No error occured
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the error, fixing!
Tests included, i also made some updates to the Reserve class and other refactor/bugfixing, thanks!