Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
fix(ci): bad code formatting
  • Loading branch information
refcell committed Dec 12, 2025
commit d7858853eeff2be832c02e789137386bde8cc14f
69 changes: 13 additions & 56 deletions crates/fbal/tests/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,42 +455,26 @@ pub fn test_create_deployment_tracked() {
let access_list = execute_txns_build_access_list(vec![tx], Some(overrides));

// Verify factory is in the access list
let factory_entry = access_list
.account_changes
.iter()
.find(|ac| ac.address() == factory);
let factory_entry = access_list.account_changes.iter().find(|ac| ac.address() == factory);
assert!(factory_entry.is_some(), "Factory should be in access list");

// The factory's nonce should change (CREATE increments deployer nonce)
let factory_changes = factory_entry.unwrap();
assert!(
!factory_changes.nonce_changes.is_empty(),
"Factory nonce should change due to CREATE"
);
assert!(!factory_changes.nonce_changes.is_empty(), "Factory nonce should change due to CREATE");

// Find the deployed contract - it should have a code change
let deployed_entry = access_list
.account_changes
.iter()
.find(|ac| !ac.code_changes.is_empty() && ac.address() != factory);
assert!(
deployed_entry.is_some(),
"Deployed contract should have code change"
);
assert!(deployed_entry.is_some(), "Deployed contract should have code change");

let deployed_changes = deployed_entry.unwrap();
assert_eq!(
deployed_changes.code_changes.len(),
1,
"Should have exactly one code change"
);
assert_eq!(deployed_changes.code_changes.len(), 1, "Should have exactly one code change");

// Verify the deployed bytecode matches SimpleStorage's deployed bytecode
let code_change = &deployed_changes.code_changes[0];
assert!(
!code_change.new_code.is_empty(),
"Deployed code should not be empty"
);
assert!(!code_change.new_code.is_empty(), "Deployed code should not be empty");

dbg!(&access_list);
}
Expand Down Expand Up @@ -539,35 +523,22 @@ pub fn test_create2_deployment_tracked() {
let access_list = execute_txns_build_access_list(vec![tx], Some(overrides));

// Verify factory is in the access list
let factory_entry = access_list
.account_changes
.iter()
.find(|ac| ac.address() == factory);
let factory_entry = access_list.account_changes.iter().find(|ac| ac.address() == factory);
assert!(factory_entry.is_some(), "Factory should be in access list");

// Find the deployed contract - it should have a code change
let deployed_entry = access_list
.account_changes
.iter()
.find(|ac| !ac.code_changes.is_empty() && ac.address() != factory);
assert!(
deployed_entry.is_some(),
"Deployed contract should have code change"
);
assert!(deployed_entry.is_some(), "Deployed contract should have code change");

let deployed_changes = deployed_entry.unwrap();
assert_eq!(
deployed_changes.code_changes.len(),
1,
"Should have exactly one code change"
);
assert_eq!(deployed_changes.code_changes.len(), 1, "Should have exactly one code change");

// Verify the deployed bytecode is present
let code_change = &deployed_changes.code_changes[0];
assert!(
!code_change.new_code.is_empty(),
"Deployed code should not be empty"
);
assert!(!code_change.new_code.is_empty(), "Deployed code should not be empty");

dbg!(&access_list);
}
Expand Down Expand Up @@ -617,30 +588,20 @@ pub fn test_create_and_immediate_call() {
let access_list = execute_txns_build_access_list(vec![tx], Some(overrides));

// Verify factory is in the access list
let factory_entry = access_list
.account_changes
.iter()
.find(|ac| ac.address() == factory);
let factory_entry = access_list.account_changes.iter().find(|ac| ac.address() == factory);
assert!(factory_entry.is_some(), "Factory should be in access list");

// Find the deployed contract - it should have both code change AND storage change
let deployed_entry = access_list
.account_changes
.iter()
.find(|ac| !ac.code_changes.is_empty() && ac.address() != factory);
assert!(
deployed_entry.is_some(),
"Deployed contract should have code change"
);
assert!(deployed_entry.is_some(), "Deployed contract should have code change");

let deployed_changes = deployed_entry.unwrap();

// Verify code change exists
assert_eq!(
deployed_changes.code_changes.len(),
1,
"Should have exactly one code change"
);
assert_eq!(deployed_changes.code_changes.len(), 1, "Should have exactly one code change");

// Verify storage change exists (from setValue(42))
// SimpleStorage stores `value` at slot 0
Expand All @@ -651,11 +612,7 @@ pub fn test_create_and_immediate_call() {

// Verify the storage slot is 0 and value is 42
let storage_change = &deployed_changes.storage_changes[0];
assert_eq!(
storage_change.slot,
B256::ZERO,
"Storage slot should be 0"
);
assert_eq!(storage_change.slot, B256::ZERO, "Storage slot should be 0");
assert_eq!(
storage_change.changes[0].new_value,
B256::from(U256::from(42)),
Expand Down