use num_bigint::BigUint;
use serde::{Deserialize, Serialize};
use crate::{CanisterId, WalletRegisterId};
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SnapshotVault {
pub canister_id: CanisterId,
pub seq_id: u64,
pub wallet_start_id: WalletRegisterId,
pub max_wallet_count: BigUint,
}
pub type BalanceVault = SnapshotVault;
pub type SecretVault = SnapshotVault;
pub type WalletRegistry = SnapshotVault;
#[cfg(test)]
mod tests {
use crate::vault::SnapshotVault;
use candid::Principal;
use ex3_serde::bincode;
#[test]
fn test_bincode_seder() {
let vault = SnapshotVault {
canister_id: Principal::management_canister().into(),
seq_id: 1,
wallet_start_id: 0u8.into(),
max_wallet_count: 100u64.into(),
};
let bytes = bincode::serialize(&vault).unwrap();
let vault2: SnapshotVault = bincode::deserialize(&bytes).unwrap();
assert_eq!(vault.canister_id, vault2.canister_id);
}
}