Skip to content

Commit

Permalink
Re-export multihash & multiaddr types (#79)
Browse files Browse the repository at this point in the history
This is a companion PR to
paritytech/polkadot-sdk#4198.
  • Loading branch information
dmitry-markin authored Apr 23, 2024
1 parent 6e11e7c commit 08112ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
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

0 comments on commit 08112ca

Please sign in to comment.