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
d9d10219
Unverified
Commit
d9d10219
authored
Sep 10, 2019
by
kladkogex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added DB read write test
parent
c3984af2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
SGXWalletServer.hpp
SGXWalletServer.hpp
+5
-0
sgxwallet_common.h
sgxwallet_common.h
+2
-0
testw.cpp
testw.cpp
+25
-3
No files found.
SGXWalletServer.hpp
View file @
d9d10219
#ifndef SGXWALLET_SGXWALLETSERVER_HPP
#define SGXWALLET_SGXWALLETSERVER_HPP
#include "abstractstubserver.h"
using
namespace
jsonrpc
;
using
namespace
std
;
...
...
sgxwallet_common.h
View file @
d9d10219
...
...
@@ -39,6 +39,8 @@
#define WALLETDB_NAME "sgxwallet.db"
#define ENCLAVE_NAME "secure_enclave.signed.so"
...
...
testw.cpp
View file @
d9d10219
...
...
@@ -31,19 +31,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <jsonrpccpp/server/connectors/httpserver.h>
#include "sgxwallet_common.h"
#include "create_enclave.h"
#include "secure_enclave_u.h"
#include "sgx_detect.h"
#include <gmp.h>
#include <sgx_urts.h>
#include <stdio.h>
#include "BLSCrypto.h"
#include "ServerInit.h"
#define ENCLAVE_NAME "secure_enclave.signed.so"
#include "RPCException.h"
#include "LevelDB.h"
#include "SGXWalletServer.hpp"
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
...
...
@@ -219,11 +225,27 @@ TEST_CASE("BLS sign test", "[bls-sign]") {
TEST_CASE
(
"KeysDB test"
,
"[dkg-gen]"
)
{
TEST_CASE
(
"KeysDB test"
,
"[keys-db]"
)
{
reset_db
();
init_all
();
string
key
=
"SCHAIN:17:INDEX:5:KEY:1"
;
string
value
=
TEST_KEY
;
REQUIRE_THROWS
(
readKeyShare
(
key
));
writeKeyShare
(
key
,
value
);
REQUIRE
(
readKeyShare
(
key
)
!=
nullptr
);
// put your test here
}
...
...
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