MCPcopy Create free account
hub / github.com/dfinity/orbit / conditionally_execute_actions

Method conditionally_execute_actions

tools/dfx-orbit/src/args.rs:232–269  ·  view source on GitHub ↗
(
        &self,
        dfx_orbit: &DfxOrbit,
        verified: anyhow::Result<()>,
    )

Source from the content-addressed store, hash-verified

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}

Callers 1

executeMethod · 0.80

Calls 2

approveMethod · 0.80
rejectMethod · 0.80

Tested by

no test coverage detected