Skip to content

Commit

Permalink
fix(tests): wait withdrawal push to mem pool
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroqn committed Jul 28, 2022
1 parent 970fdae commit 47ea1f3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/tests/src/tests/rpc_server/submit_withdrawal_request.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::time::Duration;

use gw_common::{
builtins::{CKB_SUDT_ACCOUNT_ID, ETH_REGISTRY_ACCOUNT_ID},
ckb_decimal::CKBCapacity,
Expand Down Expand Up @@ -92,16 +94,14 @@ async fn test_submit_withdrawal_request() {
.await
.unwrap();

let is_in_queue = rpc_server
while rpc_server
.is_request_in_queue(withdrawal_hash)
.await
.unwrap();

if !is_in_queue {
chain.produce_block(vec![], vec![withdrawal]).await.unwrap();
} else {
chain.produce_block(vec![], vec![]).await.unwrap();
.unwrap()
{
tokio::time::sleep(Duration::from_millis(100)).await;
}
chain.produce_block(vec![], vec![withdrawal]).await.unwrap();

let snap = mem_pool_state.load();
let state = snap.state().unwrap();
Expand Down

0 comments on commit 47ea1f3

Please sign in to comment.