Skip to content

Commit

Permalink
remove sanitize name tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Aug 23, 2023
1 parent a3e99e9 commit 04c8e9d
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions crates/json-abi/tests/abi_item_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,71 +138,3 @@ fn event_operation_with_tuple_array_input() {
assert_eq!(deserialized, AbiItem::Event(Cow::Owned(event)));
assert_ser_de!(AbiItem<'_>, deserialized);
}

// #[test]
// fn sanitize_function_name() {
// fn test_sanitize_function_name(name: &str, expected: &str) {
// let s = format!(
// r#"{{
// "type":"function",
// "inputs": [{{
// "name":"a",
// "type":"address"
// }}],
// "name":"{}",
// "outputs": []
// }}"#,
// name
// );

// let deserialized: AbiItem = serde_json::from_str(&s).unwrap();
// let function = match &deserialized {
// AbiItem::Function(f) => f,
// _ => panic!("expected function"),
// };

// assert_eq!(function.name, expected);

// assert_ser_de!(deserialized);
// }

// test_sanitize_function_name("foo", "foo");
// test_sanitize_function_name("foo()", "foo");
// test_sanitize_function_name("()", "");
// test_sanitize_function_name("", "");
// }

// #[test]
// fn sanitize_event_name() {
// fn test_sanitize_event_name(name: &str, expected: &str) {
// let s = format!(
// r#"{{
// "type":"event",
// "inputs": [{{
// "name":"a",
// "type":"address",
// "indexed":true
// }}],
// "name":"{}",
// "outputs": [],
// "anonymous": false
// }}"#,
// name
// );

// let deserialized: AbiItem = serde_json::from_str(&s).unwrap();
// let event = match deserialized {
// AbiItem::Event(e) => e,
// _ => panic!("expected event!"),
// };

// assert_eq!(event.name, expected);

// assert_ser_de!(AbiItem::Event(event.clone()));
// }

// test_sanitize_event_name("foo", "foo");
// test_sanitize_event_name("foo()", "foo");
// test_sanitize_event_name("()", "");
// test_sanitize_event_name("", "");
// }

0 comments on commit 04c8e9d

Please sign in to comment.