Skip to content

Commit

Permalink
adding add_account trusted call
Browse files Browse the repository at this point in the history
  • Loading branch information
silva-fj committed Oct 21, 2024
1 parent 940792c commit dd7c83f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tee-worker/identity/app-libs/stf/src/trusted_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RequestAesKey>, H256),

// original integritee trusted calls, starting from index 50
#[codec(index = 50)]
Expand Down Expand Up @@ -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,
}
}

Expand All @@ -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",
}
}
Expand All @@ -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(),
}
}
Expand Down Expand Up @@ -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)
},
}
}

Expand Down

0 comments on commit dd7c83f

Please sign in to comment.