diff --git a/unit_tests/tests/test_get_block_transaction_count.rs b/unit_tests/tests/test_get_block_transaction_count.rs index 611e47e..f7fb52d 100644 --- a/unit_tests/tests/test_get_block_transaction_count.rs +++ b/unit_tests/tests/test_get_block_transaction_count.rs @@ -162,14 +162,13 @@ async fn work_with_block_100_000_hash(clients: HashMap, pathfinder: JsonRpcClient) { let arc_deoxys = Arc::new(deoxys); let arc_pathfinder = Arc::new(pathfinder); let parallels_queries = 10; let mut diff = false; - for block_group in (0..=100_000).step_by(parallels_queries) { + for block_group in (0..=100).step_by(parallels_queries) { let mut set = tokio::task::JoinSet::new(); for offset in 0..parallels_queries { let block_id = (block_group + offset) as u64; diff --git a/unit_tests/tests/test_get_block_with_tx_hashes.rs b/unit_tests/tests/test_get_block_with_tx_hashes.rs index b05b207..ecef338 100644 --- a/unit_tests/tests/test_get_block_with_tx_hashes.rs +++ b/unit_tests/tests/test_get_block_with_tx_hashes.rs @@ -183,14 +183,13 @@ async fn work_with_block_1500( #[rstest] #[tokio::test] -#[ignore = "ignore this test"] async fn work_loop(deoxys: JsonRpcClient, pathfinder: JsonRpcClient) { let arc_deoxys = Arc::new(deoxys); let arc_pathfinder = Arc::new(pathfinder); let parallels_queries = 10; let mut diff = false; - for block_group in (0..=100_000).step_by(parallels_queries) { + for block_group in (0..=100).step_by(parallels_queries) { let mut set = tokio::task::JoinSet::new(); for offset in 0..parallels_queries { let block_id = (block_group + offset) as u64; diff --git a/unit_tests/tests/test_get_class.rs b/unit_tests/tests/test_get_class.rs index e7d3169..97090d6 100644 --- a/unit_tests/tests/test_get_class.rs +++ b/unit_tests/tests/test_get_class.rs @@ -21,19 +21,19 @@ async fn fail_non_existing_block(clients: HashMap) { .await; assert!( - response_deoxys.is_ok(), + response_deoxys.is_err(), "Expected an error, but got a result" ); if let Err(error) = response_deoxys { let is_correct_error = checking_error_format( &error, - StarknetError::InvalidTransactionHash, + StarknetError::BlockNotFound, ); assert!( is_correct_error, - "Expected InvalidTransactionHash error, but got a different error" + "Expected BlockNotFound error, but got a different error" ); } } @@ -103,7 +103,7 @@ async fn fail_max_fee_too_big(deoxys: JsonRpcClient) { ) .expect("REASON"), ], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) @@ -156,7 +156,7 @@ async fn fail_max_fee_too_low(deoxys: JsonRpcClient) { ) .expect("REASON"), ], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) @@ -209,7 +209,7 @@ async fn fail_if_one_txn_cannot_be_executed(deoxys: JsonRpcClient ) .expect("REASON"), ], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) @@ -266,7 +266,7 @@ async fn fail_if_one_txn_cannot_be_executed(deoxys: JsonRpcClient .await; assert!( - response_deoxys.is_ok(), + response_deoxys.is_err(), "Expected an error, but got a result" ); @@ -287,6 +287,7 @@ async fn fail_if_one_txn_cannot_be_executed(deoxys: JsonRpcClient } } +#[ignore = "need to submit valid fields"] #[rstest] #[tokio::test] async fn works_ok_on_no_validate( @@ -294,7 +295,7 @@ async fn works_ok_on_no_validate( pathfinder: JsonRpcClient, ) { let tx = BroadcastedTransaction::Invoke(BroadcastedInvokeTransaction { - max_fee: FieldElement::from_hex_be("0xffffffffffff").unwrap(), + max_fee: FieldElement::from_hex_be("0x00").unwrap(), signature: vec![ FieldElement::from_hex_be( "0x5687164368262e1885f904c31bfe55362d91b9a5195d220d5d59aa3c8286349", @@ -305,7 +306,7 @@ async fn works_ok_on_no_validate( ) .expect("REASON"), ], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) @@ -349,6 +350,7 @@ async fn works_ok_on_no_validate( assert_eq!(deoxys_simulations, pathfinder_simulations); } +#[ignore = "need to submit valid fields"] #[rstest] #[tokio::test] async fn works_ok_on_validate_without_signature_with_skip_validate( @@ -358,7 +360,7 @@ async fn works_ok_on_validate_without_signature_with_skip_validate( let tx = BroadcastedTransaction::Invoke(BroadcastedInvokeTransaction { max_fee: FieldElement::from_hex_be("0xffffffffffff").unwrap(), signature: vec![], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) @@ -400,6 +402,7 @@ async fn works_ok_on_validate_without_signature_with_skip_validate( assert_eq!(deoxys_simulations, pathfinder_simulations); } +#[ignore = "need to submit valid fields"] #[rstest] #[tokio::test] async fn works_ok_without_max_fee_with_skip_fee_charge( @@ -407,7 +410,7 @@ async fn works_ok_without_max_fee_with_skip_fee_charge( pathfinder: JsonRpcClient, ) { let tx = BroadcastedTransaction::Invoke(BroadcastedInvokeTransaction { - max_fee: FieldElement::from_hex_be("0x00").unwrap(), + max_fee: FieldElement::from_hex_be("0x0ffffffff").unwrap(), signature: vec![ FieldElement::from_hex_be( "0x5687164368262e1885f904c31bfe55362d91b9a5195d220d5d59aa3c8286349", @@ -418,7 +421,7 @@ async fn works_ok_without_max_fee_with_skip_fee_charge( ) .expect("REASON"), ], - nonce: FieldElement::from_hex_be("0x20").unwrap(), + nonce: FieldElement::from_hex_be("0x22").unwrap(), sender_address: FieldElement::from_hex_be( "0x019f57133d6a46990231a58a8f45be87405b4494161bf9ac7b25bd14de6e4d40", ) diff --git a/unit_tests/tests/test_trace_block_transactions.rs b/unit_tests/tests/test_trace_block_transactions.rs index cccf2b6..3ef0f7e 100644 --- a/unit_tests/tests/test_trace_block_transactions.rs +++ b/unit_tests/tests/test_trace_block_transactions.rs @@ -20,7 +20,7 @@ async fn fail_non_existing_block(deoxys: JsonRpcClient) { .await; assert!( - response_deoxys.is_ok(), + response_deoxys.is_err(), "Expected an error, but got a result" ); @@ -72,13 +72,12 @@ async fn works_ok_for_random_block( pathfinder: JsonRpcClient, ) { let mut rng = rand::thread_rng(); - let random_block_number = rng.gen_range(100000..602000); + let random_block_number = rng.gen_range(100000..650000); let block_number = BlockId::Number(random_block_number); let deoxys_trace = deoxys.trace_block_transactions(block_number).await; let _pathfinder_trace = pathfinder.trace_block_transactions(block_number).await; - println!("{:?}", deoxys_trace); println!("block choose is: {:?}", block_number); assert_matches!(deoxys_trace, _pathfinder_trace);