Now that token deposits can be used as inputs to vote plugins, remove the constraint that prevents token deposits when a vote plugin is used. (#3311)

This commit is contained in:
Daniel Kelleher 2022-07-07 20:10:20 +02:00 committed by GitHub
parent f30ad1d752
commit c061a34cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 38 deletions

View File

@ -45,8 +45,6 @@ pub fn process_deposit_governing_tokens(
let realm_data = get_realm_data(program_id, realm_info)?; let realm_data = get_realm_data(program_id, realm_info)?;
let governing_token_mint = get_spl_token_mint(governing_token_holding_info)?; let governing_token_mint = get_spl_token_mint(governing_token_holding_info)?;
realm_data.asset_governing_tokens_deposits_allowed(&governing_token_mint)?;
realm_data.assert_is_valid_governing_token_mint_and_holding( realm_data.assert_is_valid_governing_token_mint_and_holding(
program_id, program_id,
realm_info.key, realm_info.key,

View File

@ -226,21 +226,6 @@ impl RealmV2 {
Ok(()) Ok(())
} }
/// Asserts the given governing token can be deposited into the realm
pub fn asset_governing_tokens_deposits_allowed(
&self,
governing_token_mint: &Pubkey,
) -> Result<(), ProgramError> {
// If the deposit is for the community token and the realm uses community voter weight addin then panic
if self.config.use_community_voter_weight_addin
&& self.community_mint == *governing_token_mint
{
return Err(GovernanceError::GoverningTokenDepositsNotAllowed.into());
}
Ok(())
}
/// Assert the given create authority can create governance /// Assert the given create authority can create governance
pub fn assert_create_authority_can_create_governance( pub fn assert_create_authority_can_create_governance(
&self, &self,

View File

@ -254,27 +254,6 @@ async fn test_create_program_governance_with_voter_weight_addin() {
); );
} }
#[tokio::test]
async fn test_realm_with_voter_weight_addin_with_deposits_not_allowed() {
// Arrange
let mut governance_test = GovernanceProgramTest::start_with_voter_weight_addin().await;
let realm_cookie = governance_test.with_realm().await;
// Act
let err = governance_test
.with_community_token_deposit(&realm_cookie)
.await
.err()
.unwrap();
// Assert
assert_eq!(
err,
GovernanceError::GoverningTokenDepositsNotAllowed.into()
);
}
#[tokio::test] #[tokio::test]
async fn test_create_governance_with_voter_weight_action_error() { async fn test_create_governance_with_voter_weight_action_error() {
// Arrange // Arrange