| 230 | } |
| 231 | |
| 232 | async fn conditionally_execute_actions( |
| 233 | &self, |
| 234 | dfx_orbit: &DfxOrbit, |
| 235 | verified: anyhow::Result<()>, |
| 236 | ) -> anyhow::Result<()> { |
| 237 | match verified { |
| 238 | Ok(()) => { |
| 239 | if self.and_approve { |
| 240 | dfx_core::cli::ask_for_consent( |
| 241 | "Verification successful, approve the request?", |
| 242 | )?; |
| 243 | dfx_orbit |
| 244 | .station |
| 245 | .approve(self.request_id.clone(), None) |
| 246 | .await?; |
| 247 | } else { |
| 248 | println!("Verification successful!"); |
| 249 | } |
| 250 | } |
| 251 | Err(err) => { |
| 252 | if self.or_reject { |
| 253 | dfx_core::cli::ask_for_consent(&format!( |
| 254 | "Verification failed: {err}. Reject the request?" |
| 255 | ))?; |
| 256 | dfx_orbit |
| 257 | .station |
| 258 | .reject(self.request_id.clone(), None) |
| 259 | .await?; |
| 260 | } else { |
| 261 | println!("Verification failed!"); |
| 262 | }; |
| 263 | |
| 264 | return Err(err); |
| 265 | } |
| 266 | }; |
| 267 | |
| 268 | Ok(()) |
| 269 | } |
| 270 | } |