Skip to content

Commit a3ca720

Browse files
authored
Update starknet-rs to 0.13; allow deprecated methods in integration tests (#689)
1 parent e2d8fe1 commit a3ca720

File tree

7 files changed

+91
-69
lines changed

7 files changed

+91
-69
lines changed

Cargo.lock

Lines changed: 63 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ enum-helper-macros = "0.0.1"
8080
starknet-types-core = "0.1.5"
8181
starknet_api = { version = "0.13.0-rc.0", features = ["testing"] }
8282
blockifier = { version = "0.8.0" }
83-
starknet-rs-signers = { version = "0.10.0", package = "starknet-signers" }
84-
starknet-rs-core = { version = "0.12.0", package = "starknet-core" }
85-
starknet-rs-providers = { version = "0.12.0", package = "starknet-providers" }
86-
starknet-rs-accounts = { version = "0.11.0", package = "starknet-accounts" }
87-
starknet-rs-contract = { version = "0.11.0", package = "starknet-contract" }
88-
starknet-rs-crypto = { version = "0.7.2", package = "starknet-crypto" }
83+
starknet-rs-signers = { version = "0.10.1", package = "starknet-signers" }
84+
starknet-rs-core = { version = "0.12.1", package = "starknet-core" }
85+
starknet-rs-providers = { version = "0.12.1", package = "starknet-providers" }
86+
starknet-rs-accounts = { version = "0.12.0", package = "starknet-accounts" }
87+
starknet-rs-contract = { version = "0.12.0", package = "starknet-contract" }
88+
starknet-rs-crypto = { version = "0.7.4", package = "starknet-crypto" }
8989
cairo-vm = "=1.0.1"
9090

9191
# Cairo-lang dependencies

crates/starknet-devnet-server/src/api/json_rpc/mod.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -774,15 +774,13 @@ mod requests_tests {
774774
// Errored json, hash is not prefixed with 0x
775775
assert_deserialization_fails(
776776
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'",
778783
);
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-
// );
786784
}
787785

788786
#[test]
@@ -803,7 +801,7 @@ mod requests_tests {
803801

804802
assert_deserialization_fails(
805803
json_str.replace("0x", "").as_str(),
806-
"Expected hex string to be prefixed by '0x'",
804+
"expected hex string to be prefixed by '0x'",
807805
);
808806
}
809807

@@ -814,7 +812,7 @@ mod requests_tests {
814812

815813
assert_deserialization_fails(
816814
json_str.replace("0x", "").as_str(),
817-
"Expected hex string to be prefixed by '0x'",
815+
"expected hex string to be prefixed by '0x'",
818816
);
819817
}
820818

@@ -883,11 +881,11 @@ mod requests_tests {
883881
r#""entry_point_selector":"134134""#,
884882
)
885883
.as_str(),
886-
"Expected hex string to be prefixed by '0x'",
884+
"expected hex string to be prefixed by '0x'",
887885
);
888886
assert_deserialization_fails(
889887
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'",
891889
);
892890
assert_deserialization_fails(
893891
json_str.replace(r#""calldata":["0x134134"]"#, r#""calldata":[123]"#).as_str(),
@@ -1319,8 +1317,7 @@ mod response_tests {
13191317
use crate::api::json_rpc::ToRpcResponseResult;
13201318

13211319
#[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() {
13241321
assert_eq!(
13251322
r#"{"result":{}}"#,
13261323
serde_json::to_string(

0 commit comments

Comments
 (0)