Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b64d202

Browse files
authored
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. (#3332)
1 parent efa8826 commit b64d202

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

governance/program/src/processor/process_deposit_governing_tokens.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ pub fn process_deposit_governing_tokens(
4545
let realm_data = get_realm_data(program_id, realm_info)?;
4646
let governing_token_mint = get_spl_token_mint(governing_token_holding_info)?;
4747

48-
realm_data.asset_governing_tokens_deposits_allowed(&governing_token_mint)?;
49-
5048
realm_data.assert_is_valid_governing_token_mint_and_holding(
5149
program_id,
5250
realm_info.key,

governance/program/src/state/realm.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,6 @@ impl RealmV2 {
197197
Ok(())
198198
}
199199

200-
/// Asserts the given governing token can be deposited into the realm
201-
pub fn asset_governing_tokens_deposits_allowed(
202-
&self,
203-
governing_token_mint: &Pubkey,
204-
) -> Result<(), ProgramError> {
205-
// If the deposit is for the community token and the realm uses community voter weight addin then panic
206-
if self.config.use_community_voter_weight_addin
207-
&& self.community_mint == *governing_token_mint
208-
{
209-
return Err(GovernanceError::GoverningTokenDepositsNotAllowed.into());
210-
}
211-
212-
Ok(())
213-
}
214-
215200
/// Assert the given create authority can create governance
216201
pub fn assert_create_authority_can_create_governance(
217202
&self,

governance/program/tests/use_realm_with_voter_weight_addin.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -248,27 +248,6 @@ async fn test_create_program_governance_with_voter_weight_addin() {
248248
);
249249
}
250250

251-
#[tokio::test]
252-
async fn test_realm_with_voter_weight_addin_with_deposits_not_allowed() {
253-
// Arrange
254-
let mut governance_test = GovernanceProgramTest::start_with_voter_weight_addin().await;
255-
let realm_cookie = governance_test.with_realm().await;
256-
257-
// Act
258-
259-
let err = governance_test
260-
.with_community_token_deposit(&realm_cookie)
261-
.await
262-
.err()
263-
.unwrap();
264-
265-
// Assert
266-
assert_eq!(
267-
err,
268-
GovernanceError::GoverningTokenDepositsNotAllowed.into()
269-
);
270-
}
271-
272251
#[tokio::test]
273252
async fn test_create_governance_with_voter_weight_action_error() {
274253
// Arrange

0 commit comments

Comments
 (0)