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
d31fc933
Unverified
Commit
d31fc933
authored
Dec 11, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3023 fix getLatestCreatedKey command
parent
4f606e2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
LevelDB.cpp
LevelDB.cpp
+3
-3
LevelDB.h
LevelDB.h
+0
-4
sgx_util.cpp
sgx_util.cpp
+3
-3
No files found.
LevelDB.cpp
View file @
d31fc933
...
...
@@ -192,7 +192,7 @@ stringstream LevelDB::getAllKeys() {
// old style keys
value
=
" VALUE: "
+
it
->
value
().
ToString
();
}
result
<<
"KEY: "
<<
key
<<
','
<<
value
<<
'\n'
;
result
<<
"KEY: "
<<
key
<<
','
<<
value
<<
std
::
endl
;
}
result
<<
"TOTAL NUMBER OF KEYS: "
<<
counter
<<
'\n'
;
...
...
@@ -211,8 +211,8 @@ pair<string, uint64_t> LevelDB::getLatestCreatedKey() {
Json
::
Reader
reader
;
reader
.
parse
(
it
->
value
().
ToString
().
c_str
(),
key_data
);
if
(
key_data
[
"timestamp"
].
asUInt64
(
)
>
latest_timestamp
)
{
latest_timestamp
=
key_data
[
"timestamp"
].
asUInt64
(
);
if
(
std
::
stoi
(
key_data
[
"timestamp"
].
asString
()
)
>
latest_timestamp
)
{
latest_timestamp
=
std
::
stoi
(
key_data
[
"timestamp"
].
asString
()
);
latest_created_key_name
=
it
->
key
().
ToString
();
}
}
else
{
...
...
LevelDB.h
View file @
d31fc933
...
...
@@ -89,12 +89,8 @@ public:
void
throwExceptionOnError
(
leveldb
::
Status
result
);
LevelDB
(
string
&
filename
);
class
KeyVisitor
{
public
:
virtual
void
visitDBKey
(
const
char
*
_data
)
=
0
;
...
...
sgx_util.cpp
View file @
d31fc933
...
...
@@ -58,7 +58,7 @@ void getLatestCreatedKey() {
std
::
cout
<<
"Info client inited"
<<
std
::
endl
;
Json
::
Value
lastCreatedKey
=
c
.
getLatestCreatedKey
();
std
::
cout
<<
"Last created key name: "
<<
lastCreatedKey
[
"keyName"
]
<<
std
::
endl
;
std
::
cout
<<
"Last created key creation time: "
<<
lastCreatedKey
[
"creationTime"
]
<<
std
::
endl
;
std
::
cout
<<
"Last created key creation time: "
<<
std
::
stoi
(
lastCreatedKey
[
"creationTime"
].
asString
())
<<
std
::
endl
;
exit
(
0
);
}
...
...
@@ -102,9 +102,9 @@ void isKeyExists(const std::string& key) {
StubClient
c
(
client
,
jsonrpc
::
JSONRPC_CLIENT_V2
);
std
::
cout
<<
"Info client inited"
<<
std
::
endl
;
if
(
c
.
isKeyExist
(
key
)[
"IsExist"
].
asBool
())
{
std
::
cout
<<
"Key with name "
<<
key
<<
"presents in server database.
\n
"
;
std
::
cout
<<
"Key with name "
<<
key
<<
"
presents in server database.
\n
"
;
}
else
{
std
::
cout
<<
"Key with name "
<<
key
<<
"does not exist in server's database.
\n
"
;
std
::
cout
<<
"Key with name "
<<
key
<<
"
does not exist in server's database.
\n
"
;
}
exit
(
0
);
}
...
...
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