web3-proxy/web3_proxy/tests/common/get_admin_deposits.rs
Bryan Stitt 512bcf305b lint
2023-07-07 14:06:35 -07:00

31 lines
972 B
Rust

use crate::TestApp;
use tracing::info;
use web3_proxy::frontend::users::authentication::LoginPostResponse;
/// Helper function to increase the balance of a user, from an admin
#[allow(unused)]
pub async fn get_admin_deposits(
x: &TestApp,
r: &reqwest::Client,
user: &LoginPostResponse,
) -> serde_json::Value {
let increase_balance_post_url = format!("{}user/deposits/admin", x.proxy_provider.url());
info!("Get admin increase deposits");
// Login the user
// Use the bearer token of admin to increase user balance
let admin_balance_deposits = r
.get(increase_balance_post_url)
.bearer_auth(user.bearer_token)
.send()
.await
.unwrap();
info!(?admin_balance_deposits, "http response");
let admin_balance_deposits = admin_balance_deposits
.json::<serde_json::Value>()
.await
.unwrap();
info!(?admin_balance_deposits, "json response");
admin_balance_deposits
}