From 2b14ebb68959ce43fdf4ea8437d72267ebe0f696 Mon Sep 17 00:00:00 2001 From: deniallugo Date: Tue, 16 Aug 2022 17:56:31 +0200 Subject: [PATCH] Fix reverting deposit Signed-off-by: deniallugo --- core/lib/storage/src/chain/mempool/mod.rs | 4 ++-- core/tests/loadnext/src/executor.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/lib/storage/src/chain/mempool/mod.rs b/core/lib/storage/src/chain/mempool/mod.rs index 719e98a907..efa78d195c 100644 --- a/core/lib/storage/src/chain/mempool/mod.rs +++ b/core/lib/storage/src/chain/mempool/mod.rs @@ -418,7 +418,7 @@ impl<'a, 'c> MempoolSchema<'a, 'c> { let mut transaction = self.0.start_transaction().await?; for op in ops { let serial_id = op.serial_id as i64; - let tx_hash = op.tx_hash().to_string(); + let tx_hash = hex::encode(op.tx_hash().as_ref()); let data = serde_json::to_value(op.data.clone()).expect("Should be encoded"); let deadline_block = op.deadline_block as i64; let eth_hash = op.eth_hash.as_bytes().to_vec(); @@ -706,6 +706,7 @@ impl<'a, 'c> MempoolSchema<'a, 'c> { .into_iter() .map(|op| ExecutedOperations::PriorityOp(Box::new(op.into_executed()))); + executed_operations.extend(executed_priority_ops); executed_operations.sort_by_key(|exec_op| { match exec_op { ExecutedOperations::Tx(tx) => { @@ -720,7 +721,6 @@ impl<'a, 'c> MempoolSchema<'a, 'c> { } }); - executed_operations.extend(executed_priority_ops); incomplete_blocks.push_back(IncompleteBlock::new_from_available_block_sizes( BlockNumber(block.number as u32), fee_account_id, diff --git a/core/tests/loadnext/src/executor.rs b/core/tests/loadnext/src/executor.rs index e6f41b8cb0..255755d9c0 100644 --- a/core/tests/loadnext/src/executor.rs +++ b/core/tests/loadnext/src/executor.rs @@ -1,5 +1,4 @@ use futures::{channel::mpsc, future::join_all}; -use std::ops::Mul; use tokio::task::JoinHandle; use zksync::{ @@ -57,7 +56,7 @@ impl Executor { self.set_signing_key().await?; let (executor_future, account_futures) = self.send_initial_transfers().await?; self.wait_account_routines(account_futures).await; - self.deposit_to_master().await; + let final_resultion = executor_future.await.unwrap_or(LoadtestResult::TestFailed); Ok(final_resultion) @@ -84,7 +83,7 @@ impl Executor { /// Mints the ERC-20 token on the main wallet. async fn mint(&mut self) -> anyhow::Result<()> { vlog::info!("Master Account: Minting ERC20 token..."); - let deposit_amount = self.amount_to_deposit().mul(3); + let deposit_amount = self.amount_to_deposit(); let master_wallet = &self.pool.master_wallet; let mut ethereum = master_wallet.ethereum(&self.config.web3_url).await?;