scaffold verifier trait #818
Annotations
8 errors and 13 warnings
the `?` operator can only be applied to values that implement `std::ops::Try`:
xmtp_id/src/lib.rs#L73
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> xmtp_id/src/lib.rs:73:26
|
73 | let credential = CredentialVerifier::verify_credential(request)?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `std::pin::Pin<std::boxed::Box<dyn futures::Future<Output = std::result::Result<credential::VerifiedCredential, credential::VerificationError>> + std::marker::Send>>`
|
= help: the trait `std::ops::Try` is not implemented for `Pin<Box<dyn Future<Output = Result<VerifiedCredential, VerificationError>> + Send>>`
|
arguments to this function are incorrect:
xmtp_id/src/lib.rs#L72
error[E0308]: arguments to this function are incorrect
--> xmtp_id/src/lib.rs:72:23
|
72 | let request = VerificationRequest::new(credential, installation_public_key);
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: expected `Vec<u8>`, found `&[u8]`
--> xmtp_id/src/lib.rs:72:48
|
72 | let request = VerificationRequest::new(credential, installation_public_key);
| ^^^^^^^^^^
= note: expected struct `std::vec::Vec<u8>`
found reference `&[u8]`
note: expected `Vec<u8>`, found `&[u8]`
--> xmtp_id/src/lib.rs:72:60
|
72 | let request = VerificationRequest::new(credential, installation_public_key);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: expected struct `std::vec::Vec<u8>`
found reference `&[u8]`
note: associated function defined here
--> xmtp_id/src/credential.rs:48:12
|
48 | pub fn new(installation_public_key: Vec<u8>, credential: Vec<u8>) -> Self {
| ^^^ -------------------------------- -------------------
help: try using a conversion method
|
72 | let request = VerificationRequest::new(credential.to_vec(), installation_public_key);
| +++++++++
help: try using a conversion method
|
72 | let request = VerificationRequest::new(credential, installation_public_key.to_vec());
| +++++++++
|
mismatched types:
xmtp_id/src/credential.rs#L84
error[E0308]: mismatched types
--> xmtp_id/src/credential.rs:84:13
|
79 | Ok(match credential {
| ---------- this expression has type `std::result::Result<xmtp_mls::credential::Credential, xmtp_mls::credential::AssociationError>`
...
84 | Credential::LegacyCreateIdentity(cred) => VerifiedCredential {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<Credential, ...>`, found `Credential`
|
= note: expected enum `std::result::Result<xmtp_mls::credential::Credential, xmtp_mls::credential::AssociationError>`
found enum `xmtp_mls::credential::Credential`
help: try wrapping the pattern in `Ok`
|
84 | Ok(Credential::LegacyCreateIdentity(cred)) => VerifiedCredential {
| +++ +
|
mismatched types:
xmtp_id/src/credential.rs#L80
error[E0308]: mismatched types
--> xmtp_id/src/credential.rs:80:13
|
79 | Ok(match credential {
| ---------- this expression has type `std::result::Result<xmtp_mls::credential::Credential, xmtp_mls::credential::AssociationError>`
80 | Credential::GrantMessagingAccess(cred) => VerifiedCredential {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<Credential, ...>`, found `Credential`
|
= note: expected enum `std::result::Result<xmtp_mls::credential::Credential, xmtp_mls::credential::AssociationError>`
found enum `xmtp_mls::credential::Credential`
help: try wrapping the pattern in `Ok`
|
80 | Ok(Credential::GrantMessagingAccess(cred)) => VerifiedCredential {
| +++ +
|
mismatched types:
xmtp_id/src/credential.rs#L78
error[E0308]: mismatched types
--> xmtp_id/src/credential.rs:78:46
|
78 | Credential::from_proto_validated(proto, None, Some(request.installation_public_key));
| -------------------------------- ^^^^^ expected `MlsCredential`, found `Result<MlsCredential, DecodeError>`
| |
| arguments to this function are incorrect
|
= note: expected struct `xmtp_proto::xmtp::mls::message_contents::MlsCredential`
found enum `std::result::Result<xmtp_proto::xmtp::mls::message_contents::MlsCredential, prost::DecodeError>`
note: associated function defined here
--> /home/runner/work/libxmtp/libxmtp/xmtp_mls/src/credential/mod.rs:92:12
|
92 | pub fn from_proto_validated(
| ^^^^^^^^^^^^^^^^^^^^
help: consider using `Result::expect` to unwrap the `std::result::Result<xmtp_proto::xmtp::mls::message_contents::MlsCredential, prost::DecodeError>` value, panicking if the value is a `Result::Err`
|
78 | Credential::from_proto_validated(proto.expect("REASON"), None, Some(request.installation_public_key));
| +++++++++++++++++
|
mismatched types:
xmtp_id/src/credential.rs#L78
error[E0308]: mismatched types
--> xmtp_id/src/credential.rs:78:64
|
78 | Credential::from_proto_validated(proto, None, Some(request.installation_public_key));
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `Vec<u8>`
| |
| arguments to this enum variant are incorrect
|
= note: expected reference `&[u8]`
found struct `std::vec::Vec<u8>`
help: the type constructed contains `std::vec::Vec<u8>` due to the type of the argument passed
--> xmtp_id/src/credential.rs:78:59
|
78 | Credential::from_proto_validated(proto, None, Some(request.installation_public_key));
| ^^^^^-------------------------------^
| |
| this argument influences the type of `Some`
note: tuple variant defined here
--> /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/option.rs:578:5
help: consider borrowing here
|
78 | Credential::from_proto_validated(proto, None, Some(&request.installation_public_key));
| +
|
the trait bound `std::vec::Vec<u8>: prost::bytes::Buf` is not satisfied:
xmtp_id/src/credential.rs#L76
error[E0277]: the trait bound `std::vec::Vec<u8>: prost::bytes::Buf` is not satisfied
--> xmtp_id/src/credential.rs:76:45
|
76 | let proto = CredentialProto::decode(request.credential);
| ----------------------- ^^^^^^^^^^^^^^^^^^ the trait `prost::bytes::Buf` is not implemented for `std::vec::Vec<u8>`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `prost::bytes::Buf`:
std::boxed::Box<T>
prost::bytes::Bytes
prost::bytes::BytesMut
tungstenite::buffer::ReadBuffer<CHUNK_SIZE>
prost::bytes::buf::Chain<T, U>
prost::bytes::buf::Take<T>
tonic::codec::buffer::DecodeBuf<'_>
std::collections::VecDeque<u8>
and 3 others
note: required by a bound in `prost::Message::decode`
--> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-0.12.3/src/message.rs:112:12
|
110 | fn decode<B>(mut buf: B) -> Result<Self, DecodeError>
| ------ required by a bound in this associated function
111 | where
112 | B: Buf,
| ^^^ required by this bound in `Message::decode`
|
build
buildx failed with: ERROR: failed to solve: process "/bin/sh -c cargo check" did not complete successfully: exit code: 101
|
unused import: `VerifiedCredential`:
xmtp_id/src/lib.rs#L17
warning: unused import: `VerifiedCredential`
--> xmtp_id/src/lib.rs:17:59
|
17 | credential::{CredentialVerifier, VerificationRequest, VerifiedCredential},
| ^^^^^^^^^^^^^^^^^^
|
unused import: `xmtp_proto::xmtp::mls::message_contents::MlsCredential as CredentialProto`:
xmtp_id/src/lib.rs#L14
warning: unused import: `xmtp_proto::xmtp::mls::message_contents::MlsCredential as CredentialProto`
--> xmtp_id/src/lib.rs:14:5
|
14 | use xmtp_proto::xmtp::mls::message_contents::MlsCredential as CredentialProto;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
unused import: `credential::Credential`:
xmtp_id/src/lib.rs#L11
warning: unused import: `credential::Credential`
--> xmtp_id/src/lib.rs:11:33
|
11 | configuration::CIPHERSUITE, credential::Credential,
| ^^^^^^^^^^^^^^^^^^^^^^
|
unused import: `prost::Message`:
xmtp_id/src/lib.rs#L9
warning: unused import: `prost::Message`
--> xmtp_id/src/lib.rs:9:5
|
9 | use prost::Message;
| ^^^^^^^^^^^^^^
|
unused imports: `GrantMessagingAccessAssociation`, `LegacyCreateIdentityAssociation`:
xmtp_id/src/credential.rs#L3
warning: unused imports: `GrantMessagingAccessAssociation`, `LegacyCreateIdentityAssociation`
--> xmtp_id/src/credential.rs:3:30
|
3 | credential::{Credential, GrantMessagingAccessAssociation, LegacyCreateIdentityAssociation},
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
redundant closure:
xmtp_mls/src/groups/subscriptions.rs#L89
warning: redundant closure
--> xmtp_mls/src/groups/subscriptions.rs:89:13
|
89 | move |message| callback(message),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `callback`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
returning the result of a `let` binding from a block:
xmtp_api_grpc/src/auth_token.rs#L59
warning: returning the result of a `let` binding from a block
--> xmtp_api_grpc/src/auth_token.rs:59:9
|
58 | let token_base64 = base64::engine::general_purpose::STANDARD.encode(&token_bytes);
| ---------------------------------------------------------------------------------- unnecessary `let` binding
59 | token_base64
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
58 ~
59 ~ base64::engine::general_purpose::STANDARD.encode(&token_bytes)
|
|
the borrowed expression implements the required traits:
xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs#L2424
warning: the borrowed expression implements the required traits
--> xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs:2424:91
|
2424 | struct_ser.serialize_field("content", pbjson::private::base64::encode(&v).as_str())?;
| ^^ help: change this to: `v`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs#L391
warning: the borrowed expression implements the required traits
--> xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs:391:115
|
391 | struct_ser.serialize_field("unsignedLegacyCreateIdentityKey", pbjson::private::base64::encode(&v).as_str())?;
| ^^ help: change this to: `v`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs#L387
warning: the borrowed expression implements the required traits
--> xmtp_proto/src/gen/xmtp.mls.message_contents.serde.rs:387:99
|
387 | struct_ser.serialize_field("installationKey", pbjson::private::base64::encode(&v).as_str())?;
| ^^ help: change this to: `v`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
xmtp_proto/src/gen/xmtp.message_contents.serde.rs#L2951
warning: the borrowed expression implements the required traits
--> xmtp_proto/src/gen/xmtp.message_contents.serde.rs:2951:86
|
2951 | struct_ser.serialize_field("senderHmac", pbjson::private::base64::encode(&v).as_str())?;
| ^^ help: change this to: `v`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
the borrowed expression implements the required traits:
xmtp_proto/src/gen/xmtp.message_contents.serde.rs#L1334
warning: the borrowed expression implements the required traits
--> xmtp_proto/src/gen/xmtp.message_contents.serde.rs:1334:86
|
1334 | struct_ser.serialize_field("v1", pbjson::private::base64::encode(&v).as_str())?;
| ^^ help: change this to: `v`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
build
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: docker/build-push-action@v4. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|