MCPcopy Create free account
hub / github.com/EnsoBuild/temper / post_simulate_incorrect_chain_id

Function post_simulate_incorrect_chain_id

tests/api.rs:374–401  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373#[tokio::test(flavor = "multi_thread")]
374async fn post_simulate_incorrect_chain_id() {
375 temp_env::async_with_vars([("FORK_URL", Some("https://eth.llamarpc.com"))], async {
376 let filter = filter(config());
377
378 let json = serde_json::json!({
379 "chainId": 137,
380 "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
381 "to": "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5",
382 "gasLimit": 21000,
383 "value": "100000",
384 "blockNumber": 16784600
385 });
386
387 let res = warp::test::request()
388 .method("POST")
389 .path("/simulate")
390 .json(&json)
391 .reply(&filter)
392 .await;
393
394 assert_eq!(res.status(), 400);
395
396 let body: ErrorMessage = serde_json::from_slice(res.body()).unwrap();
397
398 assert_eq!(body.message, "INCORRECT_CHAIN_ID".to_string());
399 })
400 .await;
401}
402
403#[tokio::test(flavor = "multi_thread")]
404async fn post_simulate_not_enough_gas() {

Callers

nothing calls this directly

Calls 2

filterFunction · 0.85
configFunction · 0.85

Tested by

no test coverage detected