Skip to content

Commit

Permalink
fix: reset limit admin check
Browse files Browse the repository at this point in the history
  • Loading branch information
sagars committed Nov 4, 2024
1 parent f81ebcf commit cb15264
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/asset_manager/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ impl AssetManager {
}

pub fn reset_limit(env: Env, token: Address) {
let admin = read_administrator(&env);
admin.require_auth();

Check warning on line 113 in contracts/asset_manager/src/contract.rs

View check run for this annotation

Codecov / codecov/patch

contracts/asset_manager/src/contract.rs#L112-L113

Added lines #L112 - L113 were not covered by tests
let balance = Self::get_token_balance(&env, token.clone());
let mut data: TokenData = read_token_data(&env, token.clone());
data.current_limit = (balance * data.percentage as u128 / POINTS) as u64;
Expand Down

0 comments on commit cb15264

Please sign in to comment.