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
febe2c8b
Unverified
Commit
febe2c8b
authored
Jun 07, 2021
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3951 add rsp methods
parent
ddf62aa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
RspMessage.h
zmq_src/RspMessage.h
+60
-0
ZMQMessage.cpp
zmq_src/ZMQMessage.cpp
+8
-0
ZMQMessage.h
zmq_src/ZMQMessage.h
+2
-0
No files found.
zmq_src/RspMessage.h
View file @
febe2c8b
...
...
@@ -61,6 +61,10 @@ public:
importECDSARspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getECDSAPublicKey
()
{
return
getStringRapid
(
"publicKey"
);
}
};
...
...
@@ -69,6 +73,14 @@ public:
generateECDSARspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getECDSAPublicKey
()
{
return
getStringRapid
(
"publicKey"
);
}
string
getKeyName
()
{
return
getStringRapid
(
"keyName"
);
}
};
...
...
@@ -77,6 +89,10 @@ public:
getPublicECDSARspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getECDSAPublicKey
()
{
return
getStringRapid
(
"publicKey"
);
}
};
...
...
@@ -93,6 +109,10 @@ public:
getVerificationVectorRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
Json
::
Value
getVerificationVector
()
{
return
getJsonValueRapid
(
"verificationVector"
);
}
};
...
...
@@ -101,6 +121,10 @@ public:
getSecretShareRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getSecretShare
()
{
return
getStringRapid
(
"secretShare"
);
}
};
...
...
@@ -109,6 +133,10 @@ public:
dkgVerificationRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
bool
isCorrect
()
{
return
getBoolRapid
(
"result"
);
}
};
...
...
@@ -125,6 +153,10 @@ public:
getBLSPublicRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
Json
::
Value
getBLSPublicKey
()
{
return
getJsonValueRapid
(
"blsPublicKeyShare"
);
}
};
...
...
@@ -133,6 +165,10 @@ public:
getAllBLSPublicKeysRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
Json
::
Value
getPublicKeys
()
{
return
getJsonValueRapid
(
"publicKeys"
);
}
};
...
...
@@ -141,6 +177,14 @@ public:
complaintResponseRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getDHKey
()
{
return
getStringRapid
(
"dhKey"
);
}
string
getShare
()
{
return
getStringRapid
(
"share*G2"
);
}
};
...
...
@@ -149,6 +193,10 @@ public:
multG2RspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
Json
::
Value
getResult
()
{
return
getJsonValueRapid
(
"x*G2"
);
}
};
...
...
@@ -157,6 +205,10 @@ public:
isPolyExistsRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
bool
isExists
()
{
return
getBoolRapid
(
"IsExist"
);
}
};
...
...
@@ -173,6 +225,10 @@ public:
getServerVersionRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
string
getVesion
()
{
return
getStringRapid
(
"version"
);
}
};
...
...
@@ -181,6 +237,10 @@ public:
deleteBLSKeyRspMessage
(
shared_ptr
<
rapidjson
::
Document
>&
_d
)
:
ZMQMessage
(
_d
)
{};
virtual
Json
::
Value
process
();
bool
isSuccessful
()
{
return
getBoolRapid
(
"deleted"
);
}
};
...
...
zmq_src/ZMQMessage.cpp
View file @
febe2c8b
...
...
@@ -60,6 +60,14 @@ Json::Value ZMQMessage::getJsonValueRapid(const char *_name) {
return
root
;
}
bool
ZMQMessage
::
getBoolRapid
(
const
char
*
_name
)
{
CHECK_STATE
(
_name
);
CHECK_STATE
(
d
->
HasMember
(
_name
));
const
rapidjson
::
Value
&
a
=
(
*
d
)[
_name
];
CHECK_STATE
(
a
.
IsBool
());
return
a
.
GetBool
();
}
string
ZMQMessage
::
getStringRapid
(
const
char
*
_name
)
{
CHECK_STATE
(
_name
);
CHECK_STATE
(
d
->
HasMember
(
_name
));
...
...
zmq_src/ZMQMessage.h
View file @
febe2c8b
...
...
@@ -112,6 +112,8 @@ public:
Json
::
Value
getJsonValueRapid
(
const
char
*
_name
);
bool
getBoolRapid
(
const
char
*
_name
);
uint64_t
getStatus
()
{
return
getUint64Rapid
(
"status"
);
}
...
...
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