Skip to content

Commit

Permalink
Fix reverting deposit
Browse files Browse the repository at this point in the history
Signed-off-by: deniallugo <[email protected]>
  • Loading branch information
Deniallugo committed Sep 2, 2022
1 parent 8f5f575 commit 2b14ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/lib/storage/src/chain/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) => {
Expand All @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions core/tests/loadnext/src/executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use futures::{channel::mpsc, future::join_all};
use std::ops::Mul;

use tokio::task::JoinHandle;
use zksync::{
Expand Down Expand Up @@ -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)
Expand All @@ -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?;
Expand Down

0 comments on commit 2b14ebb

Please sign in to comment.