mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 09:11:34 +00:00
refactor(identity): follow naming conventions for conversion methods
This PR renames some method names that don't follow Rust naming conventions or behave differently from what the name suggests: - Enforce "try" prefix on all methods that return `Result`. - Enforce "encode" method name for methods that return encoded bytes. - Enforce "to_bytes" method name for methods that return raw bytes. - Enforce "decode" method name for methods that convert encoded key. - Enforce "from_bytes" method name for methods that convert raw bytes. Pull-Request: #3775.
This commit is contained in:
@ -203,7 +203,7 @@ impl From<MessageAuthenticity> for PublishConfig {
|
||||
match authenticity {
|
||||
MessageAuthenticity::Signed(keypair) => {
|
||||
let public_key = keypair.public();
|
||||
let key_enc = public_key.to_protobuf_encoding();
|
||||
let key_enc = public_key.encode_protobuf();
|
||||
let key = if key_enc.len() <= 42 {
|
||||
// The public key can be inlined in [`rpc_proto::proto::::Message::from`], so we don't include it
|
||||
// specifically in the [`rpc_proto::proto::Message::key`] field.
|
||||
|
Reference in New Issue
Block a user