init temp

This commit is contained in:
NicolasCantu 2025-05-28 15:20:15 +02:00
parent 90d87e7d9a
commit dff31ec6ca
2 changed files with 9 additions and 4 deletions

View File

@ -16,8 +16,8 @@ getrandom = { version="0.2.12", features = ["js"] }
wasm-logger = "0.2.0"
rand = "0.8.5"
tsify = { git = "https://github.com/Sosthene00/tsify", branch = "next" }
# sdk_common = { path = "../sdk_common" }
sdk_common = { git = "https://git.4nkweb.com/4nk/sdk_common.git", branch = "dev" }
sdk_common = { path = "../sdk_common" }
# sdk_common = { git = "https://git.4nkweb.com/4nk/sdk_common.git", branch = "dev" }
serde-wasm-bindgen = "0.6.5"
[dev-dependencies]

View File

@ -675,8 +675,12 @@ fn create_diffs(device: &MutexGuard<Device>, process: &Process, new_state: &Proc
let mut diffs = vec![];
for (field, hash) in new_state_commitments.iter() {
let description_field = new_public_data.get(field);
let has_description = description_field.as_ref().is_some_and(|v| v.is_string());
let description = if has_description { description_field.unwrap().as_str().map(|s| s.to_owned()) } else { None };
let has_description = description_field.is_some();
let description = if has_description {
String::from_utf8(description_field.unwrap().clone()).ok()
} else {
None
};
let need_validation = fields_to_validate.contains(field);
diffs.push(UserDiff {
process_id: process_id.clone(),
@ -1155,6 +1159,7 @@ pub fn create_new_process(
fee_rate: u32,
members_list: OutPointMemberMap,
) -> ApiResult<ApiReturn> {
// TODO basic sanity check: we can't have duplicate field name, or a "roles" field
// We create a transaction that spends to the relay address
let local_device = lock_local_device()?;