mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-10-17 15:21:39 +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:
@@ -8,7 +8,7 @@ repository = "https://github.com/mimblewimble/grin-wallet"
|
||||
keywords = [ "crypto", "grin", "mimblewimble" ]
|
||||
exclude = ["**/*.grin", "**/*.grin2"]
|
||||
#build = "src/build/build.rs"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
blake2-rfc = "0.2"
|
||||
|
||||
@@ -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