Skip to content

Commit

Permalink
fix(STO-020): check entity stake for new account
Browse files Browse the repository at this point in the history
  • Loading branch information
andysim3d committed Aug 21, 2024
1 parent 2101830 commit 73fa3bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/sim/src/simulation/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 73fa3bd

Please sign in to comment.