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

Function post_simulate_invalid_from

tests/api.rs:431–456  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

429
430#[tokio::test(flavor = "multi_thread")]
431async fn post_simulate_invalid_from() {
432 let filter = filter(config());
433
434 let json = serde_json::json!({
435 "chainId": 1,
436 "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA9604",
437 "to": "0x66fc62c1748e45435b06cf8dd105b73e9855f93e",
438 "data": "0xffa2ca3b44eea7c8e659973cbdf476546e9e6adfd1c580700537e52ba7124933a97904ea000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001d0e30db00300ffffffffffffc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000186a0",
439 "gasLimit": 500000,
440 "value": "100000",
441 "blockNumber": 16784600
442 });
443
444 let res = warp::test::request()
445 .method("POST")
446 .path("/simulate")
447 .json(&json)
448 .reply(&filter)
449 .await;
450
451 assert_eq!(res.status(), 400);
452
453 let body: ErrorMessage = serde_json::from_slice(res.body()).unwrap();
454
455 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 63".to_string());
456}
457
458#[tokio::test(flavor = "multi_thread")]
459async fn post_simulate_invalid_to() {

Callers

nothing calls this directly

Calls 2

filterFunction · 0.85
configFunction · 0.85

Tested by

no test coverage detected