Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
child_state_jrpc_processor.cpp
Go to the documentation of this file.
1
6
#include "
api/service/child_state/child_state_jrpc_processor.hpp
"
7
8
#include "
api/jrpc/jrpc_method.hpp
"
9
#include "
api/service/child_state/requests/get_keys.hpp
"
10
#include "
api/service/child_state/requests/get_keys_paged.hpp
"
11
#include "
api/service/child_state/requests/get_storage.hpp
"
12
#include "
api/service/child_state/requests/get_storage_hash.hpp
"
13
#include "
api/service/child_state/requests/get_storage_size.hpp
"
14
15
namespace
kagome::api::child_state
{
16
17
ChildStateJrpcProcessor::ChildStateJrpcProcessor
(
18
std::shared_ptr<JRpcServer> server, std::shared_ptr<ChildStateApi> api)
19
: api_{std::move(api)},
server_
{std::move(server)} {
20
BOOST_ASSERT(
api_
!=
nullptr
);
21
BOOST_ASSERT(
server_
!=
nullptr
);
22
}
23
24
template
<
typename
Request>
25
using
Handler
=
kagome::api::Method<Request, ChildStateApi>
;
26
27
void
ChildStateJrpcProcessor::registerHandlers
() {
28
server_
->registerHandler(
"childstate_getKeys"
,
29
Handler<request::GetKeys>
(
api_
));
30
31
server_
->registerHandler(
"childstate_getKeysPaged"
,
32
Handler<request::GetKeysPaged>
(
api_
));
33
34
server_
->registerHandler(
"childstate_getStorage"
,
35
Handler<request::GetStorage>
(
api_
));
36
37
// duplicate of `childstate_getStorage`. Required for compatibility with
38
// some clients
39
server_
->registerHandler(
"childstate_getStorageAt"
,
40
Handler<request::GetStorage>
(
api_
));
41
42
server_
->registerHandler(
"childstate_getStorageHash"
,
43
Handler<request::GetStorageHash>
(
api_
));
44
45
// duplicate of `childstate_getStorageHash`. Required for compatibility with
46
// some client
47
server_
->registerHandler(
"childstate_getStorageHashAt"
,
48
Handler<request::GetStorageHash>
(
api_
));
49
50
server_
->registerHandler(
"childstate_getStorageSize"
,
51
Handler<request::GetStorageSize>
(
api_
));
52
53
// duplicate of `childstate_getStorageSize`. Required for compatibility with
54
// some client
55
server_
->registerHandler(
"childstate_getStorageSizeAt"
,
56
Handler<request::GetStorageSize>
(
api_
));
57
}
58
59
}
// namespace kagome::api::child_state
kagome::api::child_state::ChildStateJrpcProcessor::registerHandlers
void registerHandlers() override
registers callbacks for jrpc request
Definition:
child_state_jrpc_processor.cpp:27
child_state_jrpc_processor.hpp
get_storage.hpp
kagome::api::child_state::ChildStateJrpcProcessor::server_
std::shared_ptr< JRpcServer > server_
Definition:
child_state_jrpc_processor.hpp:26
get_storage_size.hpp
kagome::api::child_state
Definition:
child_state_jrpc_processor.cpp:15
get_keys.hpp
get_keys_paged.hpp
get_storage_hash.hpp
kagome::api::child_state::ChildStateJrpcProcessor::api_
std::shared_ptr< ChildStateApi > api_
Definition:
child_state_jrpc_processor.hpp:25
kagome::api::child_state::ChildStateJrpcProcessor::ChildStateJrpcProcessor
ChildStateJrpcProcessor(std::shared_ptr< JRpcServer > server, std::shared_ptr< ChildStateApi > api)
Definition:
child_state_jrpc_processor.cpp:17
kagome::api::Method
Definition:
jrpc_method.hpp:20
jrpc_method.hpp
core
api
service
child_state
child_state_jrpc_processor.cpp
Generated by
1.8.11