From f9114d4aedc450a158d7e54439e1eee346cd4ec1 Mon Sep 17 00:00:00 2001 From: Supanat Potiwarakorn Date: Tue, 10 Sep 2024 13:39:02 +0700 Subject: [PATCH] fix lint --- contracts/transmuter/Cargo.toml | 22 ++++++++++++------- .../src/test/cases/units/add_new_assets.rs | 2 +- contracts/transmuter/src/test/test_env.rs | 2 ++ packages/transmuter_math/src/errors.rs | 1 - 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/contracts/transmuter/Cargo.toml b/contracts/transmuter/Cargo.toml index 46075b6..8ba3e47 100644 --- a/contracts/transmuter/Cargo.toml +++ b/contracts/transmuter/Cargo.toml @@ -5,9 +5,9 @@ name = "transmuter" version = "3.2.0" exclude = [ - # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. - "contract.wasm", - "hash.txt", + # Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. + "contract.wasm", + "hash.txt", ] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -42,19 +42,25 @@ optimize = """docker run --rm -v "$(pwd)":/code \ """ [dependencies] -cosmwasm-schema = {workspace = true} -cosmwasm-std = {workspace = true, features = ["cosmwasm_1_1"]} +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true, features = ["cosmwasm_1_1"] } cosmwasm-storage = "1.3.1" cw-storage-plus = "1.1.0" cw2 = "1.1.0" osmosis-std = "0.22.0" schemars = "0.8.12" -serde = {version = "1.0.183", default-features = false, features = ["derive"]} +serde = { version = "1.0.183", default-features = false, features = ["derive"] } sylvia = "0.10.1" -thiserror = {version = "1.0.44"} -transmuter_math = {version = "1.0.0", path = "../../packages/transmuter_math"} +thiserror = { version = "1.0.44" } +transmuter_math = { version = "1.0.0", path = "../../packages/transmuter_math" } [dev-dependencies] itertools = "0.12.0" osmosis-test-tube = "22.1.0" rstest = "0.18.2" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = [ + 'cfg(tarpaulin)', + 'cfg(tarpaulin_include)', +] } diff --git a/contracts/transmuter/src/test/cases/units/add_new_assets.rs b/contracts/transmuter/src/test/cases/units/add_new_assets.rs index 6d70a1d..4d46f4e 100644 --- a/contracts/transmuter/src/test/cases/units/add_new_assets.rs +++ b/contracts/transmuter/src/test/cases/units/add_new_assets.rs @@ -35,7 +35,7 @@ fn test_add_new_assets() { .build(&app); // add new asset - let denoms = vec![ + let denoms = [ "denom2".to_string(), "denom3".to_string(), "denom4".to_string(), diff --git a/contracts/transmuter/src/test/test_env.rs b/contracts/transmuter/src/test/test_env.rs index a489ce3..9390cff 100644 --- a/contracts/transmuter/src/test/test_env.rs +++ b/contracts/transmuter/src/test/test_env.rs @@ -28,6 +28,7 @@ use super::modules::cosmwasm_pool::CosmwasmPool; pub struct TestEnv<'a> { pub app: &'a OsmosisTestApp, + #[allow(dead_code)] pub creator: SigningAccount, pub contract: TransmuterContract<'a>, pub accounts: HashMap, @@ -137,6 +138,7 @@ impl TestEnvBuilder { pub struct TransmuterContract<'a> { app: &'a OsmosisTestApp, + #[allow(dead_code)] pub code_id: u64, pub pool_id: u64, pub contract_addr: String, diff --git a/packages/transmuter_math/src/errors.rs b/packages/transmuter_math/src/errors.rs index 4a06e87..33e79dd 100644 --- a/packages/transmuter_math/src/errors.rs +++ b/packages/transmuter_math/src/errors.rs @@ -1,5 +1,4 @@ use cosmwasm_std::{CheckedFromRatioError, DivideByZeroError, OverflowError}; -use thiserror; #[derive(thiserror::Error, Debug, PartialEq)] pub enum TransmuterMathError {