Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove checks in simple lock legacy SC #923

Merged
merged 4 commits into from
Jun 19, 2024

Merge branch 'rc/v3.0' into simple-lock-legacy-remove-checks

07f1db2
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Remove checks in simple lock legacy SC #923

Merge branch 'rc/v3.0' into simple-lock-legacy-remove-checks
07f1db2
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Jun 19, 2024 in 0s

reviewdog [clippy] report

reported by reviewdog 🐶

Findings (0)
Filtered Findings (11)

energy-integration/governance-v2/tests/gov_test_setup/mod.rs|38 col 12| warning: struct Payment is never constructed
--> energy-integration/governance-v2/tests/gov_test_setup/mod.rs:38:12
|
38 | pub struct Payment {
| ^^^^^^^
|
= note: Payment has a derived impl for the trait Clone, but this is intentionally ignored during dead code analysis
= note: #[warn(dead_code)] on by default
locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs|60 col 12| warning: fields owner, second_user, and farm_locked_wrapper are never read
--> locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs:68:9
|
60 | pub struct ProxySetup<ProxyObjBuilder, PairObjBuilder, FarmLockedObjBuilder, SimpleLockObjBuilder>
| ---------- fields in this struct
...
68 | pub owner: Address,
| ^^^^^
69 | pub first_user: Address,
70 | pub second_user: Address,
| ^^^^^^^^^^^
...
73 | pub farm_locked_wrapper:
| ^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs|60 col 12| warning: field second_user is never read
--> locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs:70:9
|
60 | pub struct ProxySetup<ProxyObjBuilder, PairObjBuilder, FarmLockedObjBuilder, SimpleLockObjBuilder>
| ---------- field in this struct
...
70 | pub second_user: Address,
| ^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
dex/fuzz/src/fuzz_data.rs|146 col 16| warning: field owner_address is never read
--> dex/fuzz/src/fuzz_data.rs:154:13
|
146 | pub struct FuzzerData<PairObjBuilder, FarmObjBuilder, FactoryObjBuilder, PriceDiscObjBuilder>
| ---------- field in this struct
...
154 | pub owner_address: Address,
| ^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
dex/fuzz/src/fuzz_data.rs|587 col 16| warning: field locking_sc_address is never read
--> dex/fuzz/src/fuzz_data.rs:593:13
|
587 | pub struct PriceDiscSetup
| -------------- field in this struct
...
593 | pub locking_sc_address: Address,
| ^^^^^^^^^^^^^^^^^^
dex/fuzz/src/fuzz_factory.rs|151 col 17| warning: assigning the result of Clone::clone() may be inefficient
--> dex/fuzz/src/fuzz_factory.rs:151:17
|
151 | amount_to_unlock = locked_token_before.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use clone_from(): amount_to_unlock.clone_from(&locked_token_before)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: #[warn(clippy::assigning_clones)] on by default
dex/fuzz/src/fuzz_farm.rs|71 col 59| warning: unnecessary use of get(&caller.address).is_some()
--> dex/fuzz/src/fuzz_farm.rs:71:59
|
71 | if merge_farm_positions && farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: contains_key(&caller.address)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
= note: #[warn(clippy::unnecessary_get_then_check)] on by default
dex/fuzz/src/fuzz_farm.rs|243 col 35| warning: unnecessary use of get(&caller.address).is_some()
--> dex/fuzz/src/fuzz_farm.rs:243:35
|
243 | if farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: contains_key(&caller.address)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
dex/fuzz/src/fuzz_farm.rs|353 col 35| warning: unnecessary use of get(&caller.address).is_some()
--> dex/fuzz/src/fuzz_farm.rs:353:35
|
353 | if farm_setup.farmer_info.get(&caller.address).is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: contains_key(&caller.address)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
dex/fuzz/src/fuzz_price_discovery.rs|326 col 17| warning: assigning the result of Clone::clone() may be inefficient
--> dex/fuzz/src/fuzz_price_discovery.rs:326:17
|
326 | redeem_token_amount_in = redeem_token_before.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use clone_from(): redeem_token_amount_in.clone_from(&redeem_token_before)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
dex/pair/tests/pair_rs_test.rs|1392 col 21| warning: useless use of vec!
--> dex/pair/tests/pair_rs_test.rs:1392:21
|
1392 | let transfers = vec![
| ________________^
1393 | | TxTokenTransfer {
1394 | | token_identifier: LOCKED_TOKEN_ID.to_vec(),
1395 | | nonce: 1,
... |
1402 | | },
1403 | | ];
| |
^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: #[warn(clippy::useless_vec)] on by default
help: you can use an array directly
|
1392 ~ let transfers = [TxTokenTransfer {
1393 + token_identifier: LOCKED_TOKEN_ID.to_vec(),
1394 + nonce: 1,
1395 + value: rust_biguint!(500_000),
1396 + },
1397 + TxTokenTransfer {
1398 + token_identifier: MEX_TOKEN_ID.to_vec(),
1399 + nonce: 0,
1400 + value: rust_biguint!(500_000),
1401 ~ }];
|