You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let approve_state = matchlatest_approve_state_v5(pool, channel).await? {
396
403
Some(approve_state) => approve_state,
397
-
None => returnErr(ResponseError::NotFound),
404
+
None => returnOk(None),
398
405
};
399
406
400
407
let state_root = approve_state.msg.state_root.clone();
401
408
402
-
let new_state = latest_new_state_v5(pool, channel,&state_root).await?;
409
+
let new_state = matchlatest_new_state_v5(pool, channel,&state_root).await? {
410
+
// TODO: Since it's an approved NewState, then it's safe to make sure it's in `CheckedState`, or if it's not - log the error that the balances are not aligned with the fact it's an Approved NewState and return ResponseError::BadRequest
411
+
Some(new_state) => Ok(Some(new_state)),
412
+
413
+
None => {
414
+
// TODO: Log the error since this should never happen and its crucial to the Channel
415
+
returnErr(ResponseError::BadRequest(
416
+
"Fatal error! The NewState for the last ApproveState was not found".to_string(),
0 commit comments