Define UserDiff

This commit is contained in:
Sosthene 2024-12-11 23:29:42 +01:00
parent af51c93087
commit 8f089fd3db

View File

@ -76,6 +76,30 @@ use sdk_common::secrets::SecretsStore;
use crate::user::{lock_local_device, set_new_device, LOCAL_DEVICE};
use crate::wallet::{generate_sp_wallet, lock_freezed_utxos};
#[derive(Debug, PartialEq, Tsify, Serialize, Deserialize, Default)]
#[tsify(into_wasm_abi)]
#[allow(non_camel_case_types)]
pub enum DiffStatus {
#[default]
None,
Rejected,
Validated,
}
#[derive(Debug, PartialEq, Tsify, Serialize, Deserialize, Default)]
#[tsify(into_wasm_abi)]
#[allow(non_camel_case_types)]
pub struct UserDiff {
pub new_state_merkle_root: String, // TODO add a merkle proof that the new_value belongs to that state
pub value_commitment: String,
pub field: String,
pub previous_value: Value,
pub new_value: Value,
pub notify_user: bool,
pub need_validation: bool,
pub validation_status: DiffStatus,
}
#[derive(Debug, PartialEq, Tsify, Serialize, Deserialize, Default)]
#[tsify(into_wasm_abi)]
#[allow(non_camel_case_types)]