Drop unfinished update max vote weight instruction

This commit is contained in:
Christian Kamm 2023-12-10 11:30:07 +01:00
parent e90cc9b463
commit 8acfb91662
3 changed files with 0 additions and 34 deletions

View File

@ -11,7 +11,6 @@ pub use internal_transfer_locked::*;
pub use internal_transfer_unlocked::*;
pub use log_voter_info::*;
pub use reset_lockup::*;
pub use update_max_vote_weight::*;
pub use update_voter_weight_record::*;
pub use withdraw::*;
@ -28,6 +27,5 @@ mod internal_transfer_locked;
mod internal_transfer_unlocked;
mod log_voter_info;
mod reset_lockup;
mod update_max_vote_weight;
mod update_voter_weight_record;
mod withdraw;

View File

@ -1,28 +0,0 @@
use crate::state::*;
use anchor_lang::prelude::*;
// Remaining accounts should all the token mints that have registered
// exchange rates.
#[derive(Accounts)]
pub struct UpdateMaxVoteWeight<'info> {
pub registrar: AccountLoader<'info, Registrar>,
// TODO: SPL governance has not yet implemented this.
/// CHECK: TODO. Will be implemented when max_vote_weight_record is rolled out.
pub max_vote_weight_record: UncheckedAccount<'info>,
}
/// Calculates the max vote weight for the registry. This is a function
/// of the total supply of all exchange rate mints, converted into a
/// common currency with a common number of decimals.
///
/// Note that this method is only safe to use if the cumulative supply for
/// all tokens fits into a u64 *after* converting into common decimals, as
/// defined by the registrar's `rate_decimal` field.
pub fn update_max_vote_weight(ctx: Context<UpdateMaxVoteWeight>) -> Result<()> {
let registrar = &ctx.accounts.registrar.load()?;
let _max_vote_weight = registrar.max_vote_weight(ctx.remaining_accounts)?;
// TODO: Unfinished! Currently this does not work as an max vote weight plugin!
Ok(())
}

View File

@ -197,10 +197,6 @@ pub mod voter_stake_registry {
instructions::update_voter_weight_record(ctx)
}
pub fn update_max_vote_weight(ctx: Context<UpdateMaxVoteWeight>) -> Result<()> {
instructions::update_max_vote_weight(ctx)
}
pub fn close_voter<'key, 'accounts, 'remaining, 'info>(
ctx: Context<'key, 'accounts, 'remaining, 'info, CloseVoter<'info>>,
) -> Result<()> {