diff --git a/governance-lib/src/governance.rs b/governance-lib/src/governance.rs index 2338743..daf4ec5 100644 --- a/governance-lib/src/governance.rs +++ b/governance-lib/src/governance.rs @@ -52,7 +52,7 @@ impl<'a> Governance<'a> { } pub fn get_proposals_count(&self) -> ClientResult { - let data = self.get_data()?.ok_or(GovernanceLibError::StateError(self.governance_address, "Missed governance".to_string()))?; + let data = self.get_data()?.ok_or_else(|| GovernanceLibError::StateError(self.governance_address, "Missed governance".to_string()))?; Ok(data.proposals_count) } diff --git a/launch-script/src/lockup.rs b/launch-script/src/lockup.rs index 574b2d6..341fa94 100644 --- a/launch-script/src/lockup.rs +++ b/launch-script/src/lockup.rs @@ -2,6 +2,7 @@ use chrono::{Duration, NaiveDateTime}; use chronoutil::delta::{shift_months, shift_years}; pub use spl_governance_addin_vesting::state::VestingSchedule; +#[allow(clippy::enum_variant_names)] #[derive(Debug,PartialEq,Copy,Clone)] pub enum Lockup { NoLockup, diff --git a/launch-script/src/main.rs b/launch-script/src/main.rs index fa94717..dc1d65f 100644 --- a/launch-script/src/main.rs +++ b/launch-script/src/main.rs @@ -205,9 +205,9 @@ impl<'a> Configuration<'a> { pubkey!("tstTLYLzy9Q5meFUmhhiXfnaGai96hc7Ludu3gQz8nh"), wallet.payer_keypair.pubkey(), ]} else {vec![ - pubkey!("tstUPDM1tDgRgC8KALbXQ3hJeKQQTxDywyDVvxv51Lu"), - pubkey!("tstTLYLzy9Q5meFUmhhiXfnaGai96hc7Ludu3gQz8nh"), - wallet.payer_keypair.pubkey(), + pubkey!("BU6N2Z68JPXLf247iYnHUTUv1B7p8AFWGTYkcjfeSwY8"), + pubkey!("C16ojhtyjzqenxHcg9hNjhAwZhdLJrCBKavfc4gqa1v3"), + pubkey!("4vdhzpPYPABJe9WvZA8pFzdbzYaHrj7yNwDQmjBCtts5"), ]}, }, ], @@ -258,7 +258,7 @@ impl<'a> Configuration<'a> { }, AccountOwner::MultiSig(msig_name, governed_address) => { let msig = self.multi_sigs.iter().find(|v| v.name == *msig_name) - .ok_or(StateError::UnknownMultiSig(msig_name.to_string()))?; + .ok_or_else(|| StateError::UnknownMultiSig(msig_name.to_string()))?; if let Some(governed) = governed_address { if !msig.governed_accounts.iter().any(|v| v == governed) { return Err(StateError::UnknownMultiSigGoverned(msig_name.to_string(), *governed).into()); @@ -303,7 +303,7 @@ fn process_environment(wallet: &Wallet, client: &Client, cfg: &Configuration) -> println!("Install MultiSig accounts"); for msig in &cfg.multi_sigs { - msig::setup_msig(wallet, client, &executor, &msig)?; + msig::setup_msig(wallet, client, &executor, msig)?; } // ----------- Check or create community mint ---------------------- @@ -1604,8 +1604,8 @@ fn main() { "COMMUNITY" => (REALM_NAME, wallet.community_pubkey, wallet.community_pubkey), "EMERGENCY" => (REALM_NAME, wallet.community_pubkey, wallet.governance_program_id), name if name.starts_with("MSIG_") => { - if name.contains(".") { - let (msig_name, governed) = name.split_once(".").unwrap(); + if name.contains('.') { + let (msig_name, governed) = name.split_once('.').unwrap(); let msig_mint = cfg.account_by_seed(msig_name, &spl_token::id()); (msig_name, msig_mint, Pubkey::try_from(governed).unwrap()) } else { diff --git a/launch-script/src/msig.rs b/launch-script/src/msig.rs index b113646..34d0485 100644 --- a/launch-script/src/msig.rs +++ b/launch-script/src/msig.rs @@ -228,7 +228,7 @@ pub fn setup_msig(wallet: &Wallet, client: &Client, executor: &TransactionExecut )?; for governed in &msig.governed_accounts { - let governance = msig_realm.governance(&governed); + let governance = msig_realm.governance(governed); executor.check_and_create_object(&format!("{} Governance for {}", msig.name, governed), governance.get_data()?, |_| {Ok(None)}, || {