Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
Also updates just lint to match basic.yml
  • Loading branch information
ismellike committed Jul 11, 2024
1 parent 8c945ac commit 2951f8c
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
3 changes: 2 additions & 1 deletion ci/bootstrap-env/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ fn main() -> Result<()> {
);

// Persist contract code_ids in local.yaml so we can use SKIP_CONTRACT_STORE locally to avoid having to re-store them again
cfg.contract_deploy_info = orc.contract_map.deploy_info().clone();
cfg.contract_deploy_info
.clone_from(orc.contract_map.deploy_info());
fs::write(
"ci/configs/cosm-orc/local.yaml",
serde_yaml::to_string(&cfg)?,
Expand Down
3 changes: 2 additions & 1 deletion ci/integration-tests/src/helpers/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ fn global_setup() -> Cfg {
.unwrap();
save_gas_report(&orc, &gas_report_dir);
// persist stored code_ids in CONFIG, so we can reuse for all tests
cfg.contract_deploy_info = orc.contract_map.deploy_info().clone();
cfg.contract_deploy_info
.clone_from(orc.contract_map.deploy_info());
}

Cfg {
Expand Down
4 changes: 2 additions & 2 deletions contracts/external/cw721-roles/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ pub fn execute_update_token_role(
let mut token = contract.tokens.load(deps.storage, &token_id)?;

// Update role with new value
token.extension.role = role.clone();
token.extension.role.clone_from(&role);
contract.tokens.save(deps.storage, &token_id, &token)?;

Ok(Response::default()
Expand All @@ -341,7 +341,7 @@ pub fn execute_update_token_uri(
let mut token = contract.tokens.load(deps.storage, &token_id)?;

// Set new token URI
token.token_uri = token_uri.clone();
token.token_uri.clone_from(&token_uri);
contract.tokens.save(deps.storage, &token_id, &token)?;

Ok(Response::new()
Expand Down
2 changes: 0 additions & 2 deletions contracts/proposal/dao-proposal-multiple/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::u64;

use cosmwasm_std::StdError;
use cw_hooks::HookError;
use cw_utils::ParseReplyError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ where
vec![TestMultipleChoiceVote {
voter: "bluenote".to_string(),
position: MultipleChoiceVote { option_id: 0 },
weight: Uint128::new(u128::max_value()),
weight: Uint128::new(u128::MAX),
should_execute: ShouldExecute::Yes,
}],
VotingStrategy::SingleChoice {
Expand All @@ -414,7 +414,7 @@ where
TestMultipleChoiceVote {
voter: "bob".to_string(),
position: MultipleChoiceVote { option_id: 1 },
weight: Uint128::new(u128::max_value() - 1),
weight: Uint128::new(u128::MAX - 1),
should_execute: ShouldExecute::Yes,
},
],
Expand Down Expand Up @@ -463,7 +463,7 @@ where
vec![TestMultipleChoiceVote {
voter: "bluenote".to_string(),
position: MultipleChoiceVote { option_id: 2 }, // the last index is none of the above
weight: Uint128::new(u64::max_value().into()),
weight: Uint128::new(u64::MAX.into()),
should_execute: ShouldExecute::Yes,
}],
VotingStrategy::SingleChoice {
Expand All @@ -479,7 +479,7 @@ where
vec![TestMultipleChoiceVote {
voter: "bluenote".to_string(),
position: MultipleChoiceVote { option_id: 2 },
weight: Uint128::new(u64::max_value().into()),
weight: Uint128::new(u64::MAX.into()),
should_execute: ShouldExecute::Yes,
}],
VotingStrategy::SingleChoice {
Expand Down
2 changes: 0 additions & 2 deletions contracts/proposal/dao-proposal-single/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::u64;

use cosmwasm_std::StdError;
use cw_hooks::HookError;
use cw_utils::ParseReplyError;
Expand Down
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test:
cargo test

lint:
cargo +nightly clippy --all-targets -- -D warnings
cargo +stable fmt --all -- --check
cargo +stable clippy --all-targets -- -D warnings

gen: build gen-schema

Expand Down
6 changes: 3 additions & 3 deletions packages/cw-orch/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use cw_orch::{
};

use crate::{
Cw20Stake, Cw20StakeExternalRewards, Cw20StakeRewardDistributor, DaoDaoCore,DaoVotingCw20Balance,
Cw20Stake, Cw20StakeExternalRewards, Cw20StakeRewardDistributor, DaoDaoCore,
DaoPreProposeApprovalSingle, DaoPreProposeApprover, DaoPreProposeMultiple, DaoPreProposeSingle,
DaoProposalCondorcet, DaoProposalHookCounter, DaoProposalMultiple, DaoProposalSingle,
DaoProposalSudo, DaoTestCustomFactory, DaoVotingCw20Staked, DaoVotingCw4, DaoVotingCw721Roles,
DaoVotingCw721Staked, DaoVotingTokenStaked,
DaoProposalSudo, DaoTestCustomFactory, DaoVotingCw20Balance, DaoVotingCw20Staked, DaoVotingCw4,
DaoVotingCw721Roles, DaoVotingCw721Staked, DaoVotingTokenStaked,
};

pub const DUMMY_CHAIN_INFO: ChainInfo = ChainInfo {
Expand Down
12 changes: 6 additions & 6 deletions packages/dao-testing/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where
vec![TestSingleChoiceVote {
voter: "ekez".to_string(),
position: Vote::Yes,
weight: Uint128::new(u128::max_value()),
weight: Uint128::new(u128::MAX),
should_execute: ShouldExecute::Yes,
}],
Threshold::AbsolutePercentage {
Expand All @@ -86,7 +86,7 @@ where
vec![TestSingleChoiceVote {
voter: "ekez".to_string(),
position: Vote::Yes,
weight: Uint128::new(u128::max_value()),
weight: Uint128::new(u128::MAX),
should_execute: ShouldExecute::Yes,
}],
Threshold::AbsolutePercentage {
Expand All @@ -107,7 +107,7 @@ where
TestSingleChoiceVote {
voter: "ekez".to_string(),
position: Vote::Yes,
weight: Uint128::new(u128::max_value() - 1),
weight: Uint128::new(u128::MAX - 1),
should_execute: ShouldExecute::Yes,
},
],
Expand Down Expand Up @@ -148,7 +148,7 @@ where
percentage: PercentageThreshold::Percent(Decimal::percent(99)),
},
Status::Open,
Some(Uint128::from(u128::max_value())),
Some(Uint128::from(u128::MAX)),
);
}

Expand All @@ -160,7 +160,7 @@ where
vec![TestSingleChoiceVote {
voter: "ekez".to_string(),
position: Vote::Abstain,
weight: Uint128::new(u64::max_value().into()),
weight: Uint128::new(u64::MAX.into()),
should_execute: ShouldExecute::Yes,
}],
Threshold::AbsolutePercentage {
Expand All @@ -177,7 +177,7 @@ where
vec![TestSingleChoiceVote {
voter: "ekez".to_string(),
position: Vote::Abstain,
weight: Uint128::new(u64::max_value().into()),
weight: Uint128::new(u64::MAX.into()),
should_execute: ShouldExecute::Yes,
}],
Threshold::ThresholdQuorum {
Expand Down

0 comments on commit 2951f8c

Please sign in to comment.