Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
734b1572
Unverified
Commit
734b1572
authored
Jan 13, 2021
by
Oleh Nikolaiev
Committed by
GitHub
Jan 13, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #261 from skalenetwork/bug/add-more-info
add more info to db requests
parents
da6901ab
8387a388
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
SGXWalletServer.cpp
SGXWalletServer.cpp
+5
-3
No files found.
SGXWalletServer.cpp
View file @
734b1572
...
...
@@ -1061,7 +1061,8 @@ shared_ptr <string> SGXWalletServer::readFromDb(const string &name, const string
auto
dataStr
=
checkDataFromDb
(
prefix
+
name
);
if
(
dataStr
==
nullptr
)
{
throw
SGXException
(
KEY_SHARE_DOES_NOT_EXIST
,
string
(
__FUNCTION__
)
+
":Data with this name does not exist"
);
throw
SGXException
(
KEY_SHARE_DOES_NOT_EXIST
,
string
(
__FUNCTION__
)
+
":Data with this name does not exist: "
+
prefix
+
name
);
}
return
dataStr
;
...
...
@@ -1075,7 +1076,8 @@ shared_ptr <string> SGXWalletServer::checkDataFromDb(const string &name, const s
void
SGXWalletServer
::
writeKeyShare
(
const
string
&
_keyShareName
,
const
string
&
_value
)
{
if
(
LevelDB
::
getLevelDb
()
->
readString
(
_keyShareName
)
!=
nullptr
)
{
throw
SGXException
(
KEY_SHARE_ALREADY_EXISTS
,
string
(
__FUNCTION__
)
+
":Key share with this name already exists"
);
throw
SGXException
(
KEY_SHARE_ALREADY_EXISTS
,
string
(
__FUNCTION__
)
+
":Key share with this name already exists"
+
_keyShareName
);
}
LevelDB
::
getLevelDb
()
->
writeString
(
_keyShareName
,
_value
);
...
...
@@ -1084,7 +1086,7 @@ void SGXWalletServer::writeKeyShare(const string &_keyShareName, const string &_
void
SGXWalletServer
::
writeDataToDB
(
const
string
&
name
,
const
string
&
value
)
{
if
(
LevelDB
::
getLevelDb
()
->
readString
(
name
)
!=
nullptr
)
{
throw
SGXException
(
KEY_NAME_ALREADY_EXISTS
,
string
(
__FUNCTION__
)
+
":Name already exists"
);
throw
SGXException
(
KEY_NAME_ALREADY_EXISTS
,
string
(
__FUNCTION__
)
+
":Name already exists"
+
name
);
}
LevelDB
::
getLevelDb
()
->
writeString
(
name
,
value
);
}
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