Skip to content

Commit f68f242

Browse files
committed
Merge remote-tracking branch 'upstream/main' into max_request_size
2 parents ebfae9a + c51d065 commit f68f242

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed

tests/api.rs

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -371,37 +371,31 @@ async fn post_simulate_no_data() {
371371

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

0 commit comments

Comments
 (0)