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
be46bdd5
Unverified
Commit
be46bdd5
authored
Jan 19, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug/SKALE-3751-enable-zeromq
parent
0ca22613
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
253 deletions
+18
-253
BLSSignReqMessage.cpp
BLSSignReqMessage.cpp
+2
-2
TestUtils.cpp
TestUtils.cpp
+7
-5
TestUtils.h
TestUtils.h
+2
-1
ZMQMessage.cpp
ZMQMessage.cpp
+1
-0
testw.cpp
testw.cpp
+6
-245
No files found.
BLSSignReqMessage.cpp
View file @
be46bdd5
...
...
@@ -7,8 +7,8 @@
Json
::
Value
BLSSignReqMessage
::
process
()
{
auto
keyName
=
getStringRapid
(
"k
n
"
);
auto
hash
=
getStringRapid
(
"mh"
);
auto
keyName
=
getStringRapid
(
"k
eyShareName
"
);
auto
hash
=
getStringRapid
(
"m
essageHas
h"
);
auto
t
=
getUint64Rapid
(
"t"
);
auto
n
=
getUint64Rapid
(
"n"
);
auto
result
=
SGXWalletServer
::
blsSignMessageHashImpl
(
keyName
,
hash
,
t
,
n
);
...
...
TestUtils.cpp
View file @
be46bdd5
...
...
@@ -42,6 +42,7 @@
#include "SGXWalletServer.hpp"
#include "catch.hpp"
#include "ZMQClient.h"
#include "BLSSigShare.h"
#include "BLSSigShareSet.h"
#include "BLSPublicKeyShare.h"
...
...
@@ -403,6 +404,9 @@ void TestUtils::sendRPCRequestZMQ() {
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
int
n
=
16
,
t
=
16
;
Json
::
Value
ethKeys
[
n
];
Json
::
Value
verifVects
[
n
];
...
...
@@ -775,7 +779,7 @@ void TestUtils::doDKGV2(StubClient &c, int n, int t,
}
void
TestUtils
::
doZMQBLS
(
StubClient
&
c
,
int
n
,
int
t
,
void
TestUtils
::
doZMQBLS
(
shared_ptr
<
ZMQClient
>
_zmqClient
,
StubClient
&
c
,
int
n
,
int
t
,
vector
<
string
>&
_ecdsaKeyNames
,
vector
<
string
>&
_blsKeyNames
,
int
schainID
,
int
dkgID
)
{
Json
::
Value
ethKeys
[
n
];
...
...
@@ -894,10 +898,8 @@ void TestUtils::doZMQBLS(StubClient &c, int n, int t,
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
string
blsName
=
"BLS_KEY"
+
polyNames
[
i
].
substr
(
4
);
blsSigShares
[
i
]
=
c
.
blsSignMessageHash
(
blsName
,
hash
,
t
,
n
);
CHECK_STATE
(
blsSigShares
[
i
][
"status"
]
==
0
);
shared_ptr
<
string
>
sig_share_ptr
=
make_shared
<
string
>
(
blsSigShares
[
i
][
"signatureShare"
].
asString
());
BLSSigShare
sig
(
sig_share_ptr
,
i
+
1
,
t
,
n
);
auto
sigShare
=
make_shared
<
string
>
(
_zmqClient
->
blsSignMessageHash
(
blsName
,
hash
,
t
,
n
));
BLSSigShare
sig
(
sigShare
,
i
+
1
,
t
,
n
);
sigShareSet
.
addSigShare
(
make_shared
<
BLSSigShare
>
(
sig
));
auto
pubKey
=
pubKeyShares
[
i
+
1
];
...
...
TestUtils.h
View file @
be46bdd5
...
...
@@ -41,6 +41,7 @@
#include <sgx_tcrypto.h>
#include "stubclient.h"
#include <jsonrpccpp/server/connectors/httpserver.h>
#include "ZMQClient.h"
#include "abstractstubserver.h"
using
namespace
std
;
...
...
@@ -82,7 +83,7 @@ public:
vector
<
string
>&
_ecdsaKeyNames
,
vector
<
string
>&
_blsKeyNames
,
int
schainID
,
int
dkgID
);
static
void
doZMQBLS
(
StubClient
&
c
,
int
n
,
int
t
,
static
void
doZMQBLS
(
shared_ptr
<
ZMQClient
>
_zmqClient
,
StubClient
&
c
,
int
n
,
int
t
,
vector
<
string
>&
_ecdsaKeyNames
,
vector
<
string
>&
_blsKeyNames
,
int
schainID
,
int
dkgID
);
...
...
ZMQMessage.cpp
View file @
be46bdd5
...
...
@@ -60,6 +60,7 @@ shared_ptr <ZMQMessage> ZMQMessage::parse(const char* _msg,
auto
d
=
make_shared
<
rapidjson
::
Document
>
();
cerr
<<
_msg
<<
endl
;
d
->
Parse
(
_msg
);
CHECK_STATE
(
!
d
->
HasParseError
());
...
...
testw.cpp
View file @
be46bdd5
This diff is collapsed.
Click to expand it.
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