-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add cairo0 to integration test
- Loading branch information
1 parent
e26cb96
commit 636d8c4
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
use blockifier::test_utils::CairoVersion; | ||
use starknet_api::transaction::TransactionHash; | ||
use starknet_gateway::starknet_api_test_utils::invoke_tx; | ||
use starknet_mempool_integration_tests::integration_test_setup::IntegrationTestSetup; | ||
|
||
#[tokio::test] | ||
async fn test_end_to_end() { | ||
let mut mock_running_system = IntegrationTestSetup::new().await; | ||
|
||
let expected_tx_hash = | ||
mock_running_system.assert_add_tx_success(&invoke_tx(CairoVersion::Cairo1)).await; | ||
let mut expected_tx_hashs = Vec::new(); | ||
expected_tx_hashs | ||
.push(mock_running_system.assert_add_tx_success(&invoke_tx(CairoVersion::Cairo0)).await); | ||
expected_tx_hashs | ||
.push(mock_running_system.assert_add_tx_success(&invoke_tx(CairoVersion::Cairo1)).await); | ||
|
||
let mempool_txs = mock_running_system.get_txs(2).await; | ||
assert_eq!(mempool_txs.len(), 1); | ||
assert_eq!(mempool_txs[0].tx_hash, expected_tx_hash); | ||
let mempool_txs = mock_running_system.get_txs(3).await; | ||
|
||
assert_eq!(mempool_txs.len(), 2); | ||
let mut actual_tx_hashes: Vec<TransactionHash> = | ||
mempool_txs.iter().map(|tx| tx.tx_hash).collect(); | ||
actual_tx_hashes.sort(); | ||
expected_tx_hashs.sort(); | ||
assert_eq!(expected_tx_hashs, actual_tx_hashes); | ||
} |