Conversation
| // Licensed under the Apache 2.0 License. | ||
| #pragma once | ||
|
|
||
| #include "../node/rpc/jsonrpc.h" |
| certs.push_back(std::move(the_cert)); | ||
| } | ||
|
|
||
| void add(std::shared_ptr<tls::Cert> cert) |
There was a problem hiding this comment.
It's a leftover from the cert changes, will take it out.
| j["name"] = to_string(i); | ||
| const auto response = | ||
| json::from_msgpack(conn->call("SmallBank_balance", j)); | ||
| json::from_msgpack(conn->call("users/SmallBank_balance", j)); |
There was a problem hiding this comment.
Should this prefixing be done in RpcTlsClient::call? We already have the appropriate prefix in the sni member of TlsClient
There was a problem hiding this comment.
It depends how we want to test stuff, but it certainly could.
|
|
||
| std::string get_method(const std::string& method) | ||
| { | ||
| return method.substr(method.find_last_of('/') + 1, method.size()); |
There was a problem hiding this comment.
If method doesn't contain /, this returns the entire string (find_last_of returns npos aka max(size_t), +1 wraps to 0) - is this the intended behaviour? I think RpcEndpoint::get_actor should return the actor and the remaining method, rather than repeating a similar parse here.
There was a problem hiding this comment.
That's the idea once this disappears, the method becomes an input to process. This is only here to get stuff working with the existing code path/validate the idea.
| { | ||
| // The hostname indicates the rpc class. | ||
| auto host = hostname(); | ||
| send(jsonrpc::pack(rpc, pack.value())); |
There was a problem hiding this comment.
does this need to be re-packed, can we not just send data?
There was a problem hiding this comment.
No, this is the response "couldn't deserialised", the naming is slightly confusing, but it isn't the original RPC.
| session_id(session_id) | ||
| {} | ||
|
|
||
| std::optional<jsonrpc::Pack> detect_pack(const std::vector<uint8_t>& input) |
There was a problem hiding this comment.
We should make sure that detect_pack() and unpack_json() are not duplicated from the ones in frontend.h before we merge this.
There was a problem hiding this comment.
Yes, absolutely, I'm removing a load of code from the frontend at the moment.


Working draft for prefix dispatch change with the cert mods pulled out.