From 603959a26fd91402e59ed0e25fb112baf22ed27f Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 18 Apr 2024 21:50:45 +0800 Subject: [PATCH] wip --- crates/katana/primitives/src/genesis/builder.rs | 7 ++----- crates/katana/primitives/src/genesis/mod.rs | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/katana/primitives/src/genesis/builder.rs b/crates/katana/primitives/src/genesis/builder.rs index 2fac00fc88..17091a7d31 100644 --- a/crates/katana/primitives/src/genesis/builder.rs +++ b/crates/katana/primitives/src/genesis/builder.rs @@ -141,7 +141,6 @@ impl Builder { self.classes.entry(hash).or_insert(class); } - // TODO(kariy): update fee token balance in the genesis for (address, alloc) in &mut self.allocations { let class_hash = alloc.class_hash().ok_or(GenesisBuilderError::MissingClassHash)?; if !self.classes.contains_key(&class_hash) { @@ -195,8 +194,6 @@ impl From for Builder { #[cfg(test)] mod tests { - use crate::genesis::allocation::GenesisAccount; - use super::*; #[test] @@ -208,7 +205,7 @@ mod tests { .timestamp(0) .sequencer_address(ContractAddress::default()) .gas_prices(GasPrices::default()) - // .fee_token(FeeTokenConfig::default()) + .fee_token(FeeTokenConfig::default()) .add_classes([]) .add_accounts([]) .add_contracts([]) @@ -221,7 +218,7 @@ mod tests { assert_eq!(genesis.timestamp, 0); assert_eq!(genesis.sequencer_address, ContractAddress::default()); assert_eq!(genesis.gas_prices, GasPrices::default()); - // assert_eq!(genesis.fee_token, FeeTokenConfig::default()); + assert_eq!(genesis.fee_token, FeeTokenConfig::default()); assert_eq!(genesis.classes, HashMap::new()); assert_eq!(genesis.allocations, BTreeMap::new()); } diff --git a/crates/katana/primitives/src/genesis/mod.rs b/crates/katana/primitives/src/genesis/mod.rs index e0d9a853f0..903e2e8775 100644 --- a/crates/katana/primitives/src/genesis/mod.rs +++ b/crates/katana/primitives/src/genesis/mod.rs @@ -34,7 +34,7 @@ use crate::version::CURRENT_STARKNET_VERSION; use crate::FieldElement; #[serde_with::serde_as] -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] pub struct FeeTokenConfig { /// The name of the fee token. pub name: String,