Fix deprecated use of RPC trait object without dyn (#615)

Adds dyn keyword to OwnerRpc and ForeignRpc trait objects

Fixes deprecation warning
This commit is contained in:
GeneFerneau 2021-05-19 18:39:05 +00:00 committed by GitHub
parent b7f587f2b3
commit 18361dabd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -572,7 +572,7 @@ where
is_init_secure_api = OwnerV3Helpers::is_init_secure_api(&val); is_init_secure_api = OwnerV3Helpers::is_init_secure_api(&val);
// also need to intercept open/close wallet requests // also need to intercept open/close wallet requests
let is_open_wallet = OwnerV3Helpers::is_open_wallet(&val); let is_open_wallet = OwnerV3Helpers::is_open_wallet(&val);
match OwnerRpc::handle_request(&*api, val) { match <dyn OwnerRpc>::handle_request(&*api, val) {
MaybeReply::Reply(mut r) => { MaybeReply::Reply(mut r) => {
let (_was_error, unencrypted_intercept) = let (_was_error, unencrypted_intercept) =
OwnerV3Helpers::check_error_response(&r.clone()); OwnerV3Helpers::check_error_response(&r.clone());
@ -691,7 +691,7 @@ where
api: Foreign<'static, L, C, K>, api: Foreign<'static, L, C, K>,
) -> Result<serde_json::Value, Error> { ) -> Result<serde_json::Value, Error> {
let val: serde_json::Value = parse_body(req).await?; let val: serde_json::Value = parse_body(req).await?;
match ForeignRpc::handle_request(&api, val) { match <dyn ForeignRpc>::handle_request(&api, val) {
MaybeReply::Reply(r) => Ok(r), MaybeReply::Reply(r) => Ok(r),
MaybeReply::DontReply => { MaybeReply::DontReply => {
// Since it's http, we need to return something. We return [] because jsonrpc // Since it's http, we need to return something. We return [] because jsonrpc