Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
destream-blockchain
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
destream-blockchain
Commits
12cc234a
Commit
12cc234a
authored
Nov 07, 2018
by
Sergei Zubov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SyncFromDate to API
parent
e6c10051
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
WalletController.cs
...s.Bitcoin.Features.Wallet/Controllers/WalletController.cs
+19
-0
RequestModels.cs
...s/Stratis.Bitcoin.Features.Wallet/Models/RequestModels.cs
+9
-0
No files found.
Sources/Stratis.Bitcoin.Features.Wallet/Controllers/WalletController.cs
View file @
12cc234a
...
@@ -1027,6 +1027,25 @@ namespace Stratis.Bitcoin.Features.Wallet.Controllers
...
@@ -1027,6 +1027,25 @@ namespace Stratis.Bitcoin.Features.Wallet.Controllers
return
this
.
Ok
();
return
this
.
Ok
();
}
}
/// <summary>
/// Request the node to sync back from a given date.
/// </summary>
/// <param name="request">The model containing the date from which to start syncing.</param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"syncfromdate"
)]
public
IActionResult
SyncFromDate
([
FromBody
]
WalletSyncFromDateRequest
request
)
{
if
(!
this
.
ModelState
.
IsValid
)
{
return
ErrorHelpers
.
BuildErrorResponse
(
HttpStatusCode
.
BadRequest
,
"Invalid date format"
,
string
.
Empty
);
}
this
.
walletSyncManager
.
SyncFromDate
(
request
.
Date
);
return
this
.
Ok
();
}
/// <summary>
/// <summary>
/// Builds an <see cref="IActionResult"/> containing errors contained in the <see cref="ControllerBase.ModelState"/>.
/// Builds an <see cref="IActionResult"/> containing errors contained in the <see cref="ControllerBase.ModelState"/>.
/// </summary>
/// </summary>
...
...
Sources/Stratis.Bitcoin.Features.Wallet/Models/RequestModels.cs
View file @
12cc234a
...
@@ -260,4 +260,13 @@ namespace Stratis.Bitcoin.Features.Wallet.Models
...
@@ -260,4 +260,13 @@ namespace Stratis.Bitcoin.Features.Wallet.Models
[
Required
]
[
Required
]
public
string
Password
{
get
;
set
;
}
public
string
Password
{
get
;
set
;
}
}
}
/// <summary>
/// Object used to synchronize a wallet
/// </summary>
public
class
WalletSyncFromDateRequest
:
RequestModel
{
[
JsonConverter
(
typeof
(
IsoDateTimeConverter
))]
public
DateTime
Date
{
get
;
set
;
}
}
}
}
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