fix(tests): submit_withdrawal_request random failure
Withdrawal request is pushed to mem pool immediately
In this case, we should produce new block with withdrawal request to
update state.
@@ -96,13 +96,15 @@ async fn test_submit_withdrawal_request() {
.is_request_in_queue(withdrawal_hash)
.await
.unwrap();
- assert!(is_in_queue);
+ if !is_in_queue {
+ chain.produce_block(vec![], vec![withdrawal]).await.unwrap();
+ } else {
chain.produce_block(vec![], vec![]).await.unwrap();
+ }
let snap = mem_pool_state.load();
let state = snap.state().unwrap();
-
let balance_after_withdrawal = state
.get_sudt_balance(CKB_SUDT_ACCOUNT_ID, test_wallet.reg_address())
.unwrap();
