add some stub tests

This commit is contained in:
Bryan Stitt 2023-06-29 12:41:21 -07:00
parent 294acbd712
commit ffc5a46dc4
4 changed files with 51 additions and 3 deletions

@ -58,7 +58,8 @@ impl TestApp {
let anvil_provider = Provider::<Http>::try_from(anvil.endpoint()).unwrap(); let anvil_provider = Provider::<Http>::try_from(anvil.endpoint()).unwrap();
// make a test TopConfig // make a test TopConfig
// TODO: load TopConfig from a file? CliConfig could have `cli_config.load_top_config`. would need to inject our endpoint ports // TODO: test influx
// TODO: test redis
let top_config = TopConfig { let top_config = TopConfig {
app: AppConfig { app: AppConfig {
chain_id: 31337, chain_id: 31337,
@ -76,7 +77,7 @@ impl TestApp {
..Default::default() ..Default::default()
}, },
balanced_rpcs: HashMap::from([( balanced_rpcs: HashMap::from([(
"anvil_both".to_string(), "anvil".to_string(),
Web3RpcConfig { Web3RpcConfig {
http_url: Some(anvil.endpoint()), http_url: Some(anvil.endpoint()),
ws_url: Some(anvil.ws_endpoint()), ws_url: Some(anvil.ws_endpoint()),

@ -0,0 +1,27 @@
mod common;
use crate::common::TestApp;
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_imitate_user() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_grant_credits() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_admin_change_user_tier() {
let x = TestApp::spawn().await;
todo!();
}

@ -7,7 +7,7 @@ use tokio::time::{sleep, Instant};
use web3_proxy::rpcs::blockchain::ArcBlock; use web3_proxy::rpcs::blockchain::ArcBlock;
#[test_log::test(tokio::test)] #[test_log::test(tokio::test)]
async fn it_works() { async fn it_starts_and_stops() {
let x = TestApp::spawn().await; let x = TestApp::spawn().await;
let anvil_provider = &x.anvil_provider; let anvil_provider = &x.anvil_provider;
@ -65,5 +65,6 @@ async fn it_works() {
assert_eq!(anvil_result, proxy_result.unwrap()); assert_eq!(anvil_result, proxy_result.unwrap());
// most tests won't need to wait, but we should wait here to be sure all the shutdown logic works properly
x.wait().await; x.wait().await;
} }

@ -0,0 +1,19 @@
mod common;
use crate::common::TestApp;
#[ignore]
#[test_log::test(tokio::test)]
async fn test_log_in_and_out() {
let x = TestApp::spawn().await;
todo!();
}
#[ignore]
#[test_log::test(tokio::test)]
async fn test_referral_bonus() {
let x = TestApp::spawn().await;
todo!();
}