Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing publicize_account trusted call #3157

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading