Skip to content

Commit

Permalink
RestSharpを削除
Browse files Browse the repository at this point in the history
nodeの最後に"/"があると送金できない不具合を修正
  • Loading branch information
villhell committed Feb 6, 2023
1 parent 24f1742 commit f93e1a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Binary file added Excel/20230206_SYMBOLタウンリスト.xlsx
Binary file not shown.
3 changes: 1 addition & 2 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using DocumentFormat.OpenXml.Spreadsheet;
using Newtonsoft.Json.Linq;
using Org.BouncyCastle.Utilities;
using RestSharp;
using System.Collections.Generic;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
Expand Down Expand Up @@ -528,7 +527,7 @@ private async Task AnnounceAsync(Network network, SymbolFacade facade, KeyPair k

var payload = TransactionsFactory.CreatePayload(aggTx);

string node = txtNodeUrl.Text;
string node = Utils.TrimingLastSlash(txtNodeUrl.Text);
using var client = new HttpClient();
var content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = client.PutAsync(node + "/transactions", content).Result;
Expand Down
10 changes: 10 additions & 0 deletions Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,15 @@ internal static string StringToNamespaceId(string ns)

return namespaceId;
}

/// <summary>
/// 末尾のスラッシュを削除する
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
internal static string TrimingLastSlash(string s)
{
return s.Trim('/');
}
}
}
1 change: 0 additions & 1 deletion nagexym.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<ItemGroup>
<PackageReference Include="ClosedXML" Version="0.100.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="RestSharp" Version="108.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit f93e1a6

Please sign in to comment.