Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Re-export multihash & multiaddr types #79

Merged
merged 4 commits into from
Apr 23, 2024
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
5 changes: 5 additions & 0 deletions src/crypto/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ impl SecretKey {
sk_bytes.zeroize();
Ok(SecretKey(secret))
}

/// Convert this secret key to a byte array.
pub fn to_bytes(&self) -> [u8; 32] {
self.0.to_bytes()
}
}

#[cfg(test)]
Expand Down
8 changes: 8 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

use rand::Rng;

// Re-export the types used in public interfaces.
pub mod multiaddr {
pub use multiaddr::{Error, Iter, Multiaddr, Onion3Addr, Protocol};
}
pub mod multihash {
pub use multihash::{Code, Error, Multihash, MultihashDigest};
}

pub mod protocol;

/// Substream ID.
Expand Down
Loading