| 457 | |
| 458 | #[tokio::test(flavor = "multi_thread")] |
| 459 | async fn post_simulate_invalid_to() { |
| 460 | let filter = filter(config()); |
| 461 | |
| 462 | let json = serde_json::json!({ |
| 463 | "chainId": 1, |
| 464 | "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", |
| 465 | "to": "0x66fc62c1748e45435b06cf8dd105b73e9855f93", |
| 466 | "data": "0xffa2ca3b44eea7c8e659973cbdf476546e9e6adfd1c580700537e52ba7124933a97904ea000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001d0e30db00300ffffffffffffc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000186a0", |
| 467 | "gasLimit": 500000, |
| 468 | "value": "100000", |
| 469 | "blockNumber": 16784600 |
| 470 | }); |
| 471 | |
| 472 | let res = warp::test::request() |
| 473 | .method("POST") |
| 474 | .path("/simulate") |
| 475 | .json(&json) |
| 476 | .reply(&filter) |
| 477 | .await; |
| 478 | |
| 479 | assert_eq!(res.status(), 400); |
| 480 | |
| 481 | let body: ErrorMessage = serde_json::from_slice(res.body()).unwrap(); |
| 482 | |
| 483 | assert_eq!(body.message, "BAD REQUEST: invalid length 39, expected a (both 0x-prefixed or not) hex string or byte array containing 20 bytes at line 1 column 113".to_string()); |
| 484 | } |
| 485 | |
| 486 | #[tokio::test(flavor = "multi_thread")] |
| 487 | async fn post_simulate_invalid_data() { |