From 2e56905f83af52594ffea86704dab5775e3d82cf Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Aug 2024 11:32:28 -0400 Subject: [PATCH] fix(STO-020): check entity stake for new account --- crates/sim/src/simulation/simulator.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/sim/src/simulation/simulator.rs b/crates/sim/src/simulation/simulator.rs index 49f1a6de3..55ae206ab 100644 --- a/crates/sim/src/simulation/simulator.rs +++ b/crates/sim/src/simulation/simulator.rs @@ -282,11 +282,15 @@ where slot, ) => { let needs_stake_entity = needs_stake.and_then(|t| entity_infos.get(t)); - if let Some(needs_stake_entity) = needs_stake_entity { - if needs_stake_entity.is_staked { + if let Some(needs_stake_entity_info) = needs_stake_entity { + if needs_stake_entity_info.is_staked { tracing::debug!("Associated storage accessed by staked entity during deploy, and entity is staked"); continue; } + violations.push(SimulationViolation::AssociatedStorageDuringDeploy( + needs_stake_entity.map(|ei| ei.entity), + StorageSlot { address, slot }, + )) } if let Some(factory) = entity_infos.get(EntityType::Factory) { if factory.is_staked {