diff --git a/Cargo.lock b/Cargo.lock index 6ec6bfbf05..4770da572d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,7 +275,7 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.55", ] [[package]] @@ -377,7 +377,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.55", "syn-solidity", "tiny-keccak", ] @@ -394,7 +394,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.49", + "syn 2.0.55", "syn-solidity", ] @@ -8423,27 +8423,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.55", -] - [[package]] name = "num_threads" version = "0.1.7" @@ -12032,7 +12011,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.55", ] [[package]] diff --git a/crates/katana/primitives/src/utils/transaction.rs b/crates/katana/primitives/src/utils/transaction.rs index a95e7d26da..d2dc99d26a 100644 --- a/crates/katana/primitives/src/utils/transaction.rs +++ b/crates/katana/primitives/src/utils/transaction.rs @@ -308,40 +308,6 @@ fn encode_da_mode( FieldElement::from(nonce + fee) } -fn encode_gas_bound(name: &[u8], bound: &ResourceBounds) -> FieldElement { - let mut buffer = [0u8; 32]; - let (remainder, max_price) = buffer.split_at_mut(128 / 8); - let (gas_kind, max_amount) = remainder.split_at_mut(64 / 8); - - let padding = gas_kind.len() - name.len(); - gas_kind[padding..].copy_from_slice(name); - max_amount.copy_from_slice(&bound.max_amount.to_be_bytes()); - max_price.copy_from_slice(&bound.max_price_per_unit.to_be_bytes()); - - FieldElement::from_bytes_be(&buffer).expect("Packed resource should fit into felt") -} - -fn hash_fee_fields( - tip: u64, - l1_gas_bounds: &ResourceBounds, - l2_gas_bounds: &ResourceBounds, -) -> FieldElement { - poseidon_hash_many(&[ - tip.into(), - encode_gas_bound(b"L1_GAS", l1_gas_bounds), - encode_gas_bound(b"L2_GAS", l2_gas_bounds), - ]) -} - -fn encode_da_mode( - nonce_da_mode: &DataAvailabilityMode, - fee_da_mode: &DataAvailabilityMode, -) -> FieldElement { - let nonce = (*nonce_da_mode as u64) << 32; - let fee = *fee_da_mode as u64; - FieldElement::from(nonce + fee) -} - #[cfg(test)] mod tests { use starknet::core::chain_id;