diff --git a/contracts/liquidity_hub/bonding-manager/src/commands.rs b/contracts/liquidity_hub/bonding-manager/src/commands.rs index f18297c0..01b0fa6e 100644 --- a/contracts/liquidity_hub/bonding-manager/src/commands.rs +++ b/contracts/liquidity_hub/bonding-manager/src/commands.rs @@ -65,7 +65,6 @@ pub(crate) fn bond( Ok(bucket) }, )?; - println!("Bonded asset: {:?}", global_index); Ok(Response::default().add_attributes(vec![ ("action", "bond".to_string()), @@ -239,7 +238,6 @@ pub fn claim(deps: DepsMut, _env: Env, info: MessageInfo) -> Result Result { let asset_to_bond = helpers::validate_funds(&deps, &info)?; - commands::bond( - deps, - env.block.time, - info.clone(), - env, - asset_to_bond.to_owned(), - ) + commands::bond(deps, env.block.time, info, env, asset_to_bond) } ExecuteMsg::Unbond { asset } => { cw_utils::nonpayable(&info)?; @@ -117,10 +111,7 @@ pub fn execute( // Epoch has been updated, update rewards bucket // and forward the expiring epoch // Store epoch manager and verify the sender is him - println!("New epoch created: {:?}", current_epoch); - // let config = CONFIG.load(deps.storage)?; let global = GLOBAL.may_load(deps.storage)?; - println!("Global: {:?}", global); // This happens only on the first epoch where Global has not been initialised yet if global.is_none() { let default_global = GlobalIndex { @@ -155,11 +146,10 @@ pub fn execute( &Epoch { id: next_epoch_id.into(), start_time: current_epoch.start_time.plus_days(1), - global_index: global.clone(), + global_index: global, ..Epoch::default() }, )?; - println!("Nexts epoch created: {}", next_epoch_id); // // Return early if the epoch is the first one // if new_epoch_id == 1 { // // Creates a new bucket for the rewards flowing from this time on, i.e. to be distributed in the next epoch. Also, forwards the expiring epoch (only 21 epochs are live at a given moment) @@ -180,13 +170,11 @@ pub fn execute( // forward fees from the expiring epoch to the new one. let mut expiring_epoch = get_expiring_epoch(deps.as_ref())?; - println!("Expiring epoch: {:?}", expiring_epoch); if let Some(expiring_epoch) = expiring_epoch.as_mut() { // Load all the available assets from the expiring epoch let amount_to_be_forwarded = EPOCHS .load(deps.storage, &expiring_epoch.id.to_be_bytes())? .available; - println!("Amount to be forwarded: {:?}", amount_to_be_forwarded); EPOCHS.update( deps.storage, &new_epoch_id.to_be_bytes(), @@ -271,8 +259,6 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { // Reply entrypoint handling LP withdraws from fill_rewards #[entry_point] pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result { - println!("Reply from fill_rewards: {:?}", msg.clone()); - match msg.id { LP_WITHDRAWAL_REPLY_ID => { // Read the epoch sent by the fee collector through the ForwardFeesResponse @@ -282,7 +268,6 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result = from_json(data.as_slice())?; - println!("Coins: {:?}", coins); let config = CONFIG.load(deps.storage)?; let distribution_denom = config.distribution_denom.clone(); let mut messages = vec![]; @@ -333,8 +318,6 @@ pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result epoch_id?, None => return Err(ContractError::Unauthorized {}), }; - let epoch_to_log = EPOCHS.load(deps.storage, &next_epoch_id)?; - println!("Most recent epoch: {:?}", epoch_to_log); EPOCHS.update(deps.storage, &next_epoch_id, |bucket| -> StdResult<_> { let mut bucket = bucket.unwrap_or_default(); bucket.available = asset::aggregate_coins(bucket.available, vec![whale.clone()])?; diff --git a/contracts/liquidity_hub/bonding-manager/src/helpers.rs b/contracts/liquidity_hub/bonding-manager/src/helpers.rs index 54ac3ba3..40ead8f3 100644 --- a/contracts/liquidity_hub/bonding-manager/src/helpers.rs +++ b/contracts/liquidity_hub/bonding-manager/src/helpers.rs @@ -55,7 +55,6 @@ pub fn validate_funds(deps: &DepsMut, info: &MessageInfo) -> Result Result<(), ContractError> { // Do a smart query for Claimable let claimable_rewards: ClaimableEpochsResponse = get_claimable_epochs(deps.as_ref()).unwrap(); - println!("Claimable rewards: {:?}", claimable_rewards); // If epochs is greater than none if !claimable_rewards.epochs.is_empty() { return Err(ContractError::UnclaimedRewards {}); @@ -108,11 +107,9 @@ pub fn calculate_epoch( let elapsed_time = Uint64::new(timestamp.nanos()).checked_sub(genesis_epoch_config.genesis_epoch)?; - println!("Elapsed time: {:?}", elapsed_time); let epoch = elapsed_time .checked_div(epoch_duration)? .checked_add(Uint64::one())?; - println!("Epoch: {:?}", epoch); Ok(epoch) } diff --git a/contracts/liquidity_hub/bonding-manager/src/queries.rs b/contracts/liquidity_hub/bonding-manager/src/queries.rs index 91e6d1f7..82cd8726 100644 --- a/contracts/liquidity_hub/bonding-manager/src/queries.rs +++ b/contracts/liquidity_hub/bonding-manager/src/queries.rs @@ -37,7 +37,6 @@ pub(crate) fn query_bonded(deps: Deps, address: String) -> StdResult>>()?; - println!("bonds is empty : {:?}", bonds.is_empty()); // if it doesn't have bonded, return empty response if bonds.is_empty() { @@ -47,7 +46,6 @@ pub(crate) fn query_bonded(deps: Deps, address: String) -> StdResult>>()?; - println!("unbonding: {:?}", unbonding); // aggregate all the amounts in unbonding vec and return uint128 let unbonding_amount = unbonding.iter().try_fold(Uint128::zero(), |acc, bond| { acc.checked_add(bond.asset.amount) @@ -182,7 +179,6 @@ pub(crate) fn query_weight( config.growth_rate, bond.timestamp, )?; - println!("bond: {:?}", bond); if !unique_denoms.contains(&bond.asset.denom) { unique_denoms.insert(bond.asset.denom.clone()); @@ -200,7 +196,6 @@ pub(crate) fn query_weight( .unwrap_or_else(|_| Some(GlobalIndex::default())) .ok_or_else(|| StdError::generic_err("Global index not found"))? }; - println!("unique_denoms: {:?}", global_index); // If a global weight from an Epoch was passed, use that to get the weight, otherwise use the current global index weight global_index.weight = get_weight( @@ -210,7 +205,6 @@ pub(crate) fn query_weight( config.growth_rate, global_index.timestamp, )?; - println!("unique_denoms: {:?}", global_index); // Represents the share of the global weight that the address has // If global_index.weight is zero no one has bonded yet so the share is @@ -338,7 +332,6 @@ pub fn query_claimable(deps: Deps, address: &Addr) -> StdResult bonded_response.first_bonded_epoch_id); } }; - println!("claimable_epochs: {:?}", claimable_epochs); // filter out epochs that have no available fees. This would only happen in case the grace period // gets increased after epochs have expired, which would lead to make them available for claiming // again without any available rewards, as those were forwarded to newer epochs. diff --git a/contracts/liquidity_hub/bonding-manager/src/tests/claim.rs b/contracts/liquidity_hub/bonding-manager/src/tests/claim.rs index 7326aae4..34f659a7 100644 --- a/contracts/liquidity_hub/bonding-manager/src/tests/claim.rs +++ b/contracts/liquidity_hub/bonding-manager/src/tests/claim.rs @@ -31,7 +31,6 @@ fn test_claimable_epochs() { .add_epochs_to_state(epochs) .query_claimable_epochs(None, |res| { let (_, epochs) = res.unwrap(); - println!("{:?}", epochs); assert_eq!(epochs.len(), claimable_epochs.len()); for (e, a) in epochs.iter().zip(claimable_epochs.iter()) { assert_eq!(e, *a); @@ -244,7 +243,6 @@ fn test_claim_successfully() { robot.claim(sender, |res| { let result = res.unwrap(); - println!("{:?}", result); assert!(result.events.iter().any(|event| { event .attributes @@ -255,7 +253,6 @@ fn test_claim_successfully() { robot.claim(another_sender, |res| { let result = res.unwrap(); - println!("{:?}", result); assert!(result.events.iter().any(|event| { event .attributes