Skip to content

Commit

Permalink
Apply m_of_n_feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Jun 27, 2024
1 parent cdd2b5e commit 596ed47
Show file tree
Hide file tree
Showing 26 changed files with 1,724 additions and 62 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 24 additions & 2 deletions applications/minotari_app_utilities/src/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ use tari_common::exit_codes::{ExitCode, ExitError};
use tari_common_types::{
emoji::EmojiId,
tari_address::TariAddress,
types::{BlockHash, PublicKey},
types::{BlockHash, PrivateKey, PublicKey, Signature},
};
use tari_comms::{peer_manager::NodeId, types::CommsPublicKey};
use tari_utilities::hex::Hex;
use tari_utilities::hex::{Hex, HexError};
use thiserror::Error;
use tokio::{runtime, runtime::Runtime};

Expand Down Expand Up @@ -140,6 +140,28 @@ impl TryFrom<UniNodeId> for PublicKey {
}
}

#[derive(Debug, Clone)]
pub struct UniSignature(Signature);

impl FromStr for UniSignature {
type Err = HexError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let data = s.split(',').collect::<Vec<_>>();
let signature = PrivateKey::from_hex(data[0])?;
let public_nonce = PublicKey::from_hex(data[1])?;

let signature = Signature::new(public_nonce, signature);
Ok(Self(signature))
}
}

impl From<UniSignature> for Signature {
fn from(id: UniSignature) -> Self {
id.0
}
}

impl From<UniNodeId> for NodeId {
fn from(id: UniNodeId) -> Self {
match id {
Expand Down
1 change: 0 additions & 1 deletion applications/minotari_console_wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ serde = "1.0.136"
serde_json = "1.0.79"
sha2 = "0.10"
strum = "0.22"
strum_macros = "0.22"
thiserror = "1.0.26"
tonic = "0.8.3"
unicode-segmentation = "1.6.0"
Expand Down
Loading

0 comments on commit 596ed47

Please sign in to comment.