Skip to content

Commit

Permalink
Add admin endpoint to fix SubDaoEpochInfoV0 onboarding fees paid (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Aug 18, 2024
1 parent a3fb6cd commit f1e38b0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion programs/helium-sub-daos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "helium-sub-daos"
version = "0.1.7"
version = "0.1.8"
description = "Created with Anchor"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use anchor_lang::prelude::*;

use crate::{DaoV0, SubDaoEpochInfoV0, SubDaoV0};

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)]
pub struct AdminSetDcOnboardingFeesPaidEpochInfoArgs {
pub dc_onboarding_fees_paid: u64,
}

#[derive(Accounts)]
pub struct AdminSetDcOnboardingFeesPaidEpochInfo<'info> {
#[account(
has_one = authority,
)]
pub dao: Account<'info, DaoV0>,
#[account(
has_one = dao,
)]
pub sub_dao: Account<'info, SubDaoV0>,
#[account(
has_one = sub_dao
)]
pub sub_dao_epoch_info: Account<'info, SubDaoEpochInfoV0>,
pub authority: Signer<'info>,
}

pub fn handler(
ctx: Context<AdminSetDcOnboardingFeesPaidEpochInfo>,
args: AdminSetDcOnboardingFeesPaidEpochInfoArgs,
) -> Result<()> {
ctx.accounts.sub_dao_epoch_info.dc_onboarding_fees_paid = args.dc_onboarding_fees_paid;
Ok(())
}
2 changes: 2 additions & 0 deletions programs/helium-sub-daos/src/instructions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod admin_set_dc_onboarding_fees_paid;
pub mod admin_set_dc_onboarding_fees_paid_epoch_info;
pub mod calculate_utility_score_v0;
pub mod delegation;
pub mod initialize_dao_v0;
Expand All @@ -13,6 +14,7 @@ pub mod update_sub_dao_v0;
pub mod update_sub_dao_vehnt_v0;

pub use admin_set_dc_onboarding_fees_paid::*;
pub use admin_set_dc_onboarding_fees_paid_epoch_info::*;
pub use calculate_utility_score_v0::*;
pub use delegation::*;
pub use initialize_dao_v0::*;
Expand Down
7 changes: 7 additions & 0 deletions programs/helium-sub-daos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,11 @@ pub mod helium_sub_daos {
) -> Result<()> {
admin_set_dc_onboarding_fees_paid::handler(ctx, args)
}

pub fn admin_set_dc_onboarding_fees_paid_epoch_info(
ctx: Context<AdminSetDcOnboardingFeesPaidEpochInfo>,
args: AdminSetDcOnboardingFeesPaidEpochInfoArgs,
) -> Result<()> {
admin_set_dc_onboarding_fees_paid_epoch_info::handler(ctx, args)
}
}

0 comments on commit f1e38b0

Please sign in to comment.