diff --git a/Cargo.lock b/Cargo.lock index b77319b..94db7b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,7 +418,6 @@ dependencies = [ [[package]] name = "detee-shared" version = "0.1.0" -source = "git+ssh://git@gitea.detee.cloud/noormohammedb/detee-shared?branch=stable_01#65bfa113a44251dd13e5d895014f4a773e367d2e" dependencies = [ "base64", "prost", diff --git a/src/data.rs b/src/data.rs index aaaf130..89855ae 100644 --- a/src/data.rs +++ b/src/data.rs @@ -142,7 +142,7 @@ impl Into for VmContract { pub struct AppContract { pub uuid: String, pub package_url: String, - pub admin_pubkey: String, + pub owner_wallet: String, pub node_pubkey: String, pub mapped_ports: Vec<(u16, u16)>, pub host_ipv4: String, @@ -162,7 +162,7 @@ impl From for AppContractPB { fn from(value: AppContract) -> Self { Self { uuid: value.uuid, - admin_pubkey: value.admin_pubkey, + owner_wallet: value.owner_wallet, node_pubkey: value.node_pubkey, package_url: value.package_url, exposed_ports: value @@ -797,17 +797,17 @@ impl BrainData { contracts.iter().find(|c| c.uuid == uuid).cloned() } - pub fn find_app_contracts_by_admin_pubkey(&self, admin_pubkey: &str) -> Vec { - debug!("Searching contracts for admin pubkey {admin_pubkey}"); + pub fn find_app_contracts_by_admin_pubkey(&self, owner_wallet: &str) -> Vec { + debug!("Searching contracts for admin pubkey {owner_wallet}"); let contracts: Vec = self .app_contracts .read() .unwrap() .iter() - .filter(|c| c.admin_pubkey == admin_pubkey) + .filter(|c| c.owner_wallet == owner_wallet) .cloned() .collect(); - debug!("Found {} contracts or {admin_pubkey}.", contracts.len()); + debug!("Found {} contracts or {owner_wallet}.", contracts.len()); contracts } @@ -906,7 +906,7 @@ impl BrainData { if let Err(err) = new_container_req.1.send(new_container_resp.clone()) { log::error!( "CLI RX for {} dropped before receiving confirmation {:?}.\n{:?}", - &new_container_req.0.admin_pubkey, + &new_container_req.0.owner_wallet, new_container_resp, err ); @@ -916,7 +916,7 @@ impl BrainData { uuid: new_container_req.0.uuid, node_pubkey: new_container_req.0.node_pubkey.clone(), package_url: new_container_req.0.package_url, - admin_pubkey: new_container_req.0.admin_pubkey, + owner_wallet: new_container_req.0.owner_wallet, ..Default::default() }; log::info!("Created new app contract: {app_contracts:?}"); diff --git a/src/grpc.rs b/src/grpc.rs index 1f6c355..712de9c 100644 --- a/src/grpc.rs +++ b/src/grpc.rs @@ -368,13 +368,13 @@ impl BrainAppCli for BrainAppCliMock { ) -> Result, Status> { let req = req.into_inner(); log::info!("Creating new container: {req:?}"); - let admin_pubkey = req.admin_pubkey.clone(); + let owner_wallet = req.owner_wallet.clone(); let (oneshot_tx, oneshot_rx) = tokio::sync::oneshot::channel(); self.data.send_new_container_req(req, oneshot_tx).await; match oneshot_rx.await { Ok(response) => { - info!("responding container confirmation to {admin_pubkey}: {response:?}"); + info!("responding container confirmation to {owner_wallet}: {response:?}"); Ok(Response::new(response)) } Err(e) => { @@ -409,7 +409,7 @@ impl BrainAppCli for BrainAppCliMock { let app_contracts = self .data - .find_app_contracts_by_admin_pubkey(&req_data.admin_pubkey); + .find_app_contracts_by_admin_pubkey(&req_data.owner_wallet); let (tx, rx) = mpsc::channel(6); tokio::spawn(async move {