Skip to content

Commit

Permalink
Merge pull request #18 from memechan-gg/test/get-fees
Browse files Browse the repository at this point in the history
🔧 chore: do not throw on no-account
  • Loading branch information
avernikoz authored May 9, 2024
2 parents cf3d7f6 + b45e1ef commit 52ff64e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions memechan/sources/live_phase/staking_pool.move
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ module memechan::staking_pool {
}

public fun get_fees<S, Meme, LP>(staking_pool: &StakingPool<S, Meme, LP>, ctx: &mut TxContext): (u64, u64) {
if (!table::contains(&staking_pool.vesting_table, sender(ctx))) return (0, 0);

let vesting_data = table::borrow(&staking_pool.vesting_table, sender(ctx));
let (meme_amount, sui_amount) = fee_distribution::get_fees_to_withdraw(
&staking_pool.fee_state,
Expand Down Expand Up @@ -170,6 +172,8 @@ module memechan::staking_pool {
clock: &Clock,
ctx: &mut TxContext,
): u64 {
if (!table::contains(&staking_pool.vesting_table, sender(ctx))) return 0;

let vesting_data = table::borrow(&staking_pool.vesting_table, sender(ctx));

let amount_available_to_release = vesting::to_release(
Expand Down

0 comments on commit 52ff64e

Please sign in to comment.