Slatepack OwnerAPI Changes (#421)

* change all user-facing instances of addresses to a SlatepackAddress

* finish renaming get_slatepack_address + documentation

* get_slatepack_secret_key OwnerRPC implementation and test

* add owner api functions

* OwnerRPC functions + doctests

* add explicit slatepack API tests to exercise encryption

* update api function names to better reflect RFC
This commit is contained in:
Yeastplume
2020-05-28 08:17:51 +01:00
committed by GitHub
parent 788d050bbe
commit db12712928
16 changed files with 682 additions and 130 deletions
+4 -6
View File
@@ -24,12 +24,11 @@ use crate::impls::{HttpSlateSender, PathToSlate, SlatePutter};
use crate::keychain;
use crate::libwallet::{
self, InitTxArgs, IssueInvoiceTxArgs, NodeClient, PaymentProof, Slate, SlateVersion,
WalletLCProvider,
SlatepackAddress, WalletLCProvider,
};
use crate::util::secp::key::SecretKey;
use crate::util::{Mutex, ZeroingString};
use crate::{controller, display};
use grin_wallet_util::OnionV3Address;
use serde_json as json;
use std::fs::File;
use std::io::{Read, Write};
@@ -272,7 +271,7 @@ pub struct SendArgs {
pub fluff: bool,
pub max_outputs: usize,
pub target_slate_version: Option<u16>,
pub payment_proof_address: Option<OnionV3Address>,
pub payment_proof_address: Option<SlatepackAddress>,
pub ttl_blocks: Option<u64>,
//TODO: Remove HF3
pub output_v4_slate: bool,
@@ -997,12 +996,11 @@ where
{
controller::owner_single_use(None, keychain_mask, Some(owner_api), |api, m| {
// Just address at derivation index 0 for now
let pub_key = api.get_public_proof_address(m, 0)?;
let addr = OnionV3Address::from_bytes(pub_key.to_bytes());
let address = api.get_slatepack_address(m, 0)?;
println!();
println!("Address for account - {}", g_args.account);
println!("-------------------------------------");
println!("{}", addr);
println!("{}", address);
println!();
Ok(())
})?;