Skip to content

Commit

Permalink
fsyntax
Browse files Browse the repository at this point in the history
  • Loading branch information
debjit-bw committed Oct 16, 2024
1 parent 0b88039 commit a35802f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/gnosis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,9 @@ where
})?;

// figure out if we should create the system account
let mut should_create = false;
if let Some(system_account) = state.get(&SYSTEM_ADDRESS) {
if system_account.status == (AccountStatus::Touched | AccountStatus::LoadedAsNotExisting) {
should_create = true;
}
} else {
should_create = true;
}
let should_create = state.get(&SYSTEM_ADDRESS).map_or(true, |system_account| {
system_account.status == (AccountStatus::Touched | AccountStatus::LoadedAsNotExisting)
});

// system account call is only in rewards function because it will be called in every block
// Clean-up post system tx context
Expand All @@ -206,7 +201,7 @@ where
};
state.insert(SYSTEM_ADDRESS, account);
} else {
// Conditionally clear the system address account to prevent being removed
// Conditionally clear the system address account to prevent it from being removed
state.remove(&SYSTEM_ADDRESS);
}

Expand Down

0 comments on commit a35802f

Please sign in to comment.