From 33797ef7fbdc62239538c84faa4fe66d5f58d766 Mon Sep 17 00:00:00 2001 From: peg Date: Fri, 16 Aug 2024 20:00:03 +0200 Subject: [PATCH] Decode input from propagation pallet --- crates/threshold-signature-server/src/attestation/api.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/threshold-signature-server/src/attestation/api.rs b/crates/threshold-signature-server/src/attestation/api.rs index 9dc85fb80..cb540f723 100644 --- a/crates/threshold-signature-server/src/attestation/api.rs +++ b/crates/threshold-signature-server/src/attestation/api.rs @@ -21,6 +21,7 @@ use crate::{ AppState, }; use axum::{body::Bytes, extract::State, http::StatusCode}; +use entropy_shared::OcwMessageAttestationRequest; use subxt::tx::PairSigner; use x25519_dalek::StaticSecret; @@ -31,9 +32,11 @@ use x25519_dalek::StaticSecret; /// [Index TDX DCAP Quoting Library API](https://download.01.org/intel-sgx/latest/dcap-latest/linux/docs/Intel_TDX_DCAP_Quoting_Library_API.pdf). pub async fn attest( State(app_state): State, - _input: Bytes, + input: Bytes, ) -> Result { - // TODO input should be Vec - check it + let attestaion_requests = OcwMessageAttestationRequest::decode(&mut input.as_ref())?; + // TODO check that attestation_requests.tss_account_ids contains our account_id + // which is signer.signer().public().0 let api = get_api(&app_state.configuration.endpoint).await?; let rpc = get_rpc(&app_state.configuration.endpoint).await?;