@@ -774,15 +774,13 @@ mod requests_tests {
774
774
// Errored json, hash is not prefixed with 0x
775
775
assert_deserialization_fails (
776
776
r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"134134"}}"# ,
777
- "Expected hex string to be prefixed by '0x'" ,
777
+ "expected hex string to be prefixed by '0x'" ,
778
+ ) ;
779
+ // Errored json, hex longer than 64 chars; misleading error message coming from dependency
780
+ assert_deserialization_fails (
781
+ r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"0x004134134134134134134134134134134134134134134134134134134134134134"}}"# ,
782
+ "expected hex string to be prefixed by '0x'" ,
778
783
) ;
779
- // TODO: ignored because of a Felt bug: https://github.com/starknet-io/types-rs/issues/81
780
- // Errored json, hex is longer than 64 chars
781
- // assert_deserialization_fails(
782
- // r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"
783
- // 0x004134134134134134134134134134134134134134134134134134134134134134"}}"#,
784
- // "Bad input - expected #bytes: 32",
785
- // );
786
784
}
787
785
788
786
#[ test]
@@ -803,7 +801,7 @@ mod requests_tests {
803
801
804
802
assert_deserialization_fails (
805
803
json_str. replace ( "0x" , "" ) . as_str ( ) ,
806
- "Expected hex string to be prefixed by '0x'" ,
804
+ "expected hex string to be prefixed by '0x'" ,
807
805
) ;
808
806
}
809
807
@@ -814,7 +812,7 @@ mod requests_tests {
814
812
815
813
assert_deserialization_fails (
816
814
json_str. replace ( "0x" , "" ) . as_str ( ) ,
817
- "Expected hex string to be prefixed by '0x'" ,
815
+ "expected hex string to be prefixed by '0x'" ,
818
816
) ;
819
817
}
820
818
@@ -883,11 +881,11 @@ mod requests_tests {
883
881
r#""entry_point_selector":"134134""# ,
884
882
)
885
883
. as_str ( ) ,
886
- "Expected hex string to be prefixed by '0x'" ,
884
+ "expected hex string to be prefixed by '0x'" ,
887
885
) ;
888
886
assert_deserialization_fails (
889
887
json_str. replace ( r#""calldata":["0x134134"]"# , r#""calldata":["123"]"# ) . as_str ( ) ,
890
- "Expected hex string to be prefixed by '0x'" ,
888
+ "expected hex string to be prefixed by '0x'" ,
891
889
) ;
892
890
assert_deserialization_fails (
893
891
json_str. replace ( r#""calldata":["0x134134"]"# , r#""calldata":[123]"# ) . as_str ( ) ,
@@ -1319,8 +1317,7 @@ mod response_tests {
1319
1317
use crate :: api:: json_rpc:: ToRpcResponseResult ;
1320
1318
1321
1319
#[ test]
1322
- fn serializing_starknet_response_empty_variant_has_to_produce_empty_json_object_when_converted_to_rpc_result ( )
1323
- {
1320
+ fn serializing_starknet_response_empty_variant_yields_empty_json_on_conversion_to_rpc_result ( ) {
1324
1321
assert_eq ! (
1325
1322
r#"{"result":{}}"# ,
1326
1323
serde_json:: to_string(
0 commit comments