Implement estate and marketplace services (#73)
All checks were successful
Native code generation / deterministic (push) Successful in 15m57s
Imaging and meshing gate / native (push) Successful in 5m16s
Native Rust workspace compile / compile (push) Successful in 5m11s

This commit is contained in:
2026-08-10 19:25:31 +00:00
parent c22eef5d0e
commit 763e9e5044
14 changed files with 3132 additions and 1202 deletions

View File

@@ -150,6 +150,38 @@ impl std::fmt::Debug for AssetManager {
}
impl AssetManager {
pub(crate) fn native_stage_estate_upload(&self, data: Vec<u8>) -> Result<UUID, Error> {
if data.is_empty() || data.len() > crate::asset_models::MAX_ASSET_BYTES {
return Err(Error::Argument);
}
let id = UUID::random()?;
let upload = Arc::new(Mutex::new(UploadState {
asset_id: id,
data,
packet_num: 0,
transaction_id: id,
transferred: 0,
type_: AssetType::Unknown,
xfer_id: 0,
confirmation: None,
}));
let mut pending = mutex(&self.inner.pending_upload);
if pending.is_some() {
return Err(Error::InvalidOperation);
}
*pending = Some(upload);
Ok(id)
}
pub(crate) fn native_cancel_staged_estate_upload(&self, id: UUID) {
let mut pending = mutex(&self.inner.pending_upload);
if pending
.as_ref()
.is_some_and(|upload| mutex(upload).transaction_id == id)
{
pending.take();
}
}
pub(crate) fn native_from_inner(inner: Arc<AssetManagerInner>) -> Result<Self, Error> {
inner.client.upgrade().ok_or(Error::InvalidOperation)?;
Ok(Self {