Skip to content

Commit

Permalink
Revert "fix(STO-020): check entity stake for new account (#765)"
Browse files Browse the repository at this point in the history
This reverts commit 376d552.
  • Loading branch information
andysim3d committed Aug 28, 2024
1 parent 376d552 commit b3197bb
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions crates/sim/src/simulation/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,23 +282,18 @@ where
slot,
) => {
let needs_stake_entity = needs_stake.and_then(|t| entity_infos.get(t));

if needs_stake.is_none() {
if let Some(factory) = entity_infos.get(EntityType::Factory) {
if factory.is_staked {
tracing::debug!("Associated storage accessed by staked entity during deploy, and factory is staked");
continue;
}
if let Some(needs_stake_entity) = needs_stake_entity {
if needs_stake_entity.is_staked {
tracing::debug!("Associated storage accessed by staked entity during deploy, and entity is staked");
continue;
}
}

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");
if let Some(factory) = entity_infos.get(EntityType::Factory) {
if factory.is_staked {
tracing::debug!("Associated storage accessed by staked entity during deploy, and factory is staked");
continue;
}
}

// [STO-022]
violations.push(SimulationViolation::AssociatedStorageDuringDeploy(
needs_stake_entity.map(|ei| ei.entity),
Expand Down Expand Up @@ -1179,7 +1174,8 @@ mod tests {
)]
);

context.entity_infos.paymaster.as_mut().unwrap().is_staked = true;
// staked causes no errors
context.entity_infos.factory.as_mut().unwrap().is_staked = true;
let res = simulator.gather_context_violations(&mut context);
assert!(res.unwrap().is_empty());
}
Expand Down

0 comments on commit b3197bb

Please sign in to comment.