Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed Jun 24, 2024
1 parent d5275cb commit d66f38a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions crates/client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ where
.contract_class_by_class_hash(best_block_hash, class_hash)
.is_some()
{
error!("Contract class with class hash {:?} already exists", class_hash);
return Err(StarknetRpcApiError::ClassAlreadyDeclared.into());
return Err(StarknetRpcApiError::ClassAlreadyDeclared);
}

let extrinsic = self.convert_tx_to_extrinsic(best_block_hash, AccountTransaction::Declare(transaction))?;
Expand Down
1 change: 0 additions & 1 deletion crates/pallets/starknet/src/tests/invoke_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ fn given_hardcoded_contract_run_invoke_tx_then_it_works() {

assert_eq!(pending_hashes[0], tx_hash);
let events: Vec<StarknetEvent> = Starknet::tx_events(tx_hash);
println!("evens: {events:?}");

assert!(events.into_iter().any(|e| e
== StarknetEvent {
Expand Down
3 changes: 2 additions & 1 deletion starknet-rpc-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ starknet-providers = { workspace = true }
starknet-signers = { workspace = true }
starknet-test-utils = { workspace = true }
thiserror = { workspace = true }
futures = { workspace = true, features = ["executor"] }
tokio = { version = "1.36.0", features = ["rt", "macros", "parking_lot"] }
url = "2.4.1"

Expand Down Expand Up @@ -137,4 +138,4 @@ path = "trace_transaction.rs"

[[test]]
name = "madara_add_declare_transaction_v0"
path = "declareV0.rs"
path = "add_declare_transaction_v0.rs"
4 changes: 1 addition & 3 deletions starknet-rpc-test/add_declare_transaction.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extern crate starknet_rpc_test;

use core::panic;
use std::time::Duration;
use std::vec;

use assert_matches::assert_matches;
Expand All @@ -18,7 +17,6 @@ use starknet_rpc_test::utils::{
use starknet_rpc_test::{SendTransactionError, Transaction, TransactionResult};
use starknet_test_utils::constants::ETH_FEE_TOKEN_ADDRESS;
use starknet_test_utils::utils::get_transaction_receipt;
use tokio::time::sleep;

#[rstest]
#[tokio::test]
Expand All @@ -42,7 +40,7 @@ async fn fail_validation_step(madara: &ThreadSafeMadaraClient) -> Result<(), any
let declare_tx_err = txs[0].as_ref().unwrap_err();
match declare_tx_err {
SendTransactionError::AccountError(starknet_accounts::AccountError::Provider(provider_error)) => {
assert!(is_good_error_code(provider_error, 55));
assert!(is_good_error_code(&provider_error, 55));
}

_ => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use starknet_test_utils::utils::get_transaction_receipt;

#[rstest]
#[tokio::test]
#[ignore]
async fn add_declare_transaction_v0_works(madara: &ThreadSafeMadaraClient) {
let rpc = madara.get_starknet_client().await;

Expand Down Expand Up @@ -42,6 +43,7 @@ async fn add_declare_transaction_v0_works(madara: &ThreadSafeMadaraClient) {

let block_number = {
let mut madara_write_lock = madara.write().await;
madara_write_lock.create_empty_block().await.unwrap();
// Wasn't declared before
assert!(rpc.get_class(BlockId::Tag(BlockTag::Latest), class_hash).await.is_err());
madara_write_lock.call_rpc(json_body).await.unwrap();
Expand Down
1 change: 1 addition & 0 deletions starknet-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ starknet-signers = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
url = { workspace = true }
futures = { workspace = true }

0 comments on commit d66f38a

Please sign in to comment.