Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdefacto committed Aug 25, 2023
1 parent bf15024 commit 476f8ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 1 addition & 5 deletions contracts/linear/src/epoch_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,7 @@ impl LiquidStakingContract {
.unwrap_or_else(|| panic!("{}: {}", ERR_VALIDATOR_NOT_EXIST, &validator_id));

if is_promise_success() {
validator.on_stake_success(
&mut self.validator_pool,
amount,
false, /* release_lock */
);
validator.on_stake_success(&mut self.validator_pool, amount);

Event::EpochStakeSuccess {
validator_id: &validator_id,
Expand Down
11 changes: 2 additions & 9 deletions contracts/linear/src/validator_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,15 +944,8 @@ impl Validator {
)
}

pub fn on_stake_success(
&mut self,
pool: &mut ValidatorPool,
amount: Balance,
release_lock: bool,
) {
if release_lock {
self.post_execution(pool);
}
pub fn on_stake_success(&mut self, pool: &mut ValidatorPool, amount: Balance) {
// Do not post execution here because we need to sync account balance later
self.staked_amount += amount;
pool.save_validator(self);
}
Expand Down

0 comments on commit 476f8ba

Please sign in to comment.