Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slatepack - Pt 2 - Encryption #411

Merged
merged 5 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
538 changes: 453 additions & 85 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions api/src/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

use chrono::prelude::*;
use ed25519_dalek::PublicKey as DalekPublicKey;
use ed25519_dalek::SecretKey as DalekSecretKey;
use uuid::Uuid;

use crate::config::{TorConfig, WalletConfig};
Expand Down Expand Up @@ -1913,6 +1914,16 @@ where
owner::get_public_proof_address(self.wallet_inst.clone(), keychain_mask, derivation_index)
}

// TODO: Doc
/// get public proof a
pub fn get_secret_key(
&self,
keychain_mask: Option<&SecretKey>,
derivation_index: u32,
) -> Result<DalekSecretKey, Error> {
owner::get_secret_key(self.wallet_inst.clone(), keychain_mask, derivation_index)
}

/// Helper function to convert an Onion v3 address to a payment proof address (essentially
/// exctacting and verifying the public key)
///
Expand Down
3 changes: 3 additions & 0 deletions controller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ grin_wallet_api = { path = "../api", version = "4.0.0-alpha.1" }
grin_wallet_impls = { path = "../impls", version = "4.0.0-alpha.1" }
grin_wallet_libwallet = { path = "../libwallet", version = "4.0.0-alpha.1" }
grin_wallet_config = { path = "../config", version = "4.0.0-alpha.1" }

[dev-dependencies]
x25519-dalek = "0.6"
1 change: 0 additions & 1 deletion controller/tests/no_change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ fn no_change_test_impl(test_dir: &'static str) -> Result<(), libwallet::Error> {
api.tx_lock_outputs(m, &slate)?;
slate = api.finalize_tx(m, &slate)?;
println!("Posted Slate: {:?}", slate);
println!("Posted TX: {}", slate);
stored_excess = Some(slate.tx.as_ref().unwrap().body.kernels[0].excess);
api.post_tx(m, &slate, false)?;
Ok(())
Expand Down
Loading