From 39b3f67a872cd3c7a20c28349ba6b0c7d75aee42 Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Mon, 2 Dec 2024 14:28:24 -0800 Subject: [PATCH] Fix tests --- .../src/instructions/issue_rewards_v0.rs | 1 + .../src/instructions/switch_mobile_ops_fund.rs | 3 ++- tests/helium-sub-daos.ts | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/programs/helium-sub-daos/src/instructions/issue_rewards_v0.rs b/programs/helium-sub-daos/src/instructions/issue_rewards_v0.rs index d18e77372..92c25c29f 100644 --- a/programs/helium-sub-daos/src/instructions/issue_rewards_v0.rs +++ b/programs/helium-sub-daos/src/instructions/issue_rewards_v0.rs @@ -228,6 +228,7 @@ pub fn handler(ctx: Context, args: IssueRewardsArgsV0) -> Result // This contract will be deployed between December 3 and December 4 at UTC midnight. // That means this will emit payment from December 3 to August 1st, 2025 (because epochs are paid in arrears). // This is a total of 241 days. 2.9M HNT / 241 days = 12033.19502075 HNT per day. + #[allow(clippy::inconsistent_digit_grouping)] if epoch_curr_ts < 1754006400 && ctx.accounts.dnt_mint.key() == Pubkey::from_str("mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6").unwrap() diff --git a/programs/helium-sub-daos/src/instructions/switch_mobile_ops_fund.rs b/programs/helium-sub-daos/src/instructions/switch_mobile_ops_fund.rs index d3000bfff..ba2fc4ba4 100644 --- a/programs/helium-sub-daos/src/instructions/switch_mobile_ops_fund.rs +++ b/programs/helium-sub-daos/src/instructions/switch_mobile_ops_fund.rs @@ -56,6 +56,7 @@ pub struct SwitchMobileOpsFund<'info> { pub associated_token_program: Program<'info, AssociatedToken>, } +#[allow(clippy::inconsistent_digit_grouping)] pub fn handler(ctx: Context) -> Result<()> { burn( CpiContext::new( @@ -66,7 +67,7 @@ pub fn handler(ctx: Context) -> Result<()> { authority: ctx.accounts.authority.to_account_info(), }, ), - 18_197_425_725, + 18_197_425_725_000000, )?; mint_v0( CpiContext::new_with_signer( diff --git a/tests/helium-sub-daos.ts b/tests/helium-sub-daos.ts index 3ef836125..2793639a8 100644 --- a/tests/helium-sub-daos.ts +++ b/tests/helium-sub-daos.ts @@ -265,7 +265,20 @@ describe("helium-sub-daos", () => { pubkeys: { vetokenTracker: tracker }, } = await rewardsProgram.methods .initializeVetokenTrackerV0({ - votingRewardsTiers: [], + votingRewardsTiers: [ + { + numVetokens: new anchor.BN(0), + percent: delegatorRewardsPercent(0), + }, + { + numVetokens: new anchor.BN(10), + percent: delegatorRewardsPercent(50), + }, + { + numVetokens: new anchor.BN(1000000000000000), + percent: delegatorRewardsPercent(100), + }, + ], }) .accounts({ registrar: subDaoRegistrar, @@ -960,7 +973,7 @@ describe("helium-sub-daos", () => { ); expect( vsrEpochInfoAcc.rewardsAmount.toString() - ).to.eq((0.02 * SUB_DAO_EPOCH_REWARDS).toString()); + ).to.eq("0"); const acc = await program.account.subDaoEpochInfoV0.fetch( subDaoEpochInfo