Store hratls pubkey and mr_enclave of public package in app contract

This commit is contained in:
Noor 2025-03-06 18:10:47 +00:00
parent dcdfe21c57
commit a46f6ef800
Signed by: noormohammedb
GPG Key ID: E424C39E19EFD7DF
2 changed files with 7 additions and 1 deletions

2
Cargo.lock generated

@ -418,7 +418,7 @@ dependencies = [
[[package]] [[package]]
name = "detee-shared" name = "detee-shared"
version = "0.1.0" version = "0.1.0"
source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#9ba3bc318617b08d8c761767a23abd77519b7e6d" source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#b8f37dec1845d29ea0b69035712e6ebb214376f4"
dependencies = [ dependencies = [
"base64", "base64",
"prost", "prost",

@ -158,6 +158,8 @@ pub struct AppContract {
pub price_per_unit: u64, pub price_per_unit: u64,
pub locked_nano: u64, pub locked_nano: u64,
pub collected_at: chrono::DateTime<Utc>, pub collected_at: chrono::DateTime<Utc>,
pub hratls_pubkey: String,
pub public_package_mr_enclave: Option<Vec<u8>>,
} }
impl From<AppContract> for AppContractPB { impl From<AppContract> for AppContractPB {
@ -189,6 +191,8 @@ impl From<AppContract> for AppContractPB {
nano_per_minute: value.price_per_unit, nano_per_minute: value.price_per_unit,
locked_nano: value.locked_nano, locked_nano: value.locked_nano,
collected_at: value.collected_at.to_rfc3339(), collected_at: value.collected_at.to_rfc3339(),
hratls_pubkey: value.hratls_pubkey,
public_package_mr_enclave: value.public_package_mr_enclave,
} }
} }
} }
@ -977,6 +981,8 @@ impl BrainData {
price_per_unit: new_container_req.0.price_per_unit, price_per_unit: new_container_req.0.price_per_unit,
locked_nano: new_container_req.0.locked_nano, locked_nano: new_container_req.0.locked_nano,
collected_at: Utc::now(), collected_at: Utc::now(),
hratls_pubkey: new_container_req.0.hratls_pubkey,
public_package_mr_enclave: new_container_req.0.public_package_mr_enclave,
}; };
log::info!("Created new app contract: {app_contracts:?}"); log::info!("Created new app contract: {app_contracts:?}");
self.app_contracts.write().unwrap().push(app_contracts); self.app_contracts.write().unwrap().push(app_contracts);