From 42b5f4f59a7cb456e78b0f1436547df350e93b6a Mon Sep 17 00:00:00 2001 From: Demos Chiang <69138672+democ98@users.noreply.github.com> Date: Mon, 6 May 2024 15:16:23 +0800 Subject: [PATCH] fix:tee registration status judge (#335) --- standalone/teeworker/cifrost/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/standalone/teeworker/cifrost/src/lib.rs b/standalone/teeworker/cifrost/src/lib.rs index e72d44b5..dd3ecc87 100644 --- a/standalone/teeworker/cifrost/src/lib.rs +++ b/standalone/teeworker/cifrost/src/lib.rs @@ -718,6 +718,15 @@ async fn register_worker( error!("FailedToCallRegisterWorker: {:?}", ret); return Err(anyhow!(Error::FailedToCallRegisterWorker)); } + match ret.unwrap().wait_for_finalized_success().await { + Ok(e) => { + info!("Tee registration successful in block hash:{:?}, and the transaction hash is :{:?}",e.block_hash(),e.extrinsic_hash()) + }, + Err(e) => { + error!("Tee registration transaction has been finalized, but registration failed :{:?}",e.to_string()); + return Err(anyhow!(Error::FailedToCallRegisterWorker)); + }, + }; signer.increment_nonce(); Ok(()) }