Skip to content

Commit

Permalink
adding publicize_account trusted call (#3157)
Browse files Browse the repository at this point in the history
  • Loading branch information
silva-fj authored Nov 4, 2024
1 parent 7848038 commit 0bcb1c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 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 @@ -145,6 +145,8 @@ pub enum TrustedCall {
create_account_store(Identity),
#[codec(index = 29)]
remove_accounts(Identity, Vec<Identity>),
#[codec(index = 30)]
publicize_account(Identity, Identity),

// original integritee trusted calls, starting from index 50
#[codec(index = 50)]
Expand Down Expand Up @@ -238,6 +240,7 @@ impl TrustedCall {
Self::request_intent(sender_identity, ..) => sender_identity,
Self::create_account_store(sender_identity) => sender_identity,
Self::remove_accounts(sender_identity, ..) => sender_identity,
Self::publicize_account(sender_identity, ..) => sender_identity,
}
}

Expand All @@ -254,6 +257,7 @@ impl TrustedCall {
Self::request_intent(..) => "request_intent",
Self::create_account_store(..) => "create_account_store",
Self::remove_accounts(..) => "remove_account",
Self::publicize_account(..) => "publicize_account",
_ => "unsupported_trusted_call",
}
}
Expand Down Expand Up @@ -920,6 +924,10 @@ where
error!("please use author_submitNativeRequest instead");
Ok(TrustedCallResult::Empty)
},
TrustedCall::publicize_account(..) => {
error!("please use author_submitNativeRequest instead");
Ok(TrustedCallResult::Empty)
},
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ fn handle_trusted_call<
identities.iter().map(|i| i.hash()).collect::<Vec<H256>>()
)),
),
TrustedCall::publicize_account(who, identity) => create_dispatch_as_omni_account_call(
who.hash(),
OpaqueCall::from_tuple(&compose_call!(
&metadata,
"OmniAccount",
"publicize_account",
identity
)),
),
_ => {
log::warn!("Received unsupported call: {:?}", call);
let res: Result<(), NativeTaskError> =
Expand Down

0 comments on commit 0bcb1c0

Please sign in to comment.