Skip to content

Commit

Permalink
sending auth_token_requested call on token requested
Browse files Browse the repository at this point in the history
  • Loading branch information
silva-fj committed Dec 24, 2024
1 parent b27d46b commit 9f95046
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Header {
#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub struct Payload {
sub: String,
exp: BlockNumber,
pub exp: BlockNumber,
}

impl Payload {
Expand Down
17 changes: 17 additions & 0 deletions tee-worker/identity/litentry/core/native-task/receiver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,23 @@ fn handle_trusted_call<ShieldingKeyRepository, AA, SES, OA, EF, NMR, AKR, AR, SH
return
};

let auth_token_requested_call = OpaqueCall::from_tuple(&compose_call!(
&metadata,
"OmniAccount",
"auth_token_requested",
omni_account,
payload.exp
));
if let Ok(extrinsic) =
context.extrinsic_factory.create_extrinsics(&[auth_token_requested_call], None)
{
if let Err(e) =
context.ocall_api.send_to_parentchain(extrinsic, &ParentchainId::Litentry, None)
{
log::error!("Failed to send extrinsic to parentchain: {:?}", e);
}
}

let result: TrustedCallResult = Ok(auth_token.into());
context.author_api.send_rpc_response(connection_hash, result.encode(), false);
return
Expand Down

0 comments on commit 9f95046

Please sign in to comment.