Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
5d823d76
Commit
5d823d76
authored
May 30, 2017
by
Jeremy Bokobza
Committed by
GitHub
May 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Refit in favor of Flurl (#84)
* Removed Refit in favor of Flurl * Removed Refit ns
parent
96891758
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
18 deletions
+39
-18
Breeze.TumbleBit.Client.csproj
...rc/Breeze.TumbleBit.Client/Breeze.TumbleBit.Client.csproj
+1
-1
ITumblerService.cs
Breeze/src/Breeze.TumbleBit.Client/ITumblerService.cs
+0
-2
TumblerManager.cs
Breeze/src/Breeze.TumbleBit.Client/TumblerManager.cs
+1
-15
TumblerService.cs
Breeze/src/Breeze.TumbleBit.Client/TumblerService.cs
+37
-0
No files found.
Breeze/src/Breeze.TumbleBit.Client/Breeze.TumbleBit.Client.csproj
View file @
5d823d76
...
...
@@ -17,9 +17,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Flurl.Http" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="1.0.3" />
<PackageReference Include="refit" Version="3.0.1" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="1.0.1" />
<PackageReference Include="Stratis.Bitcoin" Version="1.0.1.8-alpha" />
</ItemGroup>
...
...
Breeze/src/Breeze.TumbleBit.Client/ITumblerService.cs
View file @
5d823d76
...
...
@@ -4,7 +4,6 @@ using System.Text;
using
System.Threading.Tasks
;
using
NTumbleBit
;
using
NTumbleBit.ClassicTumbler
;
using
Refit
;
namespace
Breeze.TumbleBit.Client
{
...
...
@@ -17,7 +16,6 @@ namespace Breeze.TumbleBit.Client
/// Gets the tumbler's parameters.
/// </summary>
/// <returns></returns>
[
Get
(
"/api/v1/tumblers/0/parameters"
)]
Task
<
ClassicTumblerParameters
>
GetClassicTumblerParametersAsync
();
}
}
Breeze/src/Breeze.TumbleBit.Client/TumblerManager.cs
View file @
5d823d76
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
using
Newtonsoft.Json
;
using
NTumbleBit.ClassicTumbler
;
using
Refit
;
using
NBitcoin.JsonConverters
;
using
NTumbleBit.JsonConverters
;
namespace
Breeze.TumbleBit.Client
{
...
...
@@ -29,15 +23,7 @@ namespace Breeze.TumbleBit.Client
/// <param name="serverAddress">The server address.</param>
public
void
InitializeTumblerService
(
Uri
serverAddress
)
{
this
.
tumblerService
=
RestService
.
For
<
ITumblerService
>(
serverAddress
.
ToString
(),
new
RefitSettings
{
JsonSerializerSettings
=
new
JsonSerializerSettings
{
Converters
=
new
List
<
JsonConverter
>
{
new
NetworkJsonConverter
(),
new
RsaKeyJsonConverter
(),
new
UInt256JsonConverter
()
}
}
});
this
.
tumblerService
=
new
TumblerService
(
serverAddress
);
}
/// <inheritdoc />
...
...
Breeze/src/Breeze.TumbleBit.Client/TumblerService.cs
0 → 100644
View file @
5d823d76
using
System
;
using
System.Collections.Generic
;
using
System.Threading.Tasks
;
using
Flurl
;
using
Flurl.Http
;
using
Flurl.Http.Configuration
;
using
NBitcoin.JsonConverters
;
using
Newtonsoft.Json
;
using
NTumbleBit.ClassicTumbler
;
using
NTumbleBit.JsonConverters
;
namespace
Breeze.TumbleBit.Client
{
public
class
TumblerService
:
ITumblerService
{
private
readonly
string
serverAddress
;
public
TumblerService
(
Uri
serverAddress
)
{
this
.
serverAddress
=
serverAddress
.
ToString
();
FlurlHttp
.
Configure
(
c
=>
{
c
.
JsonSerializer
=
new
NewtonsoftJsonSerializer
(
new
JsonSerializerSettings
{
Converters
=
new
List
<
JsonConverter
>
{
new
NetworkJsonConverter
(),
new
RsaKeyJsonConverter
(),
new
UInt256JsonConverter
()
}
});
});
}
/// <inheritdoc />
public
async
Task
<
ClassicTumblerParameters
>
GetClassicTumblerParametersAsync
()
{
ClassicTumblerParameters
result
=
await
this
.
serverAddress
.
AppendPathSegment
(
"/api/v1/tumblers/0/parameters"
).
GetJsonAsync
<
ClassicTumblerParameters
>();
return
result
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment