Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/keys/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl EnrKey for ed25519::Keypair {
fn enr_to_public(content: &BTreeMap<Key, Vec<u8>>) -> Result<Self::PublicKey, DecoderError> {
let pubkey_bytes = content
.get(ENR_KEY.as_bytes())
.ok_or_else(|| DecoderError::Custom("Unknown signature"))?;
.ok_or(DecoderError::Custom("Unknown signature"))?;

// Decode the RLP
let pubkey_bytes = rlp::Rlp::new(pubkey_bytes).data()?;
Expand Down
2 changes: 1 addition & 1 deletion src/keys/k256_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl EnrKey for SigningKey {
fn enr_to_public(content: &BTreeMap<Key, Vec<u8>>) -> Result<Self::PublicKey, DecoderError> {
let pubkey_bytes = content
.get(ENR_KEY.as_bytes())
.ok_or_else(|| DecoderError::Custom("Unknown signature"))?;
.ok_or(DecoderError::Custom("Unknown signature"))?;

// Decode the RLP
let pubkey_bytes = rlp::Rlp::new(pubkey_bytes).data()?;
Expand Down
2 changes: 1 addition & 1 deletion src/keys/libsecp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl EnrKey for secp256k1::SecretKey {
fn enr_to_public(content: &BTreeMap<Key, Vec<u8>>) -> Result<Self::PublicKey, DecoderError> {
let pubkey_bytes = content
.get(ENR_KEY.as_bytes())
.ok_or_else(|| DecoderError::Custom("Unknown signature"))?;
.ok_or(DecoderError::Custom("Unknown signature"))?;

// Decode the RLP
let pubkey_bytes = rlp::Rlp::new(pubkey_bytes).data()?;
Expand Down
2 changes: 1 addition & 1 deletion src/keys/rust_secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl EnrKey for c_secp256k1::SecretKey {
fn enr_to_public(content: &BTreeMap<Key, Vec<u8>>) -> Result<Self::PublicKey, DecoderError> {
let pubkey_bytes = content
.get(ENR_KEY.as_bytes())
.ok_or_else(|| DecoderError::Custom("Unknown signature"))?;
.ok_or(DecoderError::Custom("Unknown signature"))?;
// Decode the RLP
let pubkey_bytes = rlp::Rlp::new(pubkey_bytes).data()?;

Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@
//! [`get`]: struct.Enr.html#method.get

#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
#![allow(clippy::missing_errors_doc, clippy::module_name_repetitions)]
#![allow(
clippy::map_err_ignore,
clippy::missing_errors_doc,
clippy::module_name_repetitions
)]

mod builder;
mod keys;
Expand Down Expand Up @@ -523,7 +527,7 @@ impl<K: EnrKey> Enr<K> {
self.seq = self
.seq
.checked_add(1)
.ok_or_else(|| EnrError::SequenceNumberTooHigh)?;
.ok_or(EnrError::SequenceNumberTooHigh)?;

// sign the record
self.sign(enr_key)?;
Expand Down Expand Up @@ -700,7 +704,7 @@ impl<K: EnrKey> Enr<K> {
self.seq = self
.seq
.checked_add(1)
.ok_or_else(|| EnrError::SequenceNumberTooHigh)?;
.ok_or(EnrError::SequenceNumberTooHigh)?;

// sign the record
self.sign(key)?;
Expand Down