-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add sign_voluntary_exit_message() * add sign_exit() handler to guardian bin and client
- Loading branch information
JasonVranek
authored
Oct 31, 2023
1 parent
62a391a
commit d6253bf
Showing
9 changed files
with
199 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod attest_fresh_eth_key_with_blockhash; | ||
pub mod validate_custody; | ||
pub mod sign_exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use axum::response::IntoResponse; | ||
use axum::Json; | ||
use log::{error, info}; | ||
|
||
pub async fn handler( | ||
Json(request): Json<crate::enclave::types::SignExitRequest>, | ||
) -> axum::response::Response { | ||
info!("sign_exit()"); | ||
match crate::enclave::guardian::sign_voluntary_exit_message(request) { | ||
Ok(resp) => { | ||
(axum::http::status::StatusCode::OK, Json(resp)).into_response() | ||
} | ||
|
||
Err(e) => { | ||
error!("{:?}", e); | ||
( | ||
axum::http::status::StatusCode::INTERNAL_SERVER_ERROR, | ||
format!("{}", e), | ||
) | ||
.into_response() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters