Skip to content

Commit

Permalink
feat(blockifier): count aliases in state resources for fee
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavGrs committed Nov 10, 2024
1 parent 500780f commit 3e1cc92
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/blockifier/src/fee/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl StarknetResources {
#[cfg_attr(feature = "transaction_serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StateResources {
/// The state changes takes into account the allocated aliases.
state_changes_for_fee: StateChangesCount,
pub n_allocated_aliases: usize,
}
Expand All @@ -153,11 +154,10 @@ impl StateResources {
fee_token_address: ContractAddress,
n_allocated_aliases: usize,
) -> Self {
Self {
state_changes_for_fee: state_changes
.count_for_fee_charge(sender_address, fee_token_address),
n_allocated_aliases,
}
let mut state_changes_for_fee =
state_changes.count_for_fee_charge(sender_address, fee_token_address);
state_changes_for_fee.n_storage_updates += n_allocated_aliases;
Self { state_changes_for_fee, n_allocated_aliases }
}

#[cfg(any(test, feature = "testing"))]
Expand Down

0 comments on commit 3e1cc92

Please sign in to comment.