Skip to content
Draft
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ members = [
"crates/storage/codecs",
"crates/storage/codecs/derive",
"crates/storage/db",
"crates/storage/db-versioned-derive",
"crates/storage/fork",
"crates/storage/provider/provider",
"crates/storage/provider/provider-api",
Expand Down
6 changes: 3 additions & 3 deletions crates/executor/src/implementation/blockifier/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ fn to_api_resource_bounds(resource_bounds: fee::ResourceBoundsMapping) -> ValidR
}

fee::ResourceBoundsMapping::L1Gas(bounds) => ValidResourceBounds::L1Gas(ResourceBounds {
max_amount: bounds.max_amount.into(),
max_price_per_unit: bounds.max_price_per_unit.into(),
max_amount: bounds.l1_gas.max_amount.into(),
max_price_per_unit: bounds.l1_gas.max_price_per_unit.into(),
}),
}
}
Expand Down Expand Up @@ -723,7 +723,7 @@ pub fn is_zero_resource_bounds(resource_bounds: &ResourceBoundsMapping) -> bool
}

ResourceBoundsMapping::L1Gas(bounds) => {
(bounds.max_amount as u128 * bounds.max_price_per_unit) == 0
(bounds.l1_gas.max_amount as u128 * bounds.l1_gas.max_price_per_unit) == 0
}
}
}
Expand Down
24 changes: 17 additions & 7 deletions crates/feeder-gateway/src/types/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use katana_primitives::class::{ClassHash, CompiledClassHash};
use katana_primitives::contract::Nonce;
use katana_primitives::fee::{AllResourceBoundsMapping, Tip};
use katana_primitives::fee::Tip;
use katana_primitives::transaction::{
DeclareTx as PrimitiveDeclareTx, DeclareTxV0 as PrimitiveDeclareTxV0,
DeclareTxV1 as PrimitiveDeclareTxV1, DeclareTxV2 as PrimitiveDeclareTxV2,
Expand Down Expand Up @@ -389,25 +389,35 @@ impl From<DataAvailabilityMode> for katana_primitives::da::DataAvailabilityMode

impl From<ResourceBoundsMapping> for katana_primitives::fee::ResourceBoundsMapping {
fn from(bounds: ResourceBoundsMapping) -> Self {
use katana_primitives::fee::{
AllResourceBoundsMapping, L1GasResourceBoundsMapping, ResourceBounds,
};

if let Some(l1_data_gas) = bounds.l1_data_gas {
Self::All(AllResourceBoundsMapping {
l1_gas: katana_primitives::fee::ResourceBounds {
l1_gas: ResourceBounds {
max_amount: bounds.l1_gas.max_amount,
max_price_per_unit: bounds.l1_gas.max_price_per_unit,
},
l2_gas: katana_primitives::fee::ResourceBounds {
l2_gas: ResourceBounds {
max_amount: bounds.l2_gas.max_amount,
max_price_per_unit: bounds.l2_gas.max_price_per_unit,
},
l1_data_gas: katana_primitives::fee::ResourceBounds {
l1_data_gas: ResourceBounds {
max_amount: l1_data_gas.max_amount,
max_price_per_unit: l1_data_gas.max_price_per_unit,
},
})
} else {
Self::L1Gas(katana_primitives::fee::ResourceBounds {
max_amount: bounds.l1_gas.max_amount,
max_price_per_unit: bounds.l1_gas.max_price_per_unit,
Self::L1Gas(L1GasResourceBoundsMapping {
l1_gas: ResourceBounds {
max_amount: bounds.l1_gas.max_amount,
max_price_per_unit: bounds.l1_gas.max_price_per_unit,
},
l2_gas: ResourceBounds {
max_amount: bounds.l2_gas.max_amount,
max_price_per_unit: bounds.l2_gas.max_price_per_unit,
},
})
}
}
Expand Down
Loading