-
Notifications
You must be signed in to change notification settings - Fork 191
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(katana): remove fee tokens & udc declaration from genesis #2541
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,15 @@ | |
ApiKind, RpcConfig, DEFAULT_RPC_ADDR, DEFAULT_RPC_MAX_CONNECTIONS, DEFAULT_RPC_PORT, | ||
}; | ||
use katana_node::config::{Config, SequencingConfig}; | ||
use katana_primitives::block::GasPrices; | ||
use katana_primitives::chain::ChainId; | ||
use katana_primitives::chain_spec::ChainSpec; | ||
use katana_primitives::chain_spec::{self, ChainSpec}; | ||
use katana_primitives::class::ClassHash; | ||
use katana_primitives::contract::ContractAddress; | ||
use katana_primitives::genesis::allocation::{DevAllocationsGenerator, GenesisAccountAlloc}; | ||
use katana_primitives::genesis::constant::DEFAULT_PREFUNDED_ACCOUNT_BALANCE; | ||
use katana_primitives::genesis::constant::{ | ||
DEFAULT_LEGACY_ERC20_CLASS_HASH, DEFAULT_LEGACY_UDC_CLASS_HASH, | ||
DEFAULT_PREFUNDED_ACCOUNT_BALANCE, DEFAULT_UDC_ADDRESS, | ||
}; | ||
use katana_primitives::genesis::Genesis; | ||
use tracing::{info, Subscriber}; | ||
use tracing_log::LogTracer; | ||
|
@@ -150,7 +152,7 @@ | |
|
||
#[arg(long = "accounts")] | ||
#[arg(value_name = "NUM")] | ||
#[arg(default_value = "10")] | ||
#[arg(default_value_t = 10)] | ||
#[arg(help = "Number of pre-funded accounts to generate.")] | ||
pub total_accounts: u16, | ||
|
||
|
@@ -179,9 +181,8 @@ | |
#[arg(long_help = "The chain ID. If a raw hex string (`0x` prefix) is provided, then it'd \ | ||
used as the actual chain ID. Otherwise, it's represented as the raw \ | ||
ASCII values. It must be a valid Cairo short string.")] | ||
#[arg(default_value = "KATANA")] | ||
#[arg(value_parser = ChainId::parse)] | ||
pub chain_id: ChainId, | ||
pub chain_id: Option<ChainId>, | ||
|
||
#[arg(long)] | ||
#[arg(help = "The maximum number of steps available for the account validation logic.")] | ||
|
@@ -232,8 +233,7 @@ | |
let node = katana_node::build(config).await.context("failed to build node")?; | ||
|
||
if !self.silent { | ||
let genesis = &node.backend.chain_spec.genesis; | ||
print_intro(&self, genesis); | ||
print_intro(&self, &node.backend.chain_spec); | ||
} | ||
|
||
// Launch the node | ||
|
@@ -309,36 +309,33 @@ | |
} | ||
|
||
fn chain_spec(&self) -> Result<ChainSpec> { | ||
let genesis = match self.starknet.genesis.clone() { | ||
Some(genesis) => genesis, | ||
None => { | ||
let gas_prices = GasPrices { | ||
eth: self.starknet.environment.l1_eth_gas_price, | ||
strk: self.starknet.environment.l1_strk_gas_price, | ||
}; | ||
|
||
let accounts = DevAllocationsGenerator::new(self.starknet.total_accounts) | ||
.with_seed(parse_seed(&self.starknet.seed)) | ||
.with_balance(U256::from(DEFAULT_PREFUNDED_ACCOUNT_BALANCE)) | ||
.generate(); | ||
|
||
let mut genesis = Genesis { | ||
gas_prices, | ||
sequencer_address: *DEFAULT_SEQUENCER_ADDRESS, | ||
..Default::default() | ||
}; | ||
|
||
#[cfg(feature = "slot")] | ||
if self.slot.controller { | ||
katana_slot_controller::add_controller_account(&mut genesis)?; | ||
} | ||
|
||
genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into()))); | ||
genesis | ||
} | ||
}; | ||
let mut chain_spec = chain_spec::DEV_UNALLOCATED.clone(); | ||
|
||
if let Some(id) = self.starknet.environment.chain_id { | ||
chain_spec.id = id; | ||
} | ||
|
||
if let Some(genesis) = self.starknet.genesis.clone() { | ||
chain_spec.genesis = genesis; | ||
} | ||
|
||
// generate dev accounts | ||
let accounts = DevAllocationsGenerator::new(self.starknet.total_accounts) | ||
.with_seed(parse_seed(&self.starknet.seed)) | ||
.with_balance(U256::from(DEFAULT_PREFUNDED_ACCOUNT_BALANCE)) | ||
.generate(); | ||
|
||
chain_spec.genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into()))); | ||
chain_spec.genesis.sequencer_address = *DEFAULT_SEQUENCER_ADDRESS; | ||
chain_spec.genesis.gas_prices.eth = self.starknet.environment.l1_eth_gas_price; | ||
chain_spec.genesis.gas_prices.strk = self.starknet.environment.l1_strk_gas_price; | ||
Comment on lines
+329
to
+331
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Ohayo, sensei! It looks like the 🔗 Analysis chainVerify gas prices and sequencer address settings Ohayo, sensei! Setting Use this script to find all assignments and usages: Ohayo, sensei! It looks like there was a syntax error in the previous script. Let's run the corrected script to properly verify the gas prices and sequencer address settings. Ohayo, sensei! Let's gather more information to ensure that gas prices and sequencer address settings respect user-provided configurations. Ohayo, sensei! It looks like the previous script had a little hiccup. Let's try a simplified version to properly locate the initialization of Ohayo, sensei! The last script ran into a bit of trouble. Let's try a different approach to locate the assignments to 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check assignments to `sequencer_address` and `gas_prices`
rg --type rust 'chain_spec\.genesis\.(sequencer_address|gas_prices)' -A 3
Length of output: 7569 Script: #!/bin/bash
# Description: Check assignments to `sequencer_address` and `gas_prices`
rg --type rust 'chain_spec\.genesis\.(sequencer_address|gas_prices)' -A 3
Length of output: 1012 Script: #!/bin/bash
# Description: Find initialization of `chain_spec.genesis` to check for user configuration handling
ast-grep --lang rust 'chain_spec\.genesis\s*=' --pattern '
fn $_($_) {
$_
}
'
Length of output: 154 Script: #!/bin/bash
# Description: Find all assignments to `chain_spec.genesis` to verify user configuration handling
ast-grep --lang rust 'chain_spec\.genesis' --pattern '
assign $_ = $_
'
Length of output: 144 Script: #!/bin/bash
# Description: Find all assignments to `chain_spec.genesis` to verify user configuration handling
rg --type rust 'chain_spec\.genesis\.(sequencer_address|gas_prices)\s*=' -A 3
Length of output: 441 |
||
|
||
#[cfg(feature = "slot")] | ||
if self.slot.controller { | ||
katana_slot_controller::add_controller_account(&mut chain_spec.genesis)?; | ||
} | ||
|
||
Ok(ChainSpec { id: self.starknet.environment.chain_id, genesis }) | ||
Ok(chain_spec) | ||
} | ||
|
||
fn dev_config(&self) -> DevConfig { | ||
|
@@ -368,8 +365,8 @@ | |
} | ||
} | ||
|
||
fn print_intro(args: &NodeArgs, genesis: &Genesis) { | ||
let mut accounts = genesis.accounts().peekable(); | ||
fn print_intro(args: &NodeArgs, chain: &ChainSpec) { | ||
let mut accounts = chain.genesis.accounts().peekable(); | ||
let account_class_hash = accounts.peek().map(|e| e.1.class_hash()); | ||
let seed = &args.starknet.seed; | ||
|
||
|
@@ -399,7 +396,7 @@ | |
) | ||
); | ||
|
||
print_genesis_contracts(genesis, account_class_hash); | ||
print_genesis_contracts(chain, account_class_hash); | ||
print_genesis_accounts(accounts); | ||
|
||
println!( | ||
|
@@ -413,33 +410,38 @@ | |
} | ||
} | ||
|
||
fn print_genesis_contracts(genesis: &Genesis, account_class_hash: Option<ClassHash>) { | ||
fn print_genesis_contracts(chain: &ChainSpec, account_class_hash: Option<ClassHash>) { | ||
println!( | ||
r" | ||
PREDEPLOYED CONTRACTS | ||
================== | ||
|
||
| Contract | Fee Token | ||
| Address | {} | ||
| Class Hash | {:#064x}", | ||
genesis.fee_token.address, genesis.fee_token.class_hash, | ||
PREDEPLOYED CONTRACTS | ||
================== | ||
|
||
| Contract | ETH Fee Token | ||
| Address | {} | ||
| Class Hash | {}, | ||
|
||
| Contract | STRK Fee Token | ||
| Address | {} | ||
| Class Hash | {}", | ||
chain.fee_contracts.eth, | ||
DEFAULT_LEGACY_ERC20_CLASS_HASH, | ||
chain.fee_contracts.strk, | ||
DEFAULT_LEGACY_ERC20_CLASS_HASH | ||
); | ||
|
||
if let Some(ref udc) = genesis.universal_deployer { | ||
println!( | ||
r" | ||
| Contract | Universal Deployer | ||
| Address | {} | ||
| Class Hash | {:#064x}", | ||
udc.address, udc.class_hash | ||
) | ||
} | ||
println!( | ||
r" | ||
| Contract | Universal Deployer | ||
| Address | {} | ||
| Class Hash | {}", | ||
DEFAULT_UDC_ADDRESS, DEFAULT_LEGACY_UDC_CLASS_HASH | ||
); | ||
|
||
if let Some(hash) = account_class_hash { | ||
println!( | ||
r" | ||
| Contract | Account Contract | ||
| Class Hash | {hash:#064x}" | ||
| Contract | Account Contract | ||
| Class Hash | {hash:#064x}" | ||
) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||||||||||||
use anyhow::{anyhow, Result}; | ||||||||||||||||
use katana_db::mdbx::DbEnv; | ||||||||||||||||
use katana_primitives::block::{BlockHash, FinalityStatus, SealedBlockWithStatus}; | ||||||||||||||||
use katana_primitives::genesis::Genesis; | ||||||||||||||||
use katana_primitives::chain_spec::ChainSpec; | ||||||||||||||||
use katana_primitives::state::StateUpdatesWithDeclaredClasses; | ||||||||||||||||
use katana_provider::providers::db::DbProvider; | ||||||||||||||||
use katana_provider::traits::block::{BlockProvider, BlockWriter}; | ||||||||||||||||
|
@@ -68,13 +68,13 @@ impl Blockchain { | |||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
/// Creates a new [Blockchain] with the given [Database] implementation and genesis state. | ||||||||||||||||
pub fn new_with_genesis(provider: impl Database, genesis: &Genesis) -> Result<Self> { | ||||||||||||||||
pub fn new_with_genesis(provider: impl Database, chain: &ChainSpec) -> Result<Self> { | ||||||||||||||||
// check whether the genesis block has been initialized | ||||||||||||||||
let genesis_hash = provider.block_hash_by_num(genesis.number)?; | ||||||||||||||||
let genesis_hash = provider.block_hash_by_num(chain.genesis.number)?; | ||||||||||||||||
|
||||||||||||||||
match genesis_hash { | ||||||||||||||||
Some(db_hash) => { | ||||||||||||||||
let genesis_hash = genesis.block().header.compute_hash(); | ||||||||||||||||
let genesis_hash = chain.block().header.compute_hash(); | ||||||||||||||||
// check genesis should be the same | ||||||||||||||||
if db_hash == genesis_hash { | ||||||||||||||||
Ok(Self::new(provider)) | ||||||||||||||||
|
@@ -86,29 +86,29 @@ impl Blockchain { | |||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
None => { | ||||||||||||||||
let block = genesis.block().seal(); | ||||||||||||||||
let block = chain.block().seal(); | ||||||||||||||||
let block = SealedBlockWithStatus { block, status: FinalityStatus::AcceptedOnL1 }; | ||||||||||||||||
let state_updates = genesis.state_updates(); | ||||||||||||||||
let state_updates = chain.state_updates(); | ||||||||||||||||
|
||||||||||||||||
Self::new_with_block_and_state(provider, block, state_updates) | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
/// Creates a new [Blockchain] from a database at `path` and `genesis` state. | ||||||||||||||||
pub fn new_with_db(db: DbEnv, genesis: &Genesis) -> Result<Self> { | ||||||||||||||||
Self::new_with_genesis(DbProvider::new(db), genesis) | ||||||||||||||||
pub fn new_with_db(db: DbEnv, chain: &ChainSpec) -> Result<Self> { | ||||||||||||||||
Self::new_with_genesis(DbProvider::new(db), chain) | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
/// Builds a new blockchain with a forked block. | ||||||||||||||||
pub fn new_from_forked( | ||||||||||||||||
provider: impl Database, | ||||||||||||||||
genesis_hash: BlockHash, | ||||||||||||||||
genesis: &Genesis, | ||||||||||||||||
chain: &ChainSpec, | ||||||||||||||||
block_status: FinalityStatus, | ||||||||||||||||
) -> Result<Self> { | ||||||||||||||||
let block = genesis.block().seal_with_hash_and_status(genesis_hash, block_status); | ||||||||||||||||
let state_updates = genesis.state_updates(); | ||||||||||||||||
let block = chain.block().seal_with_hash_and_status(genesis_hash, block_status); | ||||||||||||||||
let state_updates = chain.state_updates(); | ||||||||||||||||
Comment on lines
+107
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Ohayo, sensei! It appears the 🔗 Analysis chainVerify updates to Ohayo, sensei! The Find usages with: Ohayo, sensei! Let's get those usages of Ohayo, sensei! Let's ensure the Ohayo, sensei! Let's make sure the 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Find all usages of `new_from_forked` and ensure correct parameters.
# Test: Search for method calls to `new_from_forked`.
rg --type rust 'new_from_forked\('
Length of output: 136 Script: #!/bin/bash
# Description: Find all usages of `new_from_forked` and ensure correct parameters.
# Test: Search for method calls to `new_from_forked`.
rg --type rust 'new_from_forked\('
Length of output: 286 Script: #!/bin/bash
# Description: Verify the `new_from_forked` method signature uses `&ChainSpec` instead of `&Genesis`.
ast-grep --lang rust --pattern 'fn new_from_forked($_: &ChainSpec, $_) { $$$ }' crates/katana/core/src/backend/storage.rs
Length of output: 123 Script: #!/bin/bash
# Description: Verify the `new_from_forked` method signature uses `&ChainSpec` instead of `&Genesis`.
# Test: Search for the method definition of `new_from_forked` with `&ChainSpec` as a parameter.
rg --type rust 'fn new_from_forked\s*\([^)]*&ChainSpec[^)]*\)' crates/katana/core/src/backend/storage.rs
Length of output: 106 |
||||||||||||||||
Self::new_with_block_and_state(provider, block, state_updates) | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
|
@@ -139,15 +139,15 @@ mod tests { | |||||||||||||||
}; | ||||||||||||||||
use katana_primitives::fee::TxFeeInfo; | ||||||||||||||||
use katana_primitives::genesis::constant::{ | ||||||||||||||||
DEFAULT_FEE_TOKEN_ADDRESS, DEFAULT_LEGACY_ERC20_CASM, DEFAULT_LEGACY_ERC20_CLASS_HASH, | ||||||||||||||||
DEFAULT_ETH_FEE_TOKEN_ADDRESS, DEFAULT_LEGACY_ERC20_CASM, DEFAULT_LEGACY_ERC20_CLASS_HASH, | ||||||||||||||||
DEFAULT_LEGACY_UDC_CASM, DEFAULT_LEGACY_UDC_CLASS_HASH, DEFAULT_UDC_ADDRESS, | ||||||||||||||||
}; | ||||||||||||||||
use katana_primitives::genesis::Genesis; | ||||||||||||||||
use katana_primitives::receipt::{InvokeTxReceipt, Receipt}; | ||||||||||||||||
use katana_primitives::state::StateUpdatesWithDeclaredClasses; | ||||||||||||||||
use katana_primitives::trace::TxExecInfo; | ||||||||||||||||
use katana_primitives::transaction::{InvokeTx, Tx, TxWithHash}; | ||||||||||||||||
use katana_primitives::Felt; | ||||||||||||||||
use katana_primitives::{chain_spec, Felt}; | ||||||||||||||||
use katana_provider::providers::in_memory::InMemoryProvider; | ||||||||||||||||
use katana_provider::traits::block::{ | ||||||||||||||||
BlockHashProvider, BlockNumberProvider, BlockProvider, BlockStatusProvider, BlockWriter, | ||||||||||||||||
|
@@ -164,13 +164,13 @@ mod tests { | |||||||||||||||
fn blockchain_from_genesis_states() { | ||||||||||||||||
let provider = InMemoryProvider::new(); | ||||||||||||||||
|
||||||||||||||||
let blockchain = Blockchain::new_with_genesis(provider, &Genesis::default()) | ||||||||||||||||
let blockchain = Blockchain::new_with_genesis(provider, &chain_spec::DEV) | ||||||||||||||||
.expect("failed to create blockchain from genesis block"); | ||||||||||||||||
let state = blockchain.provider().latest().expect("failed to get latest state"); | ||||||||||||||||
|
||||||||||||||||
let latest_number = blockchain.provider().latest_number().unwrap(); | ||||||||||||||||
let fee_token_class_hash = | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_ETH_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
let udc_class_hash = state.class_hash_of_contract(DEFAULT_UDC_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
assert_eq!(latest_number, 0); | ||||||||||||||||
|
@@ -191,12 +191,15 @@ mod tests { | |||||||||||||||
..Default::default() | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
let mut chain = chain_spec::DEV.clone(); | ||||||||||||||||
chain.genesis = genesis; | ||||||||||||||||
|
||||||||||||||||
Comment on lines
+194
to
+196
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Sensei, consider constructing In the test, you're cloning Example: let chain = ChainSpec {
genesis,
// ... other fields as needed
..chain_spec::DEV.clone()
};
Comment on lines
+194
to
+196
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid modifying a cloned Ohayo, sensei! Modifying the You can refactor the code as follows: -let mut chain = chain_spec::DEV.clone();
-chain.genesis = genesis;
+let chain = ChainSpec {
+ genesis,
+ ..chain_spec::DEV.clone()
+}; 📝 Committable suggestion
Suggested change
|
||||||||||||||||
let genesis_hash = felt!("1111"); | ||||||||||||||||
|
||||||||||||||||
let blockchain = Blockchain::new_from_forked( | ||||||||||||||||
provider, | ||||||||||||||||
genesis_hash, | ||||||||||||||||
&genesis, | ||||||||||||||||
&chain, | ||||||||||||||||
FinalityStatus::AcceptedOnL1, | ||||||||||||||||
) | ||||||||||||||||
.expect("failed to create fork blockchain"); | ||||||||||||||||
|
@@ -207,15 +210,15 @@ mod tests { | |||||||||||||||
let block_status = | ||||||||||||||||
blockchain.provider().block_status(latest_number.into()).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
assert_eq!(latest_number, genesis.number); | ||||||||||||||||
assert_eq!(latest_number, chain.genesis.number); | ||||||||||||||||
assert_eq!(latest_hash, genesis_hash); | ||||||||||||||||
|
||||||||||||||||
assert_eq!(header.gas_prices.eth, 9090); | ||||||||||||||||
assert_eq!(header.gas_prices.strk, 8080); | ||||||||||||||||
assert_eq!(header.timestamp, 6868); | ||||||||||||||||
assert_eq!(header.number, latest_number); | ||||||||||||||||
assert_eq!(header.state_root, genesis.state_root); | ||||||||||||||||
assert_eq!(header.parent_hash, genesis.parent_hash); | ||||||||||||||||
assert_eq!(header.state_root, chain.genesis.state_root); | ||||||||||||||||
assert_eq!(header.parent_hash, chain.genesis.parent_hash); | ||||||||||||||||
assert_eq!(block_status, FinalityStatus::AcceptedOnL1); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
|
@@ -243,11 +246,9 @@ mod tests { | |||||||||||||||
.seal(), | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
let genesis = Genesis::default(); | ||||||||||||||||
|
||||||||||||||||
{ | ||||||||||||||||
let db = katana_db::init_db(&db_path).expect("Failed to init database"); | ||||||||||||||||
let blockchain = Blockchain::new_with_db(db, &genesis) | ||||||||||||||||
let blockchain = Blockchain::new_with_db(db, &chain_spec::DEV) | ||||||||||||||||
.expect("Failed to create db-backed blockchain storage"); | ||||||||||||||||
|
||||||||||||||||
blockchain | ||||||||||||||||
|
@@ -280,7 +281,7 @@ mod tests { | |||||||||||||||
let actual_udc_class = state.class(actual_udc_class_hash).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
let actual_fee_token_class_hash = | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_ETH_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
let actual_fee_token_class = state.class(actual_fee_token_class_hash).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
assert_eq!(actual_udc_class_hash, DEFAULT_LEGACY_UDC_CLASS_HASH); | ||||||||||||||||
|
@@ -294,7 +295,7 @@ mod tests { | |||||||||||||||
|
||||||||||||||||
{ | ||||||||||||||||
let db = katana_db::init_db(db_path).expect("Failed to init database"); | ||||||||||||||||
let blockchain = Blockchain::new_with_db(db, &genesis) | ||||||||||||||||
let blockchain = Blockchain::new_with_db(db, &chain_spec::DEV) | ||||||||||||||||
.expect("Failed to create db-backed blockchain storage"); | ||||||||||||||||
|
||||||||||||||||
// assert genesis state is correct | ||||||||||||||||
|
@@ -306,7 +307,7 @@ mod tests { | |||||||||||||||
let actual_udc_class = state.class(actual_udc_class_hash).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
let actual_fee_token_class_hash = | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
state.class_hash_of_contract(DEFAULT_ETH_FEE_TOKEN_ADDRESS).unwrap().unwrap(); | ||||||||||||||||
let actual_fee_token_class = state.class(actual_fee_token_class_hash).unwrap().unwrap(); | ||||||||||||||||
|
||||||||||||||||
assert_eq!(actual_udc_class_hash, DEFAULT_LEGACY_UDC_CLASS_HASH); | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid generating dev accounts when using custom genesis
Ohayo, sensei! Currently, dev accounts are generated even when a custom genesis is provided, which might lead to conflicts or unintended states. Consider modifying the logic to skip dev account generation in such cases.
Here's a suggested change: