Parcourir la source

refactor: rename create-token to send

thesimplekid il y a 10 mois
Parent
commit
4244053330

+ 5 - 5
crates/cdk-cli/src/main.rs

@@ -34,7 +34,7 @@ struct Cli {
 }
 
 const DEFAULT_REDB_DB_PATH: &str = "./cashu_tool.redb";
-const DEFAULT_SQLITE_DB_PATH: &str = "./cashu_tool.redb";
+const DEFAULT_SQLITE_DB_PATH: &str = "./cashu_tool.sqlite";
 
 #[derive(Subcommand)]
 enum Commands {
@@ -44,8 +44,8 @@ enum Commands {
     Melt(sub_commands::melt::MeltSubCommand),
     /// Receive token
     Receive(sub_commands::receive::ReceiveSubCommand),
-    /// Create token from wallet balance
-    CreateToken(sub_commands::create_token::CreateTokenSubCommand),
+    /// Send
+    Send(sub_commands::send::SendSubCommand),
     /// Check if wallet balance is spendable
     CheckSpendable,
     /// View mint info
@@ -100,8 +100,8 @@ async fn main() -> Result<()> {
         Commands::Receive(sub_command_args) => {
             sub_commands::receive::receive(wallet, sub_command_args).await
         }
-        Commands::CreateToken(sub_command_args) => {
-            sub_commands::create_token::create_token(wallet, sub_command_args).await
+        Commands::Send(sub_command_args) => {
+            sub_commands::send::send(wallet, sub_command_args).await
         }
         Commands::CheckSpendable => sub_commands::check_spent::check_spent(wallet).await,
         Commands::MintInfo(sub_command_args) => {

+ 1 - 1
crates/cdk-cli/src/sub_commands/mod.rs

@@ -1,8 +1,8 @@
 pub mod check_spent;
-pub mod create_token;
 pub mod decode_token;
 pub mod melt;
 pub mod mint;
 pub mod mint_info;
 pub mod receive;
 pub mod restore;
+pub mod send;

+ 2 - 2
crates/cdk-cli/src/sub_commands/create_token.rs → crates/cdk-cli/src/sub_commands/send.rs

@@ -12,7 +12,7 @@ use cdk::Amount;
 use clap::Args;
 
 #[derive(Args)]
-pub struct CreateTokenSubCommand {
+pub struct SendSubCommand {
     /// Token Memo
     #[arg(short, long)]
     memo: Option<String>,
@@ -33,7 +33,7 @@ pub struct CreateTokenSubCommand {
     refund_keys: Vec<String>,
 }
 
-pub async fn create_token(wallet: Wallet, sub_command_args: &CreateTokenSubCommand) -> Result<()> {
+pub async fn send(wallet: Wallet, sub_command_args: &SendSubCommand) -> Result<()> {
     let mints_amounts: Vec<(UncheckedUrl, HashMap<_, _>)> =
         wallet.mint_balances().await?.into_iter().collect();