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
a1e1185e
Unverified
Commit
a1e1185e
authored
Jan 03, 2020
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-1955 Add getServerStatus to stubclient
parent
161369f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
89 deletions
+110
-89
stubclient.h
stubclient.h
+110
-89
No files found.
stubclient.h
View file @
a1e1185e
...
@@ -26,6 +26,7 @@ class StubClient : public jsonrpc::Client
...
@@ -26,6 +26,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
,
int
t
,
int
n
,
int
signerIndex
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
,
int
t
,
int
n
,
int
signerIndex
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -40,6 +41,7 @@ class StubClient : public jsonrpc::Client
...
@@ -40,6 +41,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
importECDSAKey
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
importECDSAKey
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -51,6 +53,7 @@ class StubClient : public jsonrpc::Client
...
@@ -51,6 +53,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
generateECDSAKey
()
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
generateECDSAKey
()
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -61,6 +64,7 @@ class StubClient : public jsonrpc::Client
...
@@ -61,6 +64,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
renameECDSAKey
(
const
std
::
string
&
KeyName
,
const
std
::
string
&
tempKeyName
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
renameECDSAKey
(
const
std
::
string
&
KeyName
,
const
std
::
string
&
tempKeyName
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -72,6 +76,7 @@ class StubClient : public jsonrpc::Client
...
@@ -72,6 +76,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
getPublicECDSAKey
(
const
std
::
string
&
keyName
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
getPublicECDSAKey
(
const
std
::
string
&
keyName
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -82,6 +87,7 @@ class StubClient : public jsonrpc::Client
...
@@ -82,6 +87,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
ecdsaSignMessageHash
(
int
base
,
const
std
::
string
&
keyName
,
const
std
::
string
&
messageHash
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
ecdsaSignMessageHash
(
int
base
,
const
std
::
string
&
keyName
,
const
std
::
string
&
messageHash
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -94,6 +100,7 @@ class StubClient : public jsonrpc::Client
...
@@ -94,6 +100,7 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
generateDKGPoly
(
const
std
::
string
&
polyName
,
int
t
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
generateDKGPoly
(
const
std
::
string
&
polyName
,
int
t
)
throw
(
jsonrpc
::
JsonRpcException
)
{
{
Json
::
Value
p
;
Json
::
Value
p
;
...
@@ -105,98 +112,112 @@ class StubClient : public jsonrpc::Client
...
@@ -105,98 +112,112 @@ class StubClient : public jsonrpc::Client
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
getVerificationVector
(
const
std
::
string
&
polyName
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
getVerificationVector
(
const
std
::
string
&
polyName
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
p
;
{
p
[
"polyName"
]
=
polyName
;
Json
::
Value
p
;
p
[
"n"
]
=
n
;
p
[
"polyName"
]
=
polyName
;
p
[
"t"
]
=
t
;
p
[
"n"
]
=
n
;
Json
::
Value
result
=
this
->
CallMethod
(
"getVerificationVector"
,
p
);
p
[
"t"
]
=
t
;
if
(
result
.
isObject
())
Json
::
Value
result
=
this
->
CallMethod
(
"getVerificationVector"
,
p
);
return
result
;
if
(
result
.
isObject
())
else
return
result
;
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
else
}
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
getSecretShare
(
const
std
::
string
&
polyName
,
const
Json
::
Value
&
publicKeys
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
}
{
Json
::
Value
p
;
Json
::
Value
getSecretShare
(
const
std
::
string
&
polyName
,
const
Json
::
Value
&
publicKeys
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
p
[
"polyName"
]
=
polyName
;
{
p
[
"publicKeys"
]
=
publicKeys
;
Json
::
Value
p
;
p
[
"n"
]
=
n
;
p
[
"polyName"
]
=
polyName
;
p
[
"t"
]
=
t
;
p
[
"publicKeys"
]
=
publicKeys
;
Json
::
Value
result
=
this
->
CallMethod
(
"getSecretShare"
,
p
);
p
[
"n"
]
=
n
;
if
(
result
.
isObject
())
p
[
"t"
]
=
t
;
return
result
;
Json
::
Value
result
=
this
->
CallMethod
(
"getSecretShare"
,
p
);
else
if
(
result
.
isObject
())
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
return
result
;
}
else
Json
::
Value
DKGVerification
(
const
std
::
string
&
publicShares
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
,
int
index
)
throw
(
jsonrpc
::
JsonRpcException
)
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
{
}
Json
::
Value
p
;
p
[
"EthKeyName"
]
=
EthKeyName
;
Json
::
Value
DKGVerification
(
const
std
::
string
&
publicShares
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
,
int
index
)
throw
(
jsonrpc
::
JsonRpcException
)
p
[
"SecretShare"
]
=
SecretShare
;
{
p
[
"index"
]
=
index
;
Json
::
Value
p
;
p
[
"n"
]
=
n
;
p
[
"EthKeyName"
]
=
EthKeyName
;
p
[
"publicShares"
]
=
publicShares
;
p
[
"SecretShare"
]
=
SecretShare
;
p
[
"t"
]
=
t
;
p
[
"index"
]
=
index
;
Json
::
Value
result
=
this
->
CallMethod
(
"DKGVerification"
,
p
);
p
[
"n"
]
=
n
;
if
(
result
.
isObject
())
p
[
"publicShares"
]
=
publicShares
;
return
result
;
p
[
"t"
]
=
t
;
else
Json
::
Value
result
=
this
->
CallMethod
(
"DKGVerification"
,
p
);
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
if
(
result
.
isObject
())
}
return
result
;
Json
::
Value
CreateBLSPrivateKey
(
const
std
::
string
&
BLSKeyName
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
polyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
else
{
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
p
;
}
p
[
"BLSKeyName"
]
=
BLSKeyName
;
p
[
"EthKeyName"
]
=
EthKeyName
;
Json
::
Value
CreateBLSPrivateKey
(
const
std
::
string
&
BLSKeyName
,
const
std
::
string
&
EthKeyName
,
const
std
::
string
&
polyName
,
const
std
::
string
&
SecretShare
,
int
t
,
int
n
)
throw
(
jsonrpc
::
JsonRpcException
)
p
[
"polyName"
]
=
polyName
;
{
p
[
"SecretShare"
]
=
SecretShare
;
Json
::
Value
p
;
p
[
"n"
]
=
n
;
p
[
"BLSKeyName"
]
=
BLSKeyName
;
p
[
"t"
]
=
t
;
p
[
"EthKeyName"
]
=
EthKeyName
;
Json
::
Value
result
=
this
->
CallMethod
(
"CreateBLSPrivateKey"
,
p
);
p
[
"polyName"
]
=
polyName
;
if
(
result
.
isObject
())
p
[
"SecretShare"
]
=
SecretShare
;
return
result
;
p
[
"n"
]
=
n
;
else
p
[
"t"
]
=
t
;
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
result
=
this
->
CallMethod
(
"CreateBLSPrivateKey"
,
p
);
}
if
(
result
.
isObject
())
return
result
;
Json
::
Value
GetBLSPublicKeyShare
(
const
std
::
string
&
BLSKeyName
)
throw
(
jsonrpc
::
JsonRpcException
)
else
{
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
p
;
}
p
[
"BLSKeyName"
]
=
BLSKeyName
;
Json
::
Value
GetBLSPublicKeyShare
(
const
std
::
string
&
BLSKeyName
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
result
=
this
->
CallMethod
(
"GetBLSPublicKeyShare"
,
p
);
{
if
(
result
.
isObject
())
Json
::
Value
p
;
return
result
;
p
[
"BLSKeyName"
]
=
BLSKeyName
;
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
result
=
this
->
CallMethod
(
"GetBLSPublicKeyShare"
,
p
);
}
if
(
result
.
isObject
())
return
result
;
Json
::
Value
ComplaintResponse
(
const
std
::
string
&
polyName
,
int
ind
)
throw
(
jsonrpc
::
JsonRpcException
)
else
{
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
p
;
}
p
[
"polyName"
]
=
polyName
;
p
[
"ind"
]
=
ind
;
Json
::
Value
ComplaintResponse
(
const
std
::
string
&
polyName
,
int
ind
)
throw
(
jsonrpc
::
JsonRpcException
)
Json
::
Value
result
=
this
->
CallMethod
(
"ComplaintResponse"
,
p
);
{
if
(
result
.
isObject
())
Json
::
Value
p
;
return
result
;
p
[
"polyName"
]
=
polyName
;
else
p
[
"ind"
]
=
ind
;
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
Json
::
Value
result
=
this
->
CallMethod
(
"ComplaintResponse"
,
p
);
}
if
(
result
.
isObject
())
Json
::
Value
MultG2
(
const
std
::
string
&
x
)
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
p
;
p
[
"x"
]
=
x
;
Json
::
Value
result
=
this
->
CallMethod
(
"MultG2"
,
p
);
if
(
result
.
isObject
())
return
result
;
return
result
;
else
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
}
Json
::
Value
MultG2
(
const
std
::
string
&
x
)
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
p
;
p
[
"x"
]
=
x
;
Json
::
Value
result
=
this
->
CallMethod
(
"MultG2"
,
p
);
if
(
result
.
isObject
())
return
result
;
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
Json
::
Value
getServerStatus
()
throw
(
jsonrpc
::
JsonRpcException
)
{
Json
::
Value
p
;
p
=
Json
::
nullValue
;
Json
::
Value
result
=
this
->
CallMethod
(
"getServerStatus"
,
p
);
if
(
result
.
isObject
())
return
result
;
else
throw
jsonrpc
::
JsonRpcException
(
jsonrpc
::
Errors
::
ERROR_CLIENT_INVALID_RESPONSE
,
result
.
toStyledString
());
}
};
};
#endif //JSONRPC_CPP_STUB_STUBCLIENT_H_
#endif //JSONRPC_CPP_STUB_STUBCLIENT_H_
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