mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-24 02:18:32 +02:00
Update rust edition to 2021 (#749)
* build: update rust edition 2021 * cargo: format all * build: fix tests and warnings
This commit is contained in:
@@ -117,11 +117,13 @@ impl Writeable for DalekPublicKey {
|
||||
}
|
||||
|
||||
/// Encapsulates an ed25519_dalek::Signature and provides (de-)serialization
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct DalekSignature(Signature);
|
||||
|
||||
impl DalekSignature {
|
||||
/// Convert hex string to DalekSignature.
|
||||
#[allow(dead_code)]
|
||||
pub fn from_hex(hex: &str) -> Result<Self, DalekError> {
|
||||
let bytes = grin_util::from_hex(hex)
|
||||
.map_err(|_| DalekError::HexError(format!("failed to decode {}", hex)))?;
|
||||
@@ -131,6 +133,7 @@ impl DalekSignature {
|
||||
}
|
||||
|
||||
/// Verifies DalekSignature
|
||||
#[allow(dead_code)]
|
||||
pub fn verify(&self, pk: &DalekPublicKey, msg: &[u8]) -> Result<(), DalekError> {
|
||||
pk.as_ref()
|
||||
.verify(&msg, &self.0)
|
||||
|
||||
Reference in New Issue
Block a user