mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-05 23:03:06 +00:00
remove resetting program owner in wallet privacy commands
This commit is contained in:
parent
e69fb8b1b8
commit
d54ea96bba
@ -2,6 +2,7 @@ use std::collections::HashMap;
|
||||
|
||||
use anyhow::Result;
|
||||
use key_protocol::key_protocol_core::NSSAUserData;
|
||||
use nssa::program::Program;
|
||||
|
||||
use crate::config::{InitialAccountData, PersistentAccountData, WalletConfig};
|
||||
|
||||
@ -21,8 +22,12 @@ impl WalletChainStore {
|
||||
public_init_acc_map.insert(data.address.parse()?, data.pub_sign_key);
|
||||
}
|
||||
InitialAccountData::Private(data) => {
|
||||
private_init_acc_map
|
||||
.insert(data.address.parse()?, (data.key_chain, data.account));
|
||||
let mut account = data.account;
|
||||
// TODO: Program owner is only known after code is compiled and can't be set in
|
||||
// the config. Therefore we overwrite it here on startup. Fix this when program
|
||||
// id can be fetched from the node and queried from the wallet.
|
||||
account.program_owner = Program::authenticated_transfer_program().id();
|
||||
private_init_acc_map.insert(data.address.parse()?, (data.key_chain, account));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,9 +431,13 @@ pub async fn execute_subcommand(command: Command) -> Result<SubcommandReturnValu
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let res_acc_to =
|
||||
nssa_core::EncryptionScheme::decrypt(&to_ebc.ciphertext, &secret_to, &to_comm, 1)
|
||||
.unwrap();
|
||||
let res_acc_to = nssa_core::EncryptionScheme::decrypt(
|
||||
&to_ebc.ciphertext,
|
||||
&secret_to,
|
||||
&to_comm,
|
||||
1,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
println!("Received new from acc {res_acc_from:#?}");
|
||||
println!("Received new to acc {res_acc_to:#?}");
|
||||
@ -498,9 +502,13 @@ pub async fn execute_subcommand(command: Command) -> Result<SubcommandReturnValu
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let res_acc_to =
|
||||
nssa_core::EncryptionScheme::decrypt(&to_ebc.ciphertext, &secret_to, &to_comm, 1)
|
||||
.unwrap();
|
||||
let res_acc_to = nssa_core::EncryptionScheme::decrypt(
|
||||
&to_ebc.ciphertext,
|
||||
&secret_to,
|
||||
&to_comm,
|
||||
1,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
println!("RES acc {res_acc_from:#?}");
|
||||
println!("RES acc to {res_acc_to:#?}");
|
||||
@ -712,7 +720,10 @@ pub async fn execute_subcommand(command: Command) -> Result<SubcommandReturnValu
|
||||
|
||||
println!("Generated new account with addr {addr}");
|
||||
println!("With npk {}", hex::encode(&key.nullifer_public_key));
|
||||
println!("With ipk {}", hex::encode(&key.incoming_viewing_public_key.to_bytes()));
|
||||
println!(
|
||||
"With ipk {}",
|
||||
hex::encode(&key.incoming_viewing_public_key.to_bytes())
|
||||
);
|
||||
|
||||
let path = wallet_core.store_persistent_accounts()?;
|
||||
|
||||
|
||||
@ -29,8 +29,6 @@ impl WalletCore {
|
||||
let npk_from = from_keys.nullifer_public_key;
|
||||
let ipk_from = from_keys.incoming_viewing_public_key;
|
||||
|
||||
from_acc.program_owner = program.id();
|
||||
|
||||
let sender_commitment = nssa_core::Commitment::new(&npk_from, &from_acc);
|
||||
|
||||
let sender_pre =
|
||||
|
||||
@ -26,8 +26,6 @@ impl WalletCore {
|
||||
let from_npk = from_keys.nullifer_public_key;
|
||||
let from_ipk = from_keys.incoming_viewing_public_key;
|
||||
|
||||
from_acc.program_owner = program.id();
|
||||
|
||||
let sender_commitment = nssa_core::Commitment::new(&from_npk, &from_acc);
|
||||
|
||||
let sender_pre =
|
||||
@ -128,9 +126,6 @@ impl WalletCore {
|
||||
if from_acc.balance >= balance_to_move {
|
||||
let program = nssa::program::Program::authenticated_transfer_program();
|
||||
|
||||
from_acc.program_owner = program.id();
|
||||
to_acc.program_owner = program.id();
|
||||
|
||||
let sender_commitment = nssa_core::Commitment::new(&from_npk, &from_acc);
|
||||
let receiver_commitment = nssa_core::Commitment::new(&to_npk, &to_acc);
|
||||
|
||||
|
||||
@ -28,8 +28,6 @@ impl WalletCore {
|
||||
if from_acc.balance >= balance_to_move {
|
||||
let program = nssa::program::Program::authenticated_transfer_program();
|
||||
|
||||
to_acc.program_owner = program.id();
|
||||
|
||||
let receiver_commitment =
|
||||
nssa_core::Commitment::new(&to_keys.nullifer_public_key, &to_acc);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user