mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-04 06:13:10 +00:00
Merge branch 'main' into Pravdyvy/private-definition-token
This commit is contained in:
commit
4fb6ba9530
@ -56,7 +56,7 @@ fn make_private_account_input_from_str(account_id: &str) -> String {
|
|||||||
pub async fn pre_test(
|
pub async fn pre_test(
|
||||||
home_dir: PathBuf,
|
home_dir: PathBuf,
|
||||||
) -> Result<(ServerHandle, JoinHandle<Result<()>>, TempDir)> {
|
) -> Result<(ServerHandle, JoinHandle<Result<()>>, TempDir)> {
|
||||||
wallet::execute_setup("test_pass".to_owned()).await?;
|
wallet::cli::execute_setup("test_pass".to_owned()).await?;
|
||||||
|
|
||||||
let home_dir_sequencer = home_dir.join("sequencer");
|
let home_dir_sequencer = home_dir.join("sequencer");
|
||||||
|
|
||||||
|
|||||||
@ -189,3 +189,12 @@ pub async fn execute_continuous_run() -> Result<()> {
|
|||||||
latest_block_num = seq_client.get_last_block().await?.last_block;
|
latest_block_num = seq_client.get_last_block().await?.last_block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn execute_setup(password: String) -> Result<()> {
|
||||||
|
let config = fetch_config().await?;
|
||||||
|
let wallet_core = WalletCore::start_from_config_new_storage(config.clone(), password).await?;
|
||||||
|
|
||||||
|
wallet_core.store_persistent_data().await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|||||||
@ -123,10 +123,6 @@ impl WalletSubcommand for PinataProgramSubcommandPublic {
|
|||||||
|
|
||||||
println!("Transaction data is {transfer_tx:?}");
|
println!("Transaction data is {transfer_tx:?}");
|
||||||
|
|
||||||
let path = wallet_core.store_persistent_data().await?;
|
|
||||||
|
|
||||||
println!("Stored persistent accounts at {path:#?}");
|
|
||||||
|
|
||||||
Ok(SubcommandReturnValue::Empty)
|
Ok(SubcommandReturnValue::Empty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,9 @@ use base64::{Engine, engine::general_purpose::STANDARD as BASE64};
|
|||||||
use common::{
|
use common::{
|
||||||
block::HashableBlockData, sequencer_client::SequencerClient, transaction::NSSATransaction,
|
block::HashableBlockData, sequencer_client::SequencerClient, transaction::NSSATransaction,
|
||||||
};
|
};
|
||||||
use key_protocol::{key_management::key_tree::traits::KeyNode, key_protocol_core::NSSAUserData};
|
use key_protocol::{
|
||||||
|
key_management::key_tree::traits::KeyNode as _, key_protocol_core::NSSAUserData,
|
||||||
|
};
|
||||||
use nssa::{Account, privacy_preserving_transaction::message::EncryptedAccountData};
|
use nssa::{Account, privacy_preserving_transaction::message::EncryptedAccountData};
|
||||||
use nssa_core::account::Nonce;
|
use nssa_core::account::Nonce;
|
||||||
use rand::{RngCore, rngs::OsRng};
|
use rand::{RngCore, rngs::OsRng};
|
||||||
|
|||||||
@ -19,8 +19,7 @@ use tokio::io::AsyncWriteExt;
|
|||||||
use crate::{
|
use crate::{
|
||||||
config::PersistentStorage,
|
config::PersistentStorage,
|
||||||
helperfunctions::{
|
helperfunctions::{
|
||||||
fetch_config, fetch_persistent_storage, get_home, produce_data_for_storage,
|
fetch_persistent_storage, get_home, produce_data_for_storage, produce_random_nonces,
|
||||||
produce_random_nonces,
|
|
||||||
},
|
},
|
||||||
poller::TxPoller,
|
poller::TxPoller,
|
||||||
};
|
};
|
||||||
@ -295,12 +294,3 @@ impl WalletCore {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn execute_setup(password: String) -> Result<()> {
|
|
||||||
let config = fetch_config().await?;
|
|
||||||
let wallet_core = WalletCore::start_from_config_new_storage(config.clone(), password).await?;
|
|
||||||
|
|
||||||
wallet_core.store_persistent_data().await?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,10 +1,7 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{CommandFactory as _, Parser as _};
|
use clap::{CommandFactory as _, Parser as _};
|
||||||
use tokio::runtime::Builder;
|
use tokio::runtime::Builder;
|
||||||
use wallet::{
|
use wallet::cli::{Args, OverCommand, execute_continuous_run, execute_setup, execute_subcommand};
|
||||||
cli::{Args, OverCommand, execute_continuous_run, execute_subcommand},
|
|
||||||
execute_setup,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const NUM_THREADS: usize = 2;
|
pub const NUM_THREADS: usize = 2;
|
||||||
|
|
||||||
@ -26,17 +23,16 @@ fn main() -> Result<()> {
|
|||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
runtime.block_on(async move {
|
runtime.block_on(async move {
|
||||||
if let Some(overcommand) = args.command {
|
if let Some(over_command) = args.command {
|
||||||
match overcommand {
|
match over_command {
|
||||||
OverCommand::Command(command) => {
|
OverCommand::Command(command) => {
|
||||||
// TODO: Do something with the output
|
|
||||||
let _output = execute_subcommand(command).await?;
|
let _output = execute_subcommand(command).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
OverCommand::Setup { password } => Ok(execute_setup(password).await?),
|
OverCommand::Setup { password } => execute_setup(password).await,
|
||||||
}
|
}
|
||||||
} else if args.continuous_run {
|
} else if args.continuous_run {
|
||||||
Ok(execute_continuous_run().await?)
|
execute_continuous_run().await
|
||||||
} else {
|
} else {
|
||||||
let help = Args::command().render_long_help();
|
let help = Args::command().render_long_help();
|
||||||
println!("{help}");
|
println!("{help}");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user