From dd7c83ff1e0f89d5cb1a312287f3972af2f5286a Mon Sep 17 00:00:00 2001 From: Francisco Silva Date: Mon, 21 Oct 2024 13:47:19 +0000 Subject: [PATCH] adding add_account trusted call --- .../identity/app-libs/stf/src/trusted_call.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tee-worker/identity/app-libs/stf/src/trusted_call.rs b/tee-worker/identity/app-libs/stf/src/trusted_call.rs index a912525176..4aa7d8bc4e 100644 --- a/tee-worker/identity/app-libs/stf/src/trusted_call.rs +++ b/tee-worker/identity/app-libs/stf/src/trusted_call.rs @@ -139,6 +139,8 @@ pub enum TrustedCall { #[cfg(feature = "development")] #[codec(index = 25)] clean_id_graphs(Identity), + #[codec(index = 26)] + add_account(Identity, AccountId, Identity, ValidationData, Option, H256), // original integritee trusted calls, starting from index 50 #[codec(index = 50)] @@ -229,6 +231,7 @@ impl TrustedCall { Self::request_batch_vc(sender_identity, ..) => sender_identity, #[cfg(feature = "development")] Self::clean_id_graphs(sender_identity) => sender_identity, + Self::add_account(sender_identity, ..) => sender_identity, } } @@ -242,6 +245,7 @@ impl TrustedCall { Self::deactivate_identity(..) => "deactivate_identity", Self::activate_identity(..) => "activate_identity", Self::maybe_create_id_graph(..) => "maybe_create_id_graph", + Self::add_account(..) => "add_account", _ => "unsupported_trusted_call", } } @@ -253,6 +257,7 @@ impl TrustedCall { 1 => "We are going to help you generate 1 secure credential. Please be assured, this process is safe and involves no transactions of your assets. Token: ".to_string(), n => format!("We are going to help you generate {n} secure credentials. Please be assured, this process is safe and involves no transactions of your assets. Token: "), }, + // TODO: add signature message prefix for add_account ? _ => "Token: ".to_string(), } } @@ -896,6 +901,17 @@ where Ok(TrustedCallResult::Empty) }, + TrustedCall::add_account( + _signer, + _who, + _account, + _validation_data, + _maybe_key, + _req_ext_hash, + ) => { + error!("please use author_submitNativeRequest instead"); + Ok(TrustedCallResult::Empty) + }, } }