prettier output in create_user
This commit is contained in:
parent
c57c2249c0
commit
3597fb24ef
23
Cargo.lock
generated
23
Cargo.lock
generated
@ -1884,28 +1884,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fstrings"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7845a0f15da505ac36baad0486612dab57f8b8d34e19c5470a265bbcdd572ae6"
|
||||
dependencies = [
|
||||
"fstrings-proc-macro",
|
||||
"proc-macro-hack",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fstrings-proc-macro"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63b58c0e7581dc33478a32299182cbe5ae3b8c028be26728a47fb0a113c92d9d"
|
||||
dependencies = [
|
||||
"proc-macro-hack",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuchsia-zircon"
|
||||
version = "0.3.3"
|
||||
@ -5282,7 +5260,6 @@ dependencies = [
|
||||
"fdlimit",
|
||||
"fifomap",
|
||||
"flume",
|
||||
"fstrings",
|
||||
"futures",
|
||||
"handlebars",
|
||||
"hashbrown",
|
||||
|
@ -29,7 +29,6 @@ ethers = { version = "0.17.0", features = ["rustls", "ws"] }
|
||||
fdlimit = "0.2.1"
|
||||
flume = "0.10.14"
|
||||
futures = { version = "0.3.21", features = ["thread-pool"] }
|
||||
fstrings = "0.2.3"
|
||||
hashbrown = { version = "0.12.3", features = ["serde"] }
|
||||
indexmap = "1.9.1"
|
||||
fifomap = { path = "../fifomap" }
|
||||
|
@ -2,8 +2,8 @@ use anyhow::Context;
|
||||
use argh::FromArgs;
|
||||
use entities::{user, user_keys};
|
||||
use ethers::types::Address;
|
||||
use fstrings::{format_args_f, println_f};
|
||||
use sea_orm::ActiveModelTrait;
|
||||
use tracing::info;
|
||||
use web3_proxy::users::new_api_key;
|
||||
|
||||
#[derive(FromArgs, PartialEq, Debug)]
|
||||
@ -37,7 +37,7 @@ impl CreateUserSubCommand {
|
||||
|
||||
let u = u.insert(db).await.context("Failed saving new user")?;
|
||||
|
||||
println_f!("user: {u:?}");
|
||||
info!("user #{}: {:?}", u.id, Address::from_slice(&u.address));
|
||||
|
||||
// create a key for the new user
|
||||
let uk = user_keys::ActiveModel {
|
||||
@ -49,7 +49,7 @@ impl CreateUserSubCommand {
|
||||
|
||||
let uk = uk.insert(db).await.context("Failed saving new user key")?;
|
||||
|
||||
println_f!("user key: {uk:?}");
|
||||
info!("user key: {}", uk.api_key);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ mod create_user;
|
||||
mod two;
|
||||
|
||||
use argh::FromArgs;
|
||||
use tracing::info;
|
||||
use web3_proxy::app::get_migrated_db;
|
||||
|
||||
#[derive(Debug, FromArgs)]
|
||||
@ -49,8 +48,6 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
let cli_config: TopConfig = argh::from_env();
|
||||
|
||||
info!("hello, {}", cli_config.db_url);
|
||||
|
||||
match cli_config.sub_command {
|
||||
SubCommand::CreateUser(x) => {
|
||||
let db = get_migrated_db(cli_config.db_url, 1).await?;
|
||||
|
Loading…
Reference in New Issue
Block a user