From 7b13e805ff587f4a208e19d352a1470d0422b3b4 Mon Sep 17 00:00:00 2001 From: mootz12 Date: Tue, 5 Dec 2023 08:59:43 -0500 Subject: [PATCH] chore: update comments around emissions storage --- backstop/src/storage.rs | 16 +++------------- pool/src/storage.rs | 3 ++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/backstop/src/storage.rs b/backstop/src/storage.rs index 3501933c..f282b939 100644 --- a/backstop/src/storage.rs +++ b/backstop/src/storage.rs @@ -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::(&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, @@ -362,7 +352,7 @@ pub fn set_reward_zone(e: &Env, reward_zone: &Vec
) { ); } -/// Get current emissions EPS the backstop is distributing to the pool +/// Get the current emissions accrued for the pool /// /// ### Arguments /// * `pool` - The pool @@ -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() diff --git a/pool/src/storage.rs b/pool/src/storage.rs index b882a679..e7901ab7 100644 --- a/pool/src/storage.rs +++ b/pool/src/storage.rs @@ -557,7 +557,8 @@ pub fn get_pool_emissions(e: &Env) -> Map { /// 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) { e.storage() .persistent()