Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update starknet-rs to 0.13; allow deprecated methods in integration tests #689

Merged
merged 4 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 63 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ enum-helper-macros = "0.0.1"
starknet-types-core = "0.1.5"
starknet_api = { version = "0.13.0-rc.0", features = ["testing"] }
blockifier = { version = "0.8.0" }
starknet-rs-signers = { version = "0.10.0", package = "starknet-signers" }
starknet-rs-core = { version = "0.12.0", package = "starknet-core" }
starknet-rs-providers = { version = "0.12.0", package = "starknet-providers" }
starknet-rs-accounts = { version = "0.11.0", package = "starknet-accounts" }
starknet-rs-contract = { version = "0.11.0", package = "starknet-contract" }
starknet-rs-crypto = { version = "0.7.2", package = "starknet-crypto" }
starknet-rs-signers = { version = "0.10.1", package = "starknet-signers" }
starknet-rs-core = { version = "0.12.1", package = "starknet-core" }
starknet-rs-providers = { version = "0.12.1", package = "starknet-providers" }
starknet-rs-accounts = { version = "0.12.0", package = "starknet-accounts" }
starknet-rs-contract = { version = "0.12.0", package = "starknet-contract" }
starknet-rs-crypto = { version = "0.7.4", package = "starknet-crypto" }
cairo-vm = "=1.0.1"

# Cairo-lang dependencies
Expand Down
25 changes: 11 additions & 14 deletions crates/starknet-devnet-server/src/api/json_rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,13 @@ mod requests_tests {
// Errored json, hash is not prefixed with 0x
assert_deserialization_fails(
r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"134134"}}"#,
"Expected hex string to be prefixed by '0x'",
"expected hex string to be prefixed by '0x'",
);
// Errored json, hex longer than 64 chars; misleading error message coming from dependency
assert_deserialization_fails(
r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"0x004134134134134134134134134134134134134134134134134134134134134134"}}"#,
"expected hex string to be prefixed by '0x'",
);
// TODO: ignored because of a Felt bug: https://github.com/starknet-io/types-rs/issues/81
// Errored json, hex is longer than 64 chars
// assert_deserialization_fails(
// r#"{"method":"starknet_getTransactionByHash","params":{"transaction_hash":"
// 0x004134134134134134134134134134134134134134134134134134134134134134"}}"#,
// "Bad input - expected #bytes: 32",
// );
}

#[test]
Expand All @@ -803,7 +801,7 @@ mod requests_tests {

assert_deserialization_fails(
json_str.replace("0x", "").as_str(),
"Expected hex string to be prefixed by '0x'",
"expected hex string to be prefixed by '0x'",
);
}

Expand All @@ -814,7 +812,7 @@ mod requests_tests {

assert_deserialization_fails(
json_str.replace("0x", "").as_str(),
"Expected hex string to be prefixed by '0x'",
"expected hex string to be prefixed by '0x'",
);
}

Expand Down Expand Up @@ -883,11 +881,11 @@ mod requests_tests {
r#""entry_point_selector":"134134""#,
)
.as_str(),
"Expected hex string to be prefixed by '0x'",
"expected hex string to be prefixed by '0x'",
);
assert_deserialization_fails(
json_str.replace(r#""calldata":["0x134134"]"#, r#""calldata":["123"]"#).as_str(),
"Expected hex string to be prefixed by '0x'",
"expected hex string to be prefixed by '0x'",
);
assert_deserialization_fails(
json_str.replace(r#""calldata":["0x134134"]"#, r#""calldata":[123]"#).as_str(),
Expand Down Expand Up @@ -1319,8 +1317,7 @@ mod response_tests {
use crate::api::json_rpc::ToRpcResponseResult;

#[test]
fn serializing_starknet_response_empty_variant_has_to_produce_empty_json_object_when_converted_to_rpc_result()
{
fn serializing_starknet_response_empty_variant_yields_empty_json_on_conversion_to_rpc_result() {
assert_eq!(
r#"{"result":{}}"#,
serde_json::to_string(
Expand Down
Loading