diff --git a/.github/workflows/rust_basic.yml b/.github/workflows/rust_basic.yml index 742285708..1746f3915 100644 --- a/.github/workflows/rust_basic.yml +++ b/.github/workflows/rust_basic.yml @@ -32,7 +32,7 @@ jobs: key: ${{ runner.os }}-cargo-${{ inputs.workspace }}-$GITHUB_SHA restore-keys: ${{ runner.os }}-cargo-${{ inputs.workspace }} - name: Rust lint - run: RUSTFLAGS="-Dwarnings" cargo clippy --workspace -- -D warnings --A deprecated + run: cargo clippy --workspace -- -D warnings --A deprecated working-directory: smart-contracts/${{ inputs.workspace }}/${{ inputs.target }} - name: Rust format check run: cargo fmt --all -- --check diff --git a/.github/workflows/test_tube_osmosis.yml b/.github/workflows/test_tube_osmosis.yml index 2a99400ce..7258d87a7 100644 --- a/.github/workflows/test_tube_osmosis.yml +++ b/.github/workflows/test_tube_osmosis.yml @@ -48,6 +48,9 @@ jobs: smart-contracts/osmosis/**/target key: ${{ runner.os }}-cargo-osmosis-$GITHUB_SHA restore-keys: ${{ runner.os }}-cargo-osmosis + - name: Rust lint + run: cargo clippy --features test-tube --all-targets -- -D warnings --A deprecated + working-directory: smart-contracts/osmosis/contracts/dex-router-osmosis - name: Build merkle-incentives run: cargo test-tube-build working-directory: smart-contracts/osmosis/contracts/merkle-incentives diff --git a/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/initialize/mod.rs b/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/initialize/mod.rs index 1d827d1f3..e19f2f311 100644 --- a/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/initialize/mod.rs +++ b/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/initialize/mod.rs @@ -55,7 +55,7 @@ pub fn single_cl_pool_fixture( let pm = PoolManager::new(app); let cl = ConcentratedLiquidity::new(app); - let gov = GovWithAppAccess::new(&app); + let gov = GovWithAppAccess::new(app); gov.propose_and_execute( CreateConcentratedLiquidityPoolsProposal::TYPE_URL.to_string(), @@ -65,12 +65,12 @@ pub fn single_cl_pool_fixture( pool_records: vec![PoolRecord { denom0: cl_pool.denom0.clone(), denom1: cl_pool.denom1.clone(), - tick_spacing: cl_pool.tick_spacing.clone(), + tick_spacing: cl_pool.tick_spacing, spread_factor: cl_pool.spread_factor.clone(), }], }, admin.address(), - &admin, + admin, ) .unwrap(); @@ -110,7 +110,7 @@ pub fn single_cl_pool_fixture( token_min_amount0: "1".to_string(), token_min_amount1: "1".to_string(), }, - &admin, + admin, ) .unwrap(); @@ -199,18 +199,18 @@ pub fn single_gamm_pool_fixture( .unwrap(), }, ], - &admin, + admin, ) .unwrap(); let ty = "pool_created"; - let keys = vec!["pool_id"]; + let key = "pool_id"; let pool_id: u64 = response .events .iter() .filter(|event| event.ty == ty) .flat_map(|event| event.attributes.clone()) - .filter(|attribute| keys.contains(&attribute.key.as_str())) + .filter(|attribute| key == attribute.key.as_str()) .collect::>() .first() .unwrap() @@ -220,7 +220,7 @@ pub fn single_gamm_pool_fixture( let _ = MsgJoinPool { sender: admin.address().to_string(), - pool_id: pool_id.clone(), + pool_id, share_out_amount: "100".to_string(), token_in_maxs: vec![ Coin { @@ -303,7 +303,7 @@ pub fn setup_paths( admin: &SigningAccount, ) { wasm.execute( - &contract_address.to_string(), + contract_address.as_ref(), &ExecuteMsg::SetPath { path, bidirectional: true, @@ -339,7 +339,7 @@ pub fn perform_swap( admin: &SigningAccount, ) -> Result, osmosis_test_tube::RunnerError> { wasm.execute( - &contract_address.to_string(), + contract_address.as_ref(), &ExecuteMsg::Swap { out_denom: ask_denom, path: Some(path.first().unwrap().clone()), diff --git a/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/integration.rs b/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/integration.rs index 5af1f04bb..2dbff1237 100644 --- a/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/integration.rs +++ b/smart-contracts/osmosis/contracts/dex-router-osmosis/tests/integration.rs @@ -44,7 +44,7 @@ fn default_init_works() { let resp: BestPathForPairResponse = wasm .query( - &contract_address.to_string(), + contract_address.as_ref(), &QueryMsg::BestPathForPair { offer: Coin::new( Uint128::from(100000000u128).into(), @@ -152,7 +152,7 @@ fn test_set_and_remove_path() { ); let _ = wasm .execute( - &contract_address.to_string(), + contract_address.as_ref(), &ExecuteMsg::RemovePath { path: vec![pools.first().unwrap().pool], bidirectional: true,