Skip to content

Commit

Permalink
style: lint on all targets
Browse files Browse the repository at this point in the history
This lets us run clippy on our test suite and other targets.
  • Loading branch information
kaimen-sano committed Jan 6, 2024
1 parent 9606bc7 commit a14486d
Show file tree
Hide file tree
Showing 24 changed files with 281 additions and 309 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-fmt-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --locked -- -D warnings
args: --locked --all-targets -- -D warnings

#- name: Run cosmwasm linter
# run: cargo dylint cw_lint --workspace
Expand Down
168 changes: 84 additions & 84 deletions contracts/liquidity_hub/fee_collector/src/tests/integration.rs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions contracts/liquidity_hub/fee_distributor/src/tests/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ fn test_create_genesis_epoch() {
};
let epoch_config = EpochConfig {
duration: Uint64::new(86_400_000_000_000u64), // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
};

robot.env.block.time = Timestamp::from_nanos(1678802300_000000000u64); // before genesis epoch
robot.env.block.time = Timestamp::from_nanos(1_678_802_300_000_000_000_u64); // before genesis epoch

robot
.instantiate(
Expand All @@ -63,7 +63,7 @@ fn test_create_genesis_epoch() {
});

// set the time at genesis epoch
robot.env.block.time = Timestamp::from_nanos(1678802400_000000000u64); // before genesis epoch
robot.env.block.time = Timestamp::from_nanos(1_678_802_400_000_000_000_u64); // before genesis epoch

robot.create_new_epoch(mock_info("owner", &[]), |res| {
// all good now
Expand Down
2 changes: 1 addition & 1 deletion contracts/liquidity_hub/fee_distributor/src/tests/robot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl TestingRobot {
grace_period: Uint64::new(2),
epoch_config: EpochConfig {
duration: Uint64::new(86_400_000_000_000u64), // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
},
distribution_asset: AssetInfo::NativeToken {
denom: "uwhale".to_string(),
Expand Down
8 changes: 4 additions & 4 deletions contracts/liquidity_hub/fee_distributor/src/tests/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn instantiate_successfully() {
};
let epoch_config = EpochConfig {
duration: Uint64::new(86_400_000_000_000u64), // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
};

robot
Expand Down Expand Up @@ -48,7 +48,7 @@ fn instantiate_unsuccessfully() {
};
let epoch_config = EpochConfig {
duration: Uint64::new(86_400_000_000_000u64), // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
};

robot.instantiate_err(
Expand Down Expand Up @@ -78,7 +78,7 @@ fn instantiate_unsuccessfully() {
Uint64::one(),
EpochConfig {
duration: invalid_epoch_duration, // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
},
distribution_asset.clone(),
);
Expand All @@ -95,7 +95,7 @@ fn test_update_config() {
grace_period: Uint64::new(3),
epoch_config: EpochConfig {
duration: Uint64::new(86_400_000_000_000u64), // a day
genesis_epoch: Uint64::new(1678802400_000000000u64), // March 14, 2023 2:00:00 PM
genesis_epoch: Uint64::new(1_678_802_400_000_000_000_u64), // March 14, 2023 2:00:00 PM
},
distribution_asset: AssetInfo::NativeToken {
denom: "uwhale".to_string(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ mod tests {
incentive_factory_addr: Some("new_factory".to_string()),
owner: Some("new_owner".to_string()),
},
&vec![],
&[],
);

let err = result.unwrap_err().downcast::<ContractError>().unwrap();
Expand All @@ -253,7 +253,7 @@ mod tests {
incentive_factory_addr: Some("new_factory".to_string()),
owner: Some("new_owner".to_string()),
},
&vec![],
&[],
)
.unwrap();

Expand Down
Loading

0 comments on commit a14486d

Please sign in to comment.