From 84786f974a9f8dbccd4dd1b44b78823d7390082d Mon Sep 17 00:00:00 2001 From: cuongph87 <152460338+cuongph87@users.noreply.github.com> Date: Tue, 12 Nov 2024 23:05:32 +0700 Subject: [PATCH] Backward-compatibility changes for Protocol 22 --- StellarDotnetSdk.Tests/ServerTest.cs | 25 +++++++- StellarDotnetSdk.Tests/SorobanServerTest.cs | 57 +++++++++++++++---- StellarDotnetSdk.Tests/Utils.cs | 20 +++++-- .../Responses/SorobanRpc/GetEventsResponse.cs | 12 +++- .../SorobanRpc/GetTransactionResponse.cs | 2 +- .../SorobanRpc/GetVersionInfoResponse.cs | 8 ++- .../Responses/SorobanRpc/TransactionInfo.cs | 7 ++- .../SubmitTransactionAsyncResponse.cs | 3 +- 8 files changed, 109 insertions(+), 25 deletions(-) diff --git a/StellarDotnetSdk.Tests/ServerTest.cs b/StellarDotnetSdk.Tests/ServerTest.cs index 10115533..46c6ae37 100644 --- a/StellarDotnetSdk.Tests/ServerTest.cs +++ b/StellarDotnetSdk.Tests/ServerTest.cs @@ -429,13 +429,34 @@ public async Task TestSubmitTransactionAsyncTryAgainLater() } [TestMethod] - public async Task TestSubmitTransactionAsyncError() + public async Task TestSubmitTransactionAsyncErrorPriorToProtocol22() { const string json = """ { "tx_status": "ERROR", "hash": "9f8e7d6c5b4a3210fedcba9876543210abcdef0123456789abcdef0123456789", + "errorResultXdr": "AAAAAAAAAGT////7AAAAAA==" + } + """; + using var server = Utils.CreateTestServerWithContent(json); + var response = await server.SubmitTransactionAsync( + BuildTransaction(), new SubmitTransactionOptions { SkipMemoRequiredCheck = true }); + Assert.IsNotNull(response); + Assert.AreEqual(SubmitTransactionAsyncResponse.TransactionStatus.ERROR, response.TxStatus); + Assert.AreEqual(response.Hash, "9f8e7d6c5b4a3210fedcba9876543210abcdef0123456789abcdef0123456789"); + Assert.IsNotNull(response.ErrorResult); + } + + [TestMethod] + public async Task TestSubmitTransactionAsyncErrorProtocol22() + { + const string json = + """ + { + "tx_status": "ERROR", + "hash": "9f8e7d6c5b4a3210fedcba9876543210abcdef0123456789abcdef0123456789", + "errorResultXdr": "AAAAAAAAAGT////7AAAAAA==", "error_result_xdr": "AAAAAAAAAGT////7AAAAAA==" } """; @@ -447,7 +468,7 @@ public async Task TestSubmitTransactionAsyncError() Assert.AreEqual(response.Hash, "9f8e7d6c5b4a3210fedcba9876543210abcdef0123456789abcdef0123456789"); Assert.IsNotNull(response.ErrorResult); } - + [TestMethod] public async Task TestSubmitTransactionAsyncObjectNoSkipMemoRequiredCheck() { diff --git a/StellarDotnetSdk.Tests/SorobanServerTest.cs b/StellarDotnetSdk.Tests/SorobanServerTest.cs index a4736ebc..18eb59be 100644 --- a/StellarDotnetSdk.Tests/SorobanServerTest.cs +++ b/StellarDotnetSdk.Tests/SorobanServerTest.cs @@ -285,6 +285,7 @@ public async Task TestGetEvents() "ledgerClosedAt": "2024-08-06T10:09:22Z", "contractId": "CASCLAHV7E7H3BOGQIW5HIC3H6WVDOTOQRTRMXYSTKJHXOORP3DNATY2", "id": "0003920046715838464-0000000001", + "pagingToken": "0003920046715838464-0000000001", "topic": [ "AAAADwAAAAhTVFJfQ0VSVA\u003d\u003d", "AAAADwAAAAhzdHJfY2VydA\u003d\u003d" @@ -299,6 +300,7 @@ public async Task TestGetEvents() "ledgerClosedAt": "2024-08-06T10:10:47Z", "contractId": "CDTJALOV4KLSPEMNFHKYSG4WOTN7FCN4A2JOKRPVCQYEHLUEH2YUJF5R", "id": "0003920115435319296-0000000001", + "pagingToken": "0003920115435319296-0000000001", "topic": [ "AAAADwAAAARtaW50", "AAAAEgAAAAAAAAAAdWnjmUMJ9zn2dIq1d6OhQ7XzqNT2ppF+9OgDmID0yhQ\u003d", @@ -314,6 +316,7 @@ public async Task TestGetEvents() "ledgerClosedAt": "2024-08-06T10:10:58Z", "contractId": "CDYTK2FLRHT3KJ6RVAAABI4A7Y2XERCWN3FT5II7FHONDKPQVEAZ33YI", "id": "0003920124025257984-0000000001", + "pagingToken": "0003920124025257984-0000000001", "topic": [ "AAAADwAAAARtaW50", "AAAAEgAAAAAAAAAAdWnjmUMJ9zn2dIq1d6OhQ7XzqNT2ppF+9OgDmID0yhQ\u003d", @@ -329,6 +332,7 @@ public async Task TestGetEvents() "ledgerClosedAt": "2024-08-06T10:38:23Z", "contractId": "CDV6IIE2DFFGB3GKAG7YYSKBO4PFDAZ76GRHXKSOBBIG64NNHMMRCRXH", "id": "0003921464055050240-0000000001", + "pagingToken": "0003921464055050240-0000000001", "topic": [ "AAAADwAAAAdhcHByb3ZlAA\u003d\u003d", "AAAAEgAAAAAAAAAAWoM+w+i/0MLTSydKU896zcL4/EhYLVMHlSxIzY+ucJs\u003d", @@ -361,6 +365,7 @@ public async Task TestGetEvents() Assert.AreEqual("2024-08-06T10:09:22Z", event1.LedgerClosedAt); Assert.AreEqual("CASCLAHV7E7H3BOGQIW5HIC3H6WVDOTOQRTRMXYSTKJHXOORP3DNATY2", event1.ContractId); Assert.AreEqual("0003920046715838464-0000000001", event1.Id); + Assert.AreEqual("0003920046715838464-0000000001", event1.PagingToken); Assert.AreEqual(2, event1.Topics.Length); Assert.AreEqual("AAAADwAAAAhTVFJfQ0VSVA==", event1.Topics[0]); Assert.AreEqual("AAAADwAAAAhzdHJfY2VydA==", event1.Topics[1]); @@ -377,6 +382,7 @@ public async Task TestGetEvents() Assert.AreEqual("2024-08-06T10:10:47Z", event2.LedgerClosedAt); Assert.AreEqual("CDTJALOV4KLSPEMNFHKYSG4WOTN7FCN4A2JOKRPVCQYEHLUEH2YUJF5R", event2.ContractId); Assert.AreEqual("0003920115435319296-0000000001", event2.Id); + Assert.AreEqual("0003920115435319296-0000000001", event2.PagingToken); Assert.AreEqual(3, event2.Topics.Length); Assert.AreEqual("AAAADwAAAARtaW50", event2.Topics[0]); Assert.AreEqual("AAAAEgAAAAAAAAAAdWnjmUMJ9zn2dIq1d6OhQ7XzqNT2ppF+9OgDmID0yhQ=", event2.Topics[1]); @@ -392,6 +398,7 @@ public async Task TestGetEvents() Assert.AreEqual("2024-08-06T10:10:58Z", event3.LedgerClosedAt); Assert.AreEqual("CDYTK2FLRHT3KJ6RVAAABI4A7Y2XERCWN3FT5II7FHONDKPQVEAZ33YI", event3.ContractId); Assert.AreEqual("0003920124025257984-0000000001", event3.Id); + Assert.AreEqual("0003920124025257984-0000000001", event3.PagingToken); Assert.AreEqual(3, event3.Topics.Length); Assert.AreEqual("AAAADwAAAARtaW50", event3.Topics[0]); Assert.AreEqual("AAAAEgAAAAAAAAAAdWnjmUMJ9zn2dIq1d6OhQ7XzqNT2ppF+9OgDmID0yhQ=", event3.Topics[1]); @@ -407,6 +414,7 @@ public async Task TestGetEvents() Assert.AreEqual("2024-08-06T10:38:23Z", event4.LedgerClosedAt); Assert.AreEqual("CDV6IIE2DFFGB3GKAG7YYSKBO4PFDAZ76GRHXKSOBBIG64NNHMMRCRXH", event4.ContractId); Assert.AreEqual("0003921464055050240-0000000001", event4.Id); + Assert.AreEqual("0003921464055050240-0000000001", event4.PagingToken); Assert.AreEqual(3, event4.Topics.Length); Assert.AreEqual("AAAADwAAAAdhcHByb3ZlAA==", event4.Topics[0]); Assert.AreEqual("AAAAEgAAAAAAAAAAWoM+w+i/0MLTSydKU896zcL4/EhYLVMHlSxIzY+ucJs=", event4.Topics[1]); @@ -1132,7 +1140,7 @@ public async Task TestGetFeeStats() } [TestMethod] - public async Task TestGetVersionInfo() + public async Task TestGetVersionInfoProtocol22() { const string json = """ @@ -1144,7 +1152,7 @@ public async Task TestGetVersionInfo() "commitHash": "fcd2f0523f04279bae4502f3e3fa00ca627e6f6a", "buildTimestamp": "2024-05-10T11:18:38", "captiveCoreVersion": "stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)", - "protocolVersion": 21 + "protocolVersion": 22 } } """; @@ -1157,9 +1165,38 @@ public async Task TestGetVersionInfo() Assert.AreEqual("2024-05-10T11:18:38", response.BuildTimeStamp); Assert.AreEqual("stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)", response.CaptiveCoreVersion); - Assert.AreEqual(21, response.ProtocolVersion); + Assert.AreEqual(22, response.ProtocolVersion); } + [TestMethod] + public async Task TestGetVersionInfoPriorToProtocol22() + { + const string json = + """ + { + "jsonrpc": "2.0", + "id": 8675309, + "result": { + "version": "21.1.0", + "commit_hash": "fcd2f0523f04279bae4502f3e3fa00ca627e6f6a", + "build_timestamp": "2024-05-10T11:18:38", + "captive_core_version": "stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)", + "protocol_version": 21 + } + } + """; + using var sorobanServer = Utils.CreateTestSorobanServerWithContent(json); + var response = await sorobanServer.GetVersionInfo(); + + Assert.IsNotNull(response); + Assert.AreEqual("21.1.0", response.Version); + Assert.AreEqual("fcd2f0523f04279bae4502f3e3fa00ca627e6f6a", response.CommitHash); + Assert.AreEqual("2024-05-10T11:18:38", response.BuildTimeStamp); + Assert.AreEqual("stellar-core 21.0.0.rc2 (c6f474133738ae5f6d11b07963ca841909210273)", + response.CaptiveCoreVersion); + Assert.AreEqual(21, response.ProtocolVersion); + } + [TestMethod] public async Task TestGetTransactionSuccess() { @@ -1180,7 +1217,7 @@ public async Task TestGetTransactionSuccess() "resultXdr": "AAAAAAARFy8AAAAAAAAAAQAAAAAAAAAYAAAAAMu8SHUN67hTUJOz3q+IrH9M/4dCVXaljeK6x1Ss20YWAAAAAA==", "resultMetaXdr": "AAAAAwAAAAAAAAACAAAAAwAmwiAAAAAAAAAAAMYVjXj9HUoPRUa1NuLlinh3su4xbSJBssz8BSIYqPmjAAAAFUHZob0AJY3OAAAjqQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAACbCHwAAAABlVUH3AAAAAAAAAAEAJsIgAAAAAAAAAADGFY14/R1KD0VGtTbi5Yp4d7LuMW0iQbLM/AUiGKj5owAAABVB2aG9ACWNzgAAI6oAAAAAAAAAAAA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21ldHJpY3MAAAAPAAAAEG1heF9yd19kYXRhX2J5dGUAAAAFAAAAAAAAB+gAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAPAAAADGNvcmVfbWV0cmljcwAAAA8AAAAQbWF4X3J3X2NvZGVfYnl0ZQAAAAUAAAAAAACBgAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAABNtYXhfZW1pdF9ldmVudF9ieXRlAAAAAAUAAAAAAAAAAA==", "ledger": 2540064, - "createdAt": "1700086268" + "createdAt": 1700086268 } } """; @@ -1204,7 +1241,7 @@ public async Task TestGetTransactionSuccess() "AAAAAwAAAAAAAAACAAAAAwAmwiAAAAAAAAAAAMYVjXj9HUoPRUa1NuLlinh3su4xbSJBssz8BSIYqPmjAAAAFUHZob0AJY3OAAAjqQAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAACbCHwAAAABlVUH3AAAAAAAAAAEAJsIgAAAAAAAAAADGFY14/R1KD0VGtTbi5Yp4d7LuMW0iQbLM/AUiGKj5owAAABVB2aG9ACWNzgAAI6oAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAmwiAAAAAAZVVB/AAAAAAAAAABAAAAAgAAAAMAJsIfAAAABgAAAAAAAAABhhOwI+RL18Zpk7cqI5pRRf0L96jE8i+0x3ekhuBh2cUAAAAUAAAAAQAAABMAAAAAjjTy9Ve4tTeavLz3tN8+liOOxI3ufjZESizbjVF11h0AAAABAAAABQAAABAAAAABAAAAAQAAAA8AAAAJQ29yZVN0YXRlAAAAAAAAEQAAAAEAAAAGAAAADwAAAAVhZG1pbgAAAAAAABIAAAAAAAAAADn1LT+CCK/HiHMChoEi/AtPrkos4XRR2E45Pr25lb3/AAAADwAA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AAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAAAplbWl0X2V2ZW50AAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAPAAAADGNvcmVfbWV0cmljcwAAAA8AAAAPZW1pdF9ldmVudF9ieXRlAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAAAhjcHVfaW5zbgAAAAUAAAAAATLTQAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAAAhtZW1fYnl0ZQAAAAUAAAAAACqhewAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAABFpbnZva2VfdGltZV9uc2VjcwAAAAAAAAUAAAAAABFfSQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAAA9tYXhfcndfa2V5X2J5dGUAAAAABQAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAACAAAADwAAAAxjb3JlX21ldHJpY3MAAAAPAAAAEG1heF9yd19kYXRhX2J5dGUAAAAFAAAAAAAAB+gAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAPAAAADGNvcmVfbWV0cmljcwAAAA8AAAAQbWF4X3J3X2NvZGVfYnl0ZQAAAAUAAAAAAACBgAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAA8AAAAMY29yZV9tZXRyaWNzAAAADwAAABNtYXhfZW1pdF9ldmVudF9ieXRlAAAAAAUAAAAAAAAAAA==", response.ResultMetaXdr); Assert.AreEqual(2540064L, response.Ledger); - Assert.AreEqual("1700086268", response.CreatedAt); + Assert.AreEqual(1700086268, response.CreatedAt); } [TestMethod] @@ -1318,7 +1355,7 @@ public async Task TestGetTransactions() Assert.AreEqual(TransactionInfo.TransactionStatus.FAILED, tx1.Status); Assert.AreEqual("89ed109b74a65e28f6771b78ca70c6aa937792eea16506eb359cb58cc94e5db1", tx1.TxHash); Assert.AreEqual(1888539L, tx1.Ledger); - Assert.AreEqual("1717166042", tx1.CreatedAt); + Assert.AreEqual(1717166042, tx1.CreatedAt); Assert.AreEqual(1, tx1.ApplicationOrder); Assert.IsFalse(tx1.FeeBump); Assert.AreEqual( @@ -1333,7 +1370,7 @@ public async Task TestGetTransactions() Assert.AreEqual(TransactionInfo.TransactionStatus.SUCCESS, tx2.Status); Assert.AreEqual("89ed109b74a65e28f6771b78ca70c6aa937792eea16506eb359cb58cc94e5db2", tx2.TxHash); Assert.AreEqual(1888539L, tx2.Ledger); - Assert.AreEqual("1717166042", tx2.CreatedAt); + Assert.AreEqual(1717166042, tx2.CreatedAt); Assert.AreEqual(2, tx2.ApplicationOrder); Assert.IsFalse(tx2.FeeBump); Assert.AreEqual( @@ -1348,7 +1385,7 @@ public async Task TestGetTransactions() Assert.AreEqual(TransactionInfo.TransactionStatus.SUCCESS, tx3.Status); Assert.AreEqual("89ed109b74a65e28f6771b78ca70c6aa937792eea16506eb359cb58cc94e5db3", tx3.TxHash); Assert.AreEqual(1888539L, tx3.Ledger); - Assert.AreEqual("1717166042", tx3.CreatedAt); + Assert.AreEqual(1717166042, tx3.CreatedAt); Assert.AreEqual(3, tx3.ApplicationOrder); Assert.IsFalse(tx3.FeeBump); Assert.AreEqual( @@ -1363,7 +1400,7 @@ public async Task TestGetTransactions() Assert.AreEqual(TransactionInfo.TransactionStatus.SUCCESS, tx4.Status); Assert.AreEqual("89ed109b74a65e28f6771b78ca70c6aa937792eea16506eb359cb58cc94e5db4", tx4.TxHash); Assert.AreEqual(1888539L, tx4.Ledger); - Assert.AreEqual("1717166042", tx4.CreatedAt); + Assert.AreEqual(1717166042, tx4.CreatedAt); Assert.AreEqual(4, tx4.ApplicationOrder); Assert.IsFalse(tx4.FeeBump); Assert.AreEqual( @@ -1439,7 +1476,7 @@ public async Task TestGetTransactions() Assert.AreEqual(TransactionInfo.TransactionStatus.FAILED, tx5.Status); Assert.AreEqual("89ed109b74a65e28f6771b78ca70c6aa937792eea16506eb359cb58cc94e5db5", tx5.TxHash); Assert.AreEqual(1888540L, tx5.Ledger); - Assert.AreEqual("1717166047", tx5.CreatedAt); + Assert.AreEqual(1717166047, tx5.CreatedAt); Assert.AreEqual(1, tx5.ApplicationOrder); Assert.IsFalse(tx5.FeeBump); Assert.AreEqual( diff --git a/StellarDotnetSdk.Tests/Utils.cs b/StellarDotnetSdk.Tests/Utils.cs index 5161217b..363d7a78 100644 --- a/StellarDotnetSdk.Tests/Utils.cs +++ b/StellarDotnetSdk.Tests/Utils.cs @@ -115,7 +115,9 @@ public static async Task CheckAndCreateAccountOnTestnet(string accountId) } } - public static Server CreateTestServerWithContent(string? content, HttpStatusCode statusCode = HttpStatusCode.OK, + public static Server CreateTestServerWithContent( + string? content, + HttpStatusCode statusCode = HttpStatusCode.OK, string uri = "https://horizon-testnet.stellar.org") { Network.UseTestNetwork(); @@ -123,7 +125,8 @@ public static Server CreateTestServerWithContent(string? content, HttpStatusCode return new Server(uri, httpClient); } - public static SorobanServer CreateTestSorobanServerWithContent(string? content, + public static SorobanServer CreateTestSorobanServerWithContent( + string? content, HttpStatusCode statusCode = HttpStatusCode.OK, string uri = "https://soroban-testnet.stellar.org") { @@ -132,7 +135,8 @@ public static SorobanServer CreateTestSorobanServerWithContent(string? content, return new SorobanServer(uri, httpClient); } - public static Server CreateTestServerWithHeaders(Dictionary> headers, + public static Server CreateTestServerWithHeaders( + Dictionary> headers, HttpStatusCode statusCode = HttpStatusCode.OK, string uri = "https://horizon-testnet.stellar.org") { @@ -141,15 +145,19 @@ public static Server CreateTestServerWithHeaders(Dictionary CreateTestServerWithJson(string pathToJson, - HttpStatusCode statusCode = HttpStatusCode.OK, string uri = "https://horizon-testnet.stellar.org") + public static async Task CreateTestServerWithJson( + string pathToJson, + HttpStatusCode statusCode = HttpStatusCode.OK, + string uri = "https://horizon-testnet.stellar.org") { var jsonPath = GetTestDataPath(pathToJson); var content = await File.ReadAllTextAsync(jsonPath); return CreateTestServerWithContent(content, statusCode, uri); } - public static HttpClient CreateFakeHttpClient(string? content, HttpStatusCode statusCode = HttpStatusCode.OK, + public static HttpClient CreateFakeHttpClient( + string? content, + HttpStatusCode statusCode = HttpStatusCode.OK, IDictionary>? headers = null) { var mockFakeHttpMessageHandler = new Mock { CallBase = true }; diff --git a/StellarDotnetSdk/Responses/SorobanRpc/GetEventsResponse.cs b/StellarDotnetSdk/Responses/SorobanRpc/GetEventsResponse.cs index a5d5b65d..9ad2b594 100644 --- a/StellarDotnetSdk/Responses/SorobanRpc/GetEventsResponse.cs +++ b/StellarDotnetSdk/Responses/SorobanRpc/GetEventsResponse.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using System; +using Newtonsoft.Json; using StellarDotnetSdk.Soroban; namespace StellarDotnetSdk.Responses.SorobanRpc; @@ -35,6 +36,7 @@ public EventInfo( bool inSuccessfulContractCall, int ledger, string ledgerClosedAt, + string pagingToken, string[] topics, string type, string value, @@ -45,6 +47,7 @@ public EventInfo( InSuccessfulContractCall = inSuccessfulContractCall; Ledger = ledger; LedgerClosedAt = ledgerClosedAt; + PagingToken = pagingToken; Topics = topics; Type = type; Value = value; @@ -77,6 +80,13 @@ public EventInfo( /// public string LedgerClosedAt { get; } + /// + /// Duplicate of id field, but in the standard place for pagination tokens. + /// Use instead. + /// + [Obsolete("This property is deprecated, use GetEventsResponse.Cursor instead. In a future release of this SDK this field can be removed.")] + public string PagingToken { get; } + /// /// A list containing the topics, each is a base-64 encoded XDR string of an xdr.SCVal /// object, this event was emitted with. diff --git a/StellarDotnetSdk/Responses/SorobanRpc/GetTransactionResponse.cs b/StellarDotnetSdk/Responses/SorobanRpc/GetTransactionResponse.cs index 546942a0..6b53e00b 100644 --- a/StellarDotnetSdk/Responses/SorobanRpc/GetTransactionResponse.cs +++ b/StellarDotnetSdk/Responses/SorobanRpc/GetTransactionResponse.cs @@ -9,7 +9,7 @@ public GetTransactionResponse( long oldestLedger, long oldestLedgerCloseTime, long ledger, - string createdAt, + long createdAt, int applicationOrder, bool feeBump, string? envelopeXdr, diff --git a/StellarDotnetSdk/Responses/SorobanRpc/GetVersionInfoResponse.cs b/StellarDotnetSdk/Responses/SorobanRpc/GetVersionInfoResponse.cs index b3c2b228..d3a36f2a 100644 --- a/StellarDotnetSdk/Responses/SorobanRpc/GetVersionInfoResponse.cs +++ b/StellarDotnetSdk/Responses/SorobanRpc/GetVersionInfoResponse.cs @@ -1,4 +1,6 @@ -namespace StellarDotnetSdk.Responses.SorobanRpc; +using Newtonsoft.Json; + +namespace StellarDotnetSdk.Responses.SorobanRpc; /// /// Version information about the RPC and Captive core. RPC manages its own, pared-down version of Stellar Core @@ -23,21 +25,25 @@ public GetVersionInfoResponse( /// /// The build timestamp of the RPC server. /// + [JsonProperty(PropertyName = "build_timestamp")] public string BuildTimeStamp { get; } /// /// The version of the Captive Core. /// + [JsonProperty(PropertyName = "captive_core_version")] public string CaptiveCoreVersion { get; } /// /// The commit hash of the RPC server. /// + [JsonProperty(PropertyName = "commit_hash")] public string CommitHash { get; } /// /// The protocol version. /// + [JsonProperty(PropertyName = "protocol_version")] public int ProtocolVersion { get; } /// diff --git a/StellarDotnetSdk/Responses/SorobanRpc/TransactionInfo.cs b/StellarDotnetSdk/Responses/SorobanRpc/TransactionInfo.cs index 97147ed1..eeb32144 100644 --- a/StellarDotnetSdk/Responses/SorobanRpc/TransactionInfo.cs +++ b/StellarDotnetSdk/Responses/SorobanRpc/TransactionInfo.cs @@ -16,9 +16,10 @@ public enum TransactionStatus FAILED, } - public TransactionInfo(TransactionStatus status, + public TransactionInfo( + TransactionStatus status, long? ledger, - string? createdAt, + long? createdAt, int? applicationOrder, bool? feeBump, string? envelopeXdr, @@ -55,7 +56,7 @@ public TransactionInfo(TransactionStatus status, /// (optional) The unix timestamp of when the transaction was included in the ledger. This field is only present if /// status is SUCCESS or FAILED. /// - public string? CreatedAt { get; } + public long? CreatedAt { get; } /// /// (optional) The index of the transaction among all transactions included in the ledger. This field is only present diff --git a/StellarDotnetSdk/Responses/SubmitTransactionAsyncResponse.cs b/StellarDotnetSdk/Responses/SubmitTransactionAsyncResponse.cs index 42bdcb72..12963cac 100644 --- a/StellarDotnetSdk/Responses/SubmitTransactionAsyncResponse.cs +++ b/StellarDotnetSdk/Responses/SubmitTransactionAsyncResponse.cs @@ -13,7 +13,8 @@ public enum TransactionStatus ERROR, } - [JsonProperty(PropertyName = "error_result_xdr")] + // TODO: Change to "error_result_xdr" when Horizon is updated to v22.0.0 + [JsonProperty(PropertyName = "errorResultXdr")] private string? _errorResultXdr; [JsonProperty(PropertyName = "hash")] public string? Hash { get; init; }