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 state_root = approve_state.msg.state_root.clone();
408
402
409
403
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
-
404
+
Some(new_state) => {
405
+
let new_state = new_state.msg.into_inner().try_checked().map_err(|err| {
406
+
error!(&logger,"Balances are not aligned in an approved NewState: {}",&err;"module" => "get_spender_limits");
407
+
ResponseError::BadRequest("Balances are not aligned in an approved NewState".to_string())
408
+
})?;
409
+
Ok(Some(new_state))
410
+
}
413
411
None => {
414
-
// TODO: Log the error since this should never happen and its crucial to the Channel
412
+
error!(&logger,"{}","Fatal error! The NewState for the last ApproveState was not found";"module" => "get_spender_limits");
415
413
returnErr(ResponseError::BadRequest(
416
414
"Fatal error! The NewState for the last ApproveState was not found".to_string(),
0 commit comments