Skip to content

Commit

Permalink
chore: update comments around emissions storage
Browse files Browse the repository at this point in the history
  • Loading branch information
mootz12 committed Dec 5, 2023
1 parent 027c8c6 commit 7b13e80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
16 changes: 3 additions & 13 deletions backstop/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,6 @@ pub fn set_user_balance(e: &Env, pool: &Address, user: &Address, balance: &UserB
/// * `pool` - The pool the deposit is associated with
pub fn get_pool_balance(e: &Env, pool: &Address) -> PoolBalance {
let key = BackstopDataKey::PoolBalance(pool.clone());
// if let Some(result) = e.storage().persistent().get::<BackstopDataKey, PoolBalance>(&key) {
// e.storage()
// .persistent()
// .bump(&key, LEDGER_THRESHOLD_SHARED, LEDGER_BUMP_SHARED);
// result
// } else {
// // @dev: Required to use "new" to require that "pool" was deployed from the factory
// PoolBalance::new(e, pool)
// }

get_persistent_default(
e,
&key,
Expand Down Expand Up @@ -362,7 +352,7 @@ pub fn set_reward_zone(e: &Env, reward_zone: &Vec<Address>) {
);
}

/// Get current emissions EPS the backstop is distributing to the pool
/// Get the current emissions accrued for the pool
///
/// ### Arguments
/// * `pool` - The pool
Expand All @@ -371,11 +361,11 @@ pub fn get_pool_emissions(e: &Env, pool: &Address) -> i128 {
get_persistent_default(e, &key, 0i128, LEDGER_THRESHOLD_SHARED, LEDGER_BUMP_SHARED)
}

/// Set the current emissions EPS the backstop is distributing to the pool
/// Set the current emissions accrued for the pool
///
/// ### Arguments
/// * `pool` - The pool
/// * `emissions` - The eps being distributed to the pool
/// * `emissions` - The number of tokens to distribute to the pool
pub fn set_pool_emissions(e: &Env, pool: &Address, emissions: i128) {
let key = BackstopDataKey::PoolEmis(pool.clone());
e.storage()
Expand Down
3 changes: 2 additions & 1 deletion pool/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ pub fn get_pool_emissions(e: &Env) -> Map<u32, u64> {
/// Set the pool reserve emissions
///
/// ### Arguments
/// * `emissions` - The map of emissions by reserve token id to EPS
/// * `emissions` - The map of emissions by reserve token id to share of emissions as
/// a percentage of 1e7 (e.g. 15% = 1500000)
pub fn set_pool_emissions(e: &Env, emissions: &Map<u32, u64>) {
e.storage()
.persistent()
Expand Down

0 comments on commit 7b13e80

Please sign in to comment.