소스 검색

Remove wallet states from `check_state_transition`

Cesar Rodas 3 주 전
부모
커밋
81a6d68ef3
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      crates/cdk-common/src/state.rs

+ 3 - 3
crates/cdk-common/src/state.rs

@@ -25,9 +25,9 @@ pub fn check_state_transition(current_state: State, new_state: State) -> Result<
             State::Pending | State::Reserved | State::PendingSpent | State::Spent
         ),
         State::Pending => matches!(new_state, State::Unspent | State::Spent),
-        State::Reserved => matches!(new_state, State::Pending | State::Unspent),
-        State::PendingSpent => matches!(new_state, State::Unspent | State::Spent),
-        State::Spent => false,
+        // Any other state shouldn't be updated by the mint, and the wallet does not use this
+        // function
+        _ => false,
     };
 
     if !is_valid_transition {