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

refactor: rename invoke generator #456

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
10 changes: 5 additions & 5 deletions crates/mempool_test_utils/src/starknet_api_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub fn invoke_tx(cairo_version: CairoVersion) -> RPCTransaction {

MultiAccountTransactionGenerator::new_for_account_contracts([default_account])
.account_with_id(0)
.generate_default()
.generate_default_invoke()
}

// TODO: when moving this to Starknet API crate, move this const into a module alongside
Expand All @@ -136,9 +136,9 @@ type AccountId = u16;
/// use mempool_test_utils::starknet_api_test_utils::MultiAccountTransactionGenerator;
///
/// let mut tx_generator = MultiAccountTransactionGenerator::new(2); // Initialize with 2 accounts.
/// let account_0_tx_with_nonce_0 = tx_generator.account_with_id(0).generate_default();
/// let account_1_tx_with_nonce_0 = tx_generator.account_with_id(1).generate_default();
/// let account_0_tx_with_nonce_1 = tx_generator.account_with_id(0).generate_default();
/// let account_0_tx_with_nonce_0 = tx_generator.account_with_id(0).generate_default_invoke();
/// let account_1_tx_with_nonce_0 = tx_generator.account_with_id(1).generate_default_invoke();
/// let account_0_tx_with_nonce_1 = tx_generator.account_with_id(0).generate_default_invoke();
/// ```
// Note: when moving this to starknet api crate, see if blockifier's
// [blockifier::transaction::test_utils::FaultyAccountTxCreatorArgs] can be made to use this.
Expand Down Expand Up @@ -183,7 +183,7 @@ pub struct AccountTransactionGenerator<'a> {

impl<'a> AccountTransactionGenerator<'a> {
/// Generate a valid `RPCTransaction` with default parameters.
pub fn generate_default(&mut self) -> RPCTransaction {
pub fn generate_default_invoke(&mut self) -> RPCTransaction {
let invoke_args = invoke_tx_args!(
sender_address: self.sender_address(),
resource_bounds: executable_resource_bounds_mapping(),
Expand Down
Loading