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
32063a16
Unverified
Commit
32063a16
authored
3 years ago
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3951 add test, fix importECDSAKey
parent
370b6f33
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
testw.cpp
testw.cpp
+15
-0
testw.py
testw.py
+1
-1
ZMQClient.cpp
zmq_src/ZMQClient.cpp
+1
-1
No files found.
testw.cpp
View file @
32063a16
...
...
@@ -557,6 +557,21 @@ TEST_CASE_METHOD(TestFixture, "Import ECDSA Key", "[import-ecdsa-key]") {
REQUIRE
(
c
.
ecdsaSignMessageHash
(
16
,
name
,
SAMPLE_HASH
)[
"status"
]
==
0
);
}
TEST_CASE_METHOD
(
TestFixture
,
"Import ECDSA Key Zmq"
,
"[import-ecdsa-key-zmq]"
)
{
auto
client
=
make_shared
<
ZMQClient
>
(
ZMQ_IP
,
ZMQ_PORT
,
true
,
"./sgx_data/cert_data/rootCA.pem"
,
"./sgx_data/cert_data/rootCA.key"
);
std
::
string
name
=
"NEK:abcdef"
;
REQUIRE_THROWS
(
client
->
importECDSAKey
(
"6507625568967977077291849236396320012317305261598035438182864059942098934847"
,
name
));
string
key_str
=
"0xe632f7fde2c90a073ec43eaa90dca7b82476bf28815450a11191484934b9c3f"
;
string
response
=
client
->
importECDSAKey
(
key_str
,
name
);
REQUIRE
(
response
==
client
->
getECDSAPublicKey
(
name
));
REQUIRE_NOTHROW
(
client
->
ecdsaSignMessageHash
(
16
,
name
,
SAMPLE_HASH
));
}
TEST_CASE_METHOD
(
TestFixture
,
"Backup Key"
,
"[backup-key]"
)
{
HttpClient
client
(
RPC_ENDPOINT
);
StubClient
c
(
client
,
JSONRPC_CLIENT_V2
);
...
...
This diff is collapsed.
Click to expand it.
testw.py
View file @
32063a16
...
...
@@ -44,7 +44,7 @@ testList = [ "[zmq-ecdsa]",
"[delete-bls-key]"
,
"[delete-bls-key-zmq]"
,
"[import-ecdsa-key]"
,
#
[import-ecdsa-key-zmq]",
"
[import-ecdsa-key-zmq]"
,
"[ecdsa-aes-key-gen]"
,
"[ecdsa-aes-key-sig-gen]"
,
"[ecdsa-aes-get-pub-key]"
,
...
...
This diff is collapsed.
Click to expand it.
zmq_src/ZMQClient.cpp
View file @
32063a16
...
...
@@ -327,7 +327,7 @@ string ZMQClient::importECDSAKey(const std::string& keyShare, const std::string&
Json
::
Value
p
;
p
[
"type"
]
=
ZMQMessage
::
IMPORT_ECDSA_REQ
;
p
[
"keyName"
]
=
keyName
;
p
[
"key
Share
"
]
=
keyShare
;
p
[
"key"
]
=
keyShare
;
auto
result
=
dynamic_pointer_cast
<
importECDSARspMessage
>
(
doRequestReply
(
p
));
CHECK_STATE
(
result
);
CHECK_STATE
(
result
->
getStatus
()
==
0
);
...
...
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