Skip to content

Commit

Permalink
ref: simplify addition to the unstaking_queue
Browse files Browse the repository at this point in the history
  • Loading branch information
joemonem committed Nov 14, 2024
1 parent f061d16 commit a74cd5c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contracts/finance/andromeda-validator-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ fn execute_unstake(
amount: fund.clone(),
});

let mut unstaking_queue = UNSTAKING_QUEUE.load(deps.storage).unwrap_or_default();
unstaking_queue.push(UnstakingTokens {
fund,
payout_at: Timestamp::default(),
});
let unstaking_queue = UNSTAKING_QUEUE
.load(deps.storage)
.unwrap_or(vec![UnstakingTokens {
fund,
payout_at: Timestamp::default(),
}]);

UNSTAKING_QUEUE.save(deps.storage, &unstaking_queue)?;

Expand Down

0 comments on commit a74cd5c

Please sign in to comment.