diff --git a/core/bin/block_revert/src/main.rs b/core/bin/block_revert/src/main.rs index b9ead8d12e..48b830f193 100644 --- a/core/bin/block_revert/src/main.rs +++ b/core/bin/block_revert/src/main.rs @@ -230,7 +230,7 @@ async fn main() -> anyhow::Result<()> { let key_without_prefix = opt .operator_private_key .strip_prefix("0x") - .unwrap_or_else(|| opt.operator_private_key.as_str()); + .unwrap_or(opt.operator_private_key.as_str()); let contracts = ContractsConfig::from_env(); let eth_client_config = ETHClientConfig::from_env(); diff --git a/core/bin/data_restore/src/inmemory_storage_interactor.rs b/core/bin/data_restore/src/inmemory_storage_interactor.rs index 6f1050332d..264cbef4e0 100644 --- a/core/bin/data_restore/src/inmemory_storage_interactor.rs +++ b/core/bin/data_restore/src/inmemory_storage_interactor.rs @@ -92,6 +92,7 @@ impl InMemoryStorageInteractor { _withdrawals: &[WithdrawalEvent], _pending_withdrawals: &[WithdrawalPendingEvent], ) { + // We don't use it for testing right now } pub(crate) fn load_committed_events_state(&self) -> Vec { diff --git a/core/bin/prover/src/plonk_step_by_step_prover.rs b/core/bin/prover/src/plonk_step_by_step_prover.rs index 19e61e1637..e0e43a9e78 100644 --- a/core/bin/prover/src/plonk_step_by_step_prover.rs +++ b/core/bin/prover/src/plonk_step_by_step_prover.rs @@ -119,8 +119,8 @@ impl PlonkStepByStepProver { self.precomputed_sample_proofs .single_proofs .iter() - .cloned() - .take(proofs_to_pad), + .take(proofs_to_pad) + .cloned(), ) .collect(); diff --git a/core/bin/zksync_api/src/api_server/event_notify/operation_notifier.rs b/core/bin/zksync_api/src/api_server/event_notify/operation_notifier.rs index defb1affff..b03a0a57d6 100644 --- a/core/bin/zksync_api/src/api_server/event_notify/operation_notifier.rs +++ b/core/bin/zksync_api/src/api_server/event_notify/operation_notifier.rs @@ -95,8 +95,7 @@ impl OperationNotifier { let updated_accounts: Vec = block .block_transactions .iter() - .map(|exec_op| exec_op.get_updated_account_ids()) - .flatten() + .flat_map(|exec_op| exec_op.get_updated_account_ids()) .collect(); for id in updated_accounts { diff --git a/core/bin/zksync_api/src/api_server/rest/v01/api_decl.rs b/core/bin/zksync_api/src/api_server/rest/v01/api_decl.rs index 1b6ced350c..b9b8f8048e 100644 --- a/core/bin/zksync_api/src/api_server/rest/v01/api_decl.rs +++ b/core/bin/zksync_api/src/api_server/rest/v01/api_decl.rs @@ -282,10 +282,10 @@ impl ApiV01 { eth_tx_hash: H256, ) -> Result, anyhow::Error> { let mut storage = self.connection_pool.access_storage().await?; - Ok(storage + storage .chain() .mempool_schema() .get_pending_operation_by_hash(eth_tx_hash) - .await?) + .await } } diff --git a/core/bin/zksync_api/src/lib.rs b/core/bin/zksync_api/src/lib.rs index 768f2ebd5e..6b4f451b86 100644 --- a/core/bin/zksync_api/src/lib.rs +++ b/core/bin/zksync_api/src/lib.rs @@ -1,4 +1,5 @@ #![recursion_limit = "256"] +#![allow(clippy::derive_partial_eq_without_eq, clippy::needless_question_mark)] pub mod api_server; pub mod eth_checker; diff --git a/core/bin/zksync_core/src/committer/aggregated_committer.rs b/core/bin/zksync_core/src/committer/aggregated_committer.rs index 06c5256e92..c2b9cecbe8 100644 --- a/core/bin/zksync_core/src/committer/aggregated_committer.rs +++ b/core/bin/zksync_core/src/committer/aggregated_committer.rs @@ -28,8 +28,8 @@ fn create_new_commit_operation( ) -> Option { let new_blocks = new_blocks .iter() - .cloned() .take(max_blocks_to_commit) + .cloned() .collect::>(); let any_block_commit_deadline_triggered = { let block_commit_deadline_seconds = block_commit_deadline.as_secs() as i64; @@ -157,8 +157,8 @@ fn create_execute_blocks_operation( ) -> Option { let proven_non_executed_block = proven_non_executed_block .iter() - .cloned() .take(max_blocks_to_execute) + .cloned() .collect::>(); let any_block_execute_deadline_triggered = { let block_execute_deadline_seconds = block_execute_deadline.as_secs() as i64; diff --git a/core/bin/zksync_eth_sender/src/lib.rs b/core/bin/zksync_eth_sender/src/lib.rs index 0f22e9c3fd..c2b87af698 100644 --- a/core/bin/zksync_eth_sender/src/lib.rs +++ b/core/bin/zksync_eth_sender/src/lib.rs @@ -2,6 +2,7 @@ //! occurring in `ZKSync` with the Ethereum blockchain by creating //! transactions from the operations, sending them and ensuring that //! every transaction is executed successfully and confirmed. +#![allow(clippy::derive_partial_eq_without_eq)] // Built-in deps use std::collections::VecDeque; diff --git a/core/bin/zksync_eth_sender/src/tests/mod.rs b/core/bin/zksync_eth_sender/src/tests/mod.rs index c0515fef98..516cf911c1 100644 --- a/core/bin/zksync_eth_sender/src/tests/mod.rs +++ b/core/bin/zksync_eth_sender/src/tests/mod.rs @@ -285,7 +285,7 @@ async fn operation_commitment_workflow() { .ethereum .get_mock() .unwrap() - .assert_sent(&expected_tx.used_tx_hashes[0].as_bytes().to_vec()) + .assert_sent(expected_tx.used_tx_hashes[0].as_bytes()) .await; // Increment block, make the transaction look successfully executed, and process the @@ -391,7 +391,7 @@ async fn stuck_transaction() { .ethereum .get_mut_mock() .unwrap() - .assert_sent(&expected_sent_tx.hash.as_bytes().to_vec()) + .assert_sent(expected_sent_tx.hash.as_bytes()) .await; // Increment block, make the transaction look successfully executed, and process the @@ -525,7 +525,7 @@ async fn operations_order() { .ethereum .get_mock() .unwrap() - .assert_sent(¤t_tx_hash.as_bytes().to_vec()) + .assert_sent(current_tx_hash.as_bytes()) .await; // Mark the tx as successfully @@ -802,7 +802,7 @@ async fn confirmations_independence() { .ethereum .get_mut_mock() .unwrap() - .assert_sent(&next_tx.hash.as_bytes().to_vec()) + .assert_sent(next_tx.hash.as_bytes()) .await; // Add a confirmation for a *stuck* transaction. @@ -946,7 +946,7 @@ async fn concurrent_operations_order() { .ethereum .get_mock() .unwrap() - .assert_sent(¤t_tx_hash.as_bytes().to_vec()) + .assert_sent(current_tx_hash.as_bytes()) .await; // Mark the tx as successfully diff --git a/core/bin/zksync_event_listener/src/monitor.rs b/core/bin/zksync_event_listener/src/monitor.rs index 430a828c07..19a155a3f0 100644 --- a/core/bin/zksync_event_listener/src/monitor.rs +++ b/core/bin/zksync_event_listener/src/monitor.rs @@ -52,6 +52,7 @@ impl Handler for ServerMonitor { impl Handler for ServerMonitor { type Result = (); + #[allow(clippy::unnecessary_to_owned)] fn handle(&mut self, msg: NewEvents, ctx: &mut Self::Context) { if msg.0.as_ref().is_empty() { vlog::info!("Server monitor received empty array of events"); diff --git a/core/lib/api_client/src/lib.rs b/core/lib/api_client/src/lib.rs index 2a7079e6c3..9ad2d64d01 100644 --- a/core/lib/api_client/src/lib.rs +++ b/core/lib/api_client/src/lib.rs @@ -1 +1,2 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub mod rest; diff --git a/core/lib/api_types/src/lib.rs b/core/lib/api_types/src/lib.rs index c9031d2d9d..4afff88ada 100644 --- a/core/lib/api_types/src/lib.rs +++ b/core/lib/api_types/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub use either::Either; use serde::{Deserialize, Serialize}; use zksync_types::{ diff --git a/core/lib/circuit/src/lib.rs b/core/lib/circuit/src/lib.rs index 000c232222..0a53ab62a3 100644 --- a/core/lib/circuit/src/lib.rs +++ b/core/lib/circuit/src/lib.rs @@ -1,3 +1,8 @@ +#![allow( + clippy::map_flatten, + clippy::unnecessary_to_owned, + clippy::derive_partial_eq_without_eq +)] pub mod account; pub mod allocated_structures; pub mod circuit; diff --git a/core/lib/config/src/lib.rs b/core/lib/config/src/lib.rs index d12ee101bc..3369b6e2c8 100644 --- a/core/lib/config/src/lib.rs +++ b/core/lib/config/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub use crate::configs::{ ApiConfig, ChainConfig, ContractsConfig, DBConfig, DevLiquidityTokenWatcherConfig, ETHClientConfig, ETHSenderConfig, ETHWatchConfig, EventListenerConfig, diff --git a/core/lib/crypto/src/lib.rs b/core/lib/crypto/src/lib.rs index 573ff3d636..05b9ba2c91 100644 --- a/core/lib/crypto/src/lib.rs +++ b/core/lib/crypto/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] //! `zksync_crypto` is a crate containing essential zkSync cryptographic primitives, such as private keys and hashers. use crate::franklin_crypto::{ diff --git a/core/lib/eth_client/src/clients/http_client.rs b/core/lib/eth_client/src/clients/http_client.rs index 49a023a04d..85fc2b4436 100644 --- a/core/lib/eth_client/src/clients/http_client.rs +++ b/core/lib/eth_client/src/clients/http_client.rs @@ -461,7 +461,7 @@ impl ETHDirectClient { }; #[cfg(feature = "with-metrics")] metrics::histogram!("eth_client.direct.get_tx_status", start.elapsed()); - Ok(res?) + res } pub async fn logs(&self, filter: Filter) -> anyhow::Result> { diff --git a/core/lib/eth_client/src/lib.rs b/core/lib/eth_client/src/lib.rs index fc676ce09a..39963a08d4 100644 --- a/core/lib/eth_client/src/lib.rs +++ b/core/lib/eth_client/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub mod clients; pub mod ethereum_gateway; pub use clients::http_client::ETHDirectClient; diff --git a/core/lib/eth_signer/src/lib.rs b/core/lib/eth_signer/src/lib.rs index 2141699848..0711499dca 100644 --- a/core/lib/eth_signer/src/lib.rs +++ b/core/lib/eth_signer/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::derive_partial_eq_without_eq)] + #[macro_use] extern crate serde_derive; diff --git a/core/lib/state/src/lib.rs b/core/lib/state/src/lib.rs index e801ff5e08..feef2cd6b7 100644 --- a/core/lib/state/src/lib.rs +++ b/core/lib/state/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub mod handler; pub mod state; diff --git a/core/lib/storage/sqlx-data.json b/core/lib/storage/sqlx-data.json index b1118f8f3e..2dfdc6a46d 100644 --- a/core/lib/storage/sqlx-data.json +++ b/core/lib/storage/sqlx-data.json @@ -2393,6 +2393,24 @@ }, "query": "INSERT INTO committed_nonce (account_id, nonce, block_number) VALUES ($1, $2, $3) \n ON CONFLICT (account_id) \n DO UPDATE \n SET nonce = $2, block_number = $3\n " }, + "3c7addfbdf988190fe3d6c4fe01569599e4fe7e55ed24f83e9309cbbcb0ba46c": { + "describe": { + "columns": [ + { + "name": "count", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT COUNT(*) FROM withdrawals WHERE withdrawal_tx_hash IS NULL" + }, "3e63555f8c8d341b2536bec02e1c60755888686fab50cad8dde060c3aca96f9b": { "describe": { "columns": [ @@ -2682,6 +2700,24 @@ }, "query": "\n DELETE FROM pending_block WHERE number = $1\n " }, + "45835bd8baba982b410df9a81970dfb547dd9660f6a768a1eb588ce1ee33f36f": { + "describe": { + "columns": [ + { + "name": "max", + "ordinal": 0, + "type_info": "Int8" + } + ], + "nullable": [ + null + ], + "parameters": { + "Left": [] + } + }, + "query": "SELECT MAX(withdrawal_tx_block) FROM withdrawals" + }, "45dc23ee9e4fd0bf52e2a82f3ed83210ec3a49c01b70a82bd6fac566da1a0f3b": { "describe": { "columns": [ diff --git a/core/lib/storage/src/lib.rs b/core/lib/storage/src/lib.rs index 23000a0e06..c4194894a5 100644 --- a/core/lib/storage/src/lib.rs +++ b/core/lib/storage/src/lib.rs @@ -73,6 +73,7 @@ // `sqlx` macros result in these warning being triggered. #![allow(clippy::toplevel_ref_arg, clippy::suspicious_else_formatting)] +#![allow(clippy::derive_partial_eq_without_eq, clippy::map_flatten)] // Built-in deps use std::env; diff --git a/core/lib/token_db_cache/src/lib.rs b/core/lib/token_db_cache/src/lib.rs index e6168341d9..4089c3dcda 100644 --- a/core/lib/token_db_cache/src/lib.rs +++ b/core/lib/token_db_cache/src/lib.rs @@ -146,9 +146,9 @@ impl TokenDBCache { token: TokenId, market: TokenMarketVolume, ) -> anyhow::Result<()> { - Ok(storage + storage .tokens_schema() .update_token_market_volume(token, market) - .await?) + .await } } diff --git a/core/lib/types/src/block/mod.rs b/core/lib/types/src/block/mod.rs index 9c25cf25f7..c34ab5424d 100644 --- a/core/lib/types/src/block/mod.rs +++ b/core/lib/types/src/block/mod.rs @@ -138,7 +138,7 @@ impl ExecutedOperations { /// Unlike public data, some operations may not have a witness. pub fn get_eth_witness_bytes(&self) -> Option> { self.get_executed_op() - .map(|op| op.eth_witness().unwrap_or_else(Vec::new)) + .map(|op| op.eth_witness().unwrap_or_default()) } /// Returns the list of accounts affected by the operation. diff --git a/core/lib/types/src/lib.rs b/core/lib/types/src/lib.rs index dda5525388..a70cf2db18 100644 --- a/core/lib/types/src/lib.rs +++ b/core/lib/types/src/lib.rs @@ -35,6 +35,7 @@ //! //! [`Block`]: ./block/struct.Block.html //! [`Account`]: ./account/struct.Account.html +#![allow(clippy::derive_partial_eq_without_eq)] pub mod account; pub mod aggregated_operations; diff --git a/core/lib/types/src/tx/primitives/packed_public_key.rs b/core/lib/types/src/tx/primitives/packed_public_key.rs index 3dfcc8f1f9..e5ff697f4a 100644 --- a/core/lib/types/src/tx/primitives/packed_public_key.rs +++ b/core/lib/types/src/tx/primitives/packed_public_key.rs @@ -24,7 +24,7 @@ impl PackedPublicKey { return Err(DeserializeError::IncorrectPublicKeyLength); } Ok(PackedPublicKey(PublicKey::( - edwards::Point::read(&*bytes, &JUBJUB_PARAMS as &AltJubjubBn256) + edwards::Point::read(bytes, &JUBJUB_PARAMS as &AltJubjubBn256) .map_err(DeserializeError::RestoreCurvePoint)?, ))) } diff --git a/core/lib/types/src/withdrawals.rs b/core/lib/types/src/withdrawals.rs index 1ae1191498..ac0b04845f 100644 --- a/core/lib/types/src/withdrawals.rs +++ b/core/lib/types/src/withdrawals.rs @@ -70,7 +70,7 @@ pub struct WithdrawalEvent { } #[derive(Debug, Error)] -#[clippy::allow(large-enum-variant)] +#[allow(clippy::large_enum_variant)] pub enum WithdrawalPendingParseError { #[error("Cannot parse log for Withdrawal Pending Event {0:?}")] ParseError(Log), diff --git a/core/lib/utils/src/macros.rs b/core/lib/utils/src/macros.rs index 95fd8ffa86..fd96a83bbc 100644 --- a/core/lib/utils/src/macros.rs +++ b/core/lib/utils/src/macros.rs @@ -45,7 +45,7 @@ mod tests { #[tokio::test] async fn retries_given_fut() { let mut counter = 0; - let _ = retry_opt! { + retry_opt! { CondRespond { respond: counter == 10 }.await, diff --git a/core/tests/loadnext/src/account/tx_command_executor.rs b/core/tests/loadnext/src/account/tx_command_executor.rs index 59ef901488..839080e713 100644 --- a/core/tests/loadnext/src/account/tx_command_executor.rs +++ b/core/tests/loadnext/src/account/tx_command_executor.rs @@ -109,7 +109,7 @@ impl AccountLifespan { .amount .clone() .try_into() - .unwrap_or_else(|_| u128::max_value()) + .unwrap_or(u128::MAX) .into(); let eth_tx_hash = match ethereum .deposit(self.main_token.id, amount, self.wallet.address()) diff --git a/core/tests/loadnext/src/command/tx_command.rs b/core/tests/loadnext/src/command/tx_command.rs index fd565d759f..7426a85164 100644 --- a/core/tests/loadnext/src/command/tx_command.rs +++ b/core/tests/loadnext/src/command/tx_command.rs @@ -11,7 +11,7 @@ use crate::{ /// Type of transaction. It doesn't copy the zkSync operation list, because /// it divides some transactions in subcategories (e.g. to new account / to existing account; to self / to other; etc)/ -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum TxType { Deposit, TransferToNew, @@ -92,7 +92,7 @@ impl TxType { /// Modifier to be applied to the transaction in order to make it incorrect. /// Incorrect transactions are a significant part of loadtest, because we want to ensure /// that server is resilient for all the possible kinds of user input. -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum IncorrectnessModifier { ZeroFee, IncorrectZkSyncSignature, @@ -163,7 +163,7 @@ impl IncorrectnessModifier { /// Expected outcome of transaction: /// Since we may create erroneous transactions on purpose, /// we may expect different outcomes for each transaction. -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum ExpectedOutcome { /// Transactions was successfully executed. TxSucceed, diff --git a/core/tests/loadnext/src/lib.rs b/core/tests/loadnext/src/lib.rs index c92d0edf55..ea62b1b547 100644 --- a/core/tests/loadnext/src/lib.rs +++ b/core/tests/loadnext/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::derive_partial_eq_without_eq)] pub mod account; pub mod account_pool; pub mod all; diff --git a/core/tests/loadnext/src/main.rs b/core/tests/loadnext/src/main.rs index 2ae69ac902..1debfc0153 100644 --- a/core/tests/loadnext/src/main.rs +++ b/core/tests/loadnext/src/main.rs @@ -3,7 +3,6 @@ //! In order to launch it, you must provide required environmental variables, for details see `README.md`. //! Without required variables provided, test is launched in the localhost/development mode with some hard-coded //! values to check the local zkSync deployment. - use loadnext::{config::LoadtestConfig, executor::Executor, report_collector::LoadtestResult}; #[tokio::main] diff --git a/core/tests/test_account/src/lib.rs b/core/tests/test_account/src/lib.rs index 8a98f6d354..2f26f0bdbb 100644 --- a/core/tests/test_account/src/lib.rs +++ b/core/tests/test_account/src/lib.rs @@ -182,7 +182,7 @@ impl ZkSyncAccount { *recipient, fee, fee_token, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), &self.private_key, ) .expect("Failed to sign mint nft"); @@ -227,7 +227,7 @@ impl ZkSyncAccount { token, fee_token, fee, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), time_range, &self.private_key, ) @@ -268,7 +268,7 @@ impl ZkSyncAccount { self.get_account_id() .expect("can't sign tx without account id"), *recipient, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), token_sell, token_buy, (price_sell, price_buy), @@ -301,7 +301,7 @@ impl ZkSyncAccount { self.get_account_id() .expect("can't sign tx without account id"), self.address, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), orders, amounts, fee, @@ -350,7 +350,7 @@ impl ZkSyncAccount { token_id, amount, fee, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), time_range, &self.private_key, ) @@ -391,7 +391,7 @@ impl ZkSyncAccount { *target, token_id, fee, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), time_range, &self.private_key, ) @@ -427,7 +427,7 @@ impl ZkSyncAccount { token_id, amount, fee, - nonce.unwrap_or_else(|| *stored_nonce), + nonce.unwrap_or(*stored_nonce), time_range, &self.private_key, ) @@ -454,7 +454,7 @@ impl ZkSyncAccount { let mut stored_nonce = self.nonce.lock().unwrap(); let mut close = Close { account: self.address, - nonce: nonce.unwrap_or_else(|| *stored_nonce), + nonce: nonce.unwrap_or(*stored_nonce), signature: TxSignature::default(), time_range: Default::default(), }; @@ -481,7 +481,7 @@ impl ZkSyncAccount { .unwrap() .expect("can't sign tx withoud account id"); let mut stored_nonce = self.nonce.lock().unwrap(); - let nonce = nonce.unwrap_or_else(|| *stored_nonce); + let nonce = nonce.unwrap_or(*stored_nonce); let mut change_pubkey = ChangePubKey::new_signed( account_id, diff --git a/core/tests/testkit/src/eth_account.rs b/core/tests/testkit/src/eth_account.rs index c1616f2b95..d3b90b9d36 100644 --- a/core/tests/testkit/src/eth_account.rs +++ b/core/tests/testkit/src/eth_account.rs @@ -287,7 +287,7 @@ impl EthereumAccount { pub async fn balances_to_withdraw(&self, token: Address) -> Result { let contract = self.main_contract_eth_client.main_contract(); - Ok(contract + contract .query( "getPendingBalance", (self.address, token), @@ -297,7 +297,7 @@ impl EthereumAccount { ) .await .map(u256_to_big_dec) - .map_err(|e| format_err!("Contract query fail: {}", e))?) + .map_err(|e| format_err!("Contract query fail: {}", e)) } pub async fn approve_erc20( diff --git a/core/tests/testkit/src/test_setup.rs b/core/tests/testkit/src/test_setup.rs index dd4f58e427..b15995b422 100644 --- a/core/tests/testkit/src/test_setup.rs +++ b/core/tests/testkit/src/test_setup.rs @@ -1219,12 +1219,10 @@ impl TestSetup { } async fn get_zksync_balance(&self, zksync_id: ZKSyncAccountId, token: TokenId) -> BigUint { - let result = self - .get_zksync_account_committed_state(zksync_id) + self.get_zksync_account_committed_state(zksync_id) .await .map(|(_, acc)| acc.get_balance(token)) - .unwrap_or_default(); - result + .unwrap_or_default() } pub async fn get_eth_balance(&self, eth_account_id: ETHAccountId, token: TokenId) -> BigUint { @@ -1241,11 +1239,10 @@ impl TestSetup { .expect("Failed to get erc20 balance") }; - let result = result + result + self .get_balance_to_withdraw(eth_account_id, self.tokens[&token]) - .await; - result + .await } pub async fn get_balance_to_withdraw( diff --git a/docker/data-restore/Dockerfile b/docker/data-restore/Dockerfile index c075634995..2ff1797e0c 100644 --- a/docker/data-restore/Dockerfile +++ b/docker/data-restore/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.60 +FROM rust:1.63 WORKDIR /usr/src/zksync diff --git a/docker/dev-liquidity-token-watcher/Dockerfile b/docker/dev-liquidity-token-watcher/Dockerfile index 30d1ae57a5..04513117fb 100644 --- a/docker/dev-liquidity-token-watcher/Dockerfile +++ b/docker/dev-liquidity-token-watcher/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM rust:1.55 as builder +FROM rust:1.63 as builder RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo install sccache WORKDIR /usr/src/zksync diff --git a/docker/dev-ticker/Dockerfile b/docker/dev-ticker/Dockerfile index dc12a85f37..a5d6a1cf06 100644 --- a/docker/dev-ticker/Dockerfile +++ b/docker/dev-ticker/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM rust:1.59 as builder +FROM rust:1.63 as builder RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo install sccache WORKDIR /usr/src/zksync diff --git a/docker/event-listener/Dockerfile b/docker/event-listener/Dockerfile index 988b582f90..fed617b023 100644 --- a/docker/event-listener/Dockerfile +++ b/docker/event-listener/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM rust:1.55 as builder +FROM rust:1.63 as builder RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo install sccache WORKDIR /usr/src/zksync diff --git a/docker/prover/Dockerfile b/docker/prover/Dockerfile index 7e308c7acb..122fead021 100644 --- a/docker/prover/Dockerfile +++ b/docker/prover/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM rust:1.57 as builder +FROM rust:1.63 as builder WORKDIR /usr/src/zksync COPY . . RUN --mount=type=cache,target=/usr/local/cargo/registry \ diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 0f317ac843..5b75c71431 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:experimental -FROM rust:1.57 as builder +FROM rust:1.63 as builder WORKDIR /usr/src/zksync COPY . . RUN --mount=type=cache,target=/usr/local/cargo/registry \ diff --git a/sdk/zksync-crypto/src/lib.rs b/sdk/zksync-crypto/src/lib.rs index 4291c43c90..2d4140e412 100644 --- a/sdk/zksync-crypto/src/lib.rs +++ b/sdk/zksync-crypto/src/lib.rs @@ -188,7 +188,7 @@ pub fn verify_musig(msg: &[u8], signature: &[u8]) -> Result { let pubkey = &signature[..PACKED_POINT_SIZE]; let pubkey = JUBJUB_PARAMS - .with(|params| edwards::Point::read(&*pubkey, params).map(PublicKey)) + .with(|params| edwards::Point::read(pubkey, params).map(PublicKey)) .map_err(|_| JsValue::from_str("couldn't read public key"))?; let signature = deserialize_signature(&signature[PACKED_POINT_SIZE..])?; diff --git a/sdk/zksync-rs/src/operations/transfer_nft.rs b/sdk/zksync-rs/src/operations/transfer_nft.rs index 543d99c0d8..01331624a7 100644 --- a/sdk/zksync-rs/src/operations/transfer_nft.rs +++ b/sdk/zksync-rs/src/operations/transfer_nft.rs @@ -80,16 +80,14 @@ where let fee = match self.fee { Some(fee) => fee, None => { - let fee = self - .wallet + self.wallet .provider .get_txs_batch_fee( vec![TxFeeTypes::Transfer, TxFeeTypes::Transfer], vec![to, to], fee_token.id, ) - .await?; - fee + .await? } };