cycles-quartz/bisenzone-cw-mvp/contracts/cw-tee-mtcs/src/msg.rs

61 lines
1.3 KiB
Rust
Raw Normal View History

2023-11-29 21:13:20 +00:00
use cosmwasm_schema::{cw_serde, QueryResponses};
#[cw_serde]
pub struct InstantiateMsg;
#[cw_serde]
2023-11-29 22:09:57 +00:00
pub enum ExecuteMsg {
2023-12-22 13:10:51 +00:00
BootstrapKeyManager(execute::BootstrapKeyManagerMsg),
2024-01-10 15:10:24 +00:00
RegisterEpochKey(execute::RegisterEpochKeyMsg),
2023-11-29 22:09:57 +00:00
JoinComputeNode(execute::JoinComputeNodeMsg),
}
2023-11-29 21:13:20 +00:00
2023-11-29 21:37:02 +00:00
pub mod execute {
use super::*;
2023-12-22 13:10:51 +00:00
#[cw_serde]
pub struct BootstrapKeyManagerMsg {
pub compute_mrenclave: String,
pub key_manager_mrenclave: String,
pub tcb_info: String,
}
2024-01-10 15:10:24 +00:00
#[cw_serde]
pub struct RegisterEpochKeyMsg {
pub epoch_key: String,
}
2023-11-29 21:37:02 +00:00
#[cw_serde]
pub struct JoinComputeNodeMsg {
2023-12-05 17:03:43 +00:00
pub io_exchange_key: String,
pub address: String,
pub nonce: String,
2023-11-29 21:37:02 +00:00
}
}
2023-11-29 21:13:20 +00:00
#[cw_serde]
#[derive(QueryResponses)]
2023-12-05 17:03:43 +00:00
pub enum QueryMsg {
2023-12-22 13:10:51 +00:00
#[returns(query::GetSgxStateResponse)]
GetSgxState {},
2023-12-05 17:03:43 +00:00
#[returns(query::GetRequestsResponse)]
GetRequests {},
}
pub mod query {
use super::*;
2023-12-22 13:10:51 +00:00
use crate::state::{RawMrenclave, RawNonce, Request};
#[cw_serde]
pub struct GetSgxStateResponse {
pub compute_mrenclave: RawMrenclave,
pub key_manager_mrenclave: RawMrenclave,
}
2023-12-05 17:03:43 +00:00
#[cw_serde]
pub struct GetRequestsResponse {
pub requests: Vec<(RawNonce, Request)>,
}
}