-
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 deploy_account to integration test (#302)
- Loading branch information
1 parent
e78af98
commit 9456a55
Showing
8 changed files
with
101 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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,24 +1,24 @@ | ||
use blockifier::test_utils::CairoVersion; | ||
use starknet_api::transaction::TransactionHash; | ||
use starknet_gateway::starknet_api_test_utils::invoke_tx; | ||
use starknet_gateway::starknet_api_test_utils::{deploy_account_tx, 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(1).await; | ||
|
||
let mut expected_tx_hashs = Vec::new(); | ||
expected_tx_hashs | ||
let mut expected_tx_hashes = Vec::new(); | ||
expected_tx_hashes | ||
.push(mock_running_system.assert_add_tx_success(&invoke_tx(CairoVersion::Cairo0)).await); | ||
expected_tx_hashs | ||
expected_tx_hashes | ||
.push(mock_running_system.assert_add_tx_success(&invoke_tx(CairoVersion::Cairo1)).await); | ||
expected_tx_hashes.push(mock_running_system.assert_add_tx_success(&deploy_account_tx()).await); | ||
|
||
let mempool_txs = mock_running_system.get_txs(3).await; | ||
|
||
assert_eq!(mempool_txs.len(), 2); | ||
let mempool_txs = mock_running_system.get_txs(4).await; | ||
assert_eq!(mempool_txs.len(), 3); | ||
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); | ||
expected_tx_hashes.sort(); | ||
assert_eq!(expected_tx_hashes, actual_tx_hashes); | ||
} |