Skip to content

Commit

Permalink
Bugfixes for 138
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Dec 16, 2024
1 parent 72ebeaa commit f71ccff
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/helium-admin-cli/src/create-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ export async function run(args: any = process.argv) {
netEmissionsCap: null,
proposalNamespace: organizationKey("Helium")[0],
delegatorRewardsPercent: delegatorRewardsPercent(argv.delegatorRewardsPercent),
rewardsEscrow,
})
.accounts({
dao,
Expand Down
14 changes: 10 additions & 4 deletions packages/helium-admin-cli/src/migrate-to-hip-138.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import { ThresholdType } from "@helium/circuit-breaker-sdk";
import {
daoKey,
delegatorRewardsPercent,
init as initHsd
init as initHsd,
} from "@helium/helium-sub-daos-sdk";
import { init as initLazy, lazyDistributorKey } from "@helium/lazy-distributor-sdk";
import {
init as initLazy,
lazyDistributorKey,
} from "@helium/lazy-distributor-sdk";
import { organizationKey } from "@helium/organization-sdk";
import { oracleSignerKey } from "@helium/rewards-oracle-sdk";
import {
Expand Down Expand Up @@ -124,7 +127,7 @@ export async function run(args: any = process.argv) {
);
}
console.log("Resizing accounts");
await batchParallelInstructionsWithPriorityFee(provider, resizes);``
await batchParallelInstructionsWithPriorityFee(provider, resizes);

const daoAcc = await hsdProgram.account.daoV0.fetch(dao);
const authority = daoAcc.authority;
Expand Down Expand Up @@ -180,6 +183,7 @@ export async function run(args: any = process.argv) {
hstPool: null,
proposalNamespace: organizationKey("Helium")[0],
delegatorRewardsPercent: delegatorRewardsPercent(6),
rewardsEscrow: getAssociatedTokenAddressSync(hntMint, ld, true),
})
.accounts({
dao,
Expand All @@ -189,14 +193,16 @@ export async function run(args: any = process.argv) {
.instruction()
);

if (!daoAcc.rewardsEscrow) {
if (!daoAcc.rewardsEscrow || daoAcc.rewardsEscrow.equals(PublicKey.default)) {
instructions.push(
await hsdProgram.methods
.initializeHntDelegatorPool()
.accounts({
dao,
payer: daoAcc.authority,
delegatorPool: getAssociatedTokenAddressSync(hntMint, dao, true),
rewardsEscrow: getAssociatedTokenAddressSync(hntMint, ld, true),

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/data-credits.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/data-credits.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/voter-stake-registry.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/voter-stake-registry.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/price-oracle.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/price-oracle.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/hexboosting.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/hexboosting.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/mobile-entity-manager.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/mobile-entity-manager.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/lazy-transactions.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/lazy-transactions.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/fanout.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/fanout.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/treasury-management.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/treasury-management.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/distributor-oracle.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/distributor-oracle.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/lazy-distributor.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/lazy-distributor.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Development Workflow

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Development Workflow

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/helium-entity-manager.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/helium-entity-manager.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/helium-sub-daos.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/helium-sub-daos.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/sus.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/sus.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/circuit-breaker.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.

Check failure on line 204 in packages/helium-admin-cli/src/migrate-to-hip-138.ts

View workflow job for this annotation

GitHub Actions / Test Anchor Contracts (tests/circuit-breaker.ts)

Argument of type '{ dao: anchor.web3.PublicKey; payer: anchor.web3.PublicKey; delegatorPool: anchor.web3.PublicKey; rewardsEscrow: anchor.web3.PublicKey; authority: anchor.web3.PublicKey; }' is not assignable to parameter of type 'Partial<{ payer: Address; hntMint: Address; authority: Address; delegatorPool: Address; dao: Address; systemProgram: Address; tokenProgram: Address; associatedTokenProgram: Address; circuitBreakerProgram: Address; delegatorPoolCircuitBreaker: Address; }>'.
authority: daoAcc.authority,
})
.instruction()
);
Expand Down
1 change: 1 addition & 0 deletions packages/helium-admin-cli/src/update-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export async function run(args: any = process.argv) {
delegatorRewardsPercent: argv.delegatorRewardsPercent
? delegatorRewardsPercent(argv.delegatorRewardsPercent)
: null,
rewardsEscrow: null,
})
.accounts({
dao,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ pub struct InitializeHntDelegatorPool<'info> {
associated_token::authority = dao,
)]
pub delegator_pool: Box<Account<'info, TokenAccount>>,
#[account(
token::mint = hnt_mint,
)]
pub rewards_escrow: Box<Account<'info, TokenAccount>>,

pub system_program: Program<'info, System>,
pub token_program: Program<'info, Token>,
pub circuit_breaker_program: Program<'info, CircuitBreaker>,
Expand Down
5 changes: 5 additions & 0 deletions programs/helium-sub-daos/src/instructions/update_dao_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct UpdateDaoArgsV0 {
pub net_emissions_cap: Option<u64>,
pub proposal_namespace: Option<Pubkey>,
pub delegator_rewards_percent: Option<u64>,
pub rewards_escrow: Option<Pubkey>,
}

#[derive(Accounts)]
Expand All @@ -36,6 +37,10 @@ pub fn handler(ctx: Context<UpdateDaoV0>, args: UpdateDaoArgsV0) -> Result<()> {
ctx.accounts.dao.authority = new_authority;
}

if let Some(rewards_escrow) = args.rewards_escrow {
ctx.accounts.dao.rewards_escrow = rewards_escrow;
}

if let Some(hst_emission_schedule) = args.hst_emission_schedule {
ctx.accounts.dao.hst_emission_schedule = hst_emission_schedule;
should_resize = true;
Expand Down
1 change: 1 addition & 0 deletions tests/helium-sub-daos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ describe("helium-sub-daos", () => {
netEmissionsCap: null,
proposalNamespace: null,
delegatorRewardsPercent: null,
rewardsEscrow: null,
})
.accounts({
dao,
Expand Down

0 comments on commit f71ccff

Please sign in to comment.