aboutsummaryrefslogtreecommitdiff
path: root/src/account.rs
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2023-09-16 09:41:20 +0200
committerNicholas Rodrigues Lordello <[email protected]>2023-09-16 09:41:20 +0200
commit4f8d89bc35341f4b096a89f8c8850932276d7b71 (patch)
tree17307090a3faff764d8da0ea8be125363764d190 /src/account.rs
parentaf75d830238674a3d159e2422cb1a1018f7bc6b2 (diff)
Update dependencies
Diffstat (limited to 'src/account.rs')
-rw-r--r--src/account.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/account.rs b/src/account.rs
index e1da1ae..f862853 100644
--- a/src/account.rs
+++ b/src/account.rs
@@ -20,7 +20,7 @@ pub struct PrivateKey(SecretKey);
impl PrivateKey {
/// Creates a private key from a secret.
pub fn new(secret: impl AsRef<[u8]>) -> Result<Self> {
- let key = SecretKey::from_be_bytes(secret.as_ref())?;
+ let key = SecretKey::from_slice(secret.as_ref())?;
Ok(PrivateKey(key))
}
@@ -47,7 +47,7 @@ impl PrivateKey {
/// Returns the private key's 32 byte secret.
pub fn secret(&self) -> [u8; 32] {
- self.0.to_be_bytes().into()
+ self.0.to_bytes().into()
}
/// Generate a signature for the specified message.
@@ -59,7 +59,7 @@ impl PrivateKey {
pub fn try_sign(&self, message: [u8; 32]) -> Result<Signature> {
let (signature, recovery_id) = SigningKey::from(&self.0)
.as_nonzero_scalar()
- .try_sign_prehashed_rfc6979::<Sha256>(message.into(), b"")?;
+ .try_sign_prehashed_rfc6979::<Sha256>(&message.into(), b"")?;
Ok(Signature(signature, recovery_id.unwrap()))
}
}