41 lines
880 B
Rust
41 lines
880 B
Rust
use std::collections::HashMap;
|
|
|
|
use anyhow::{Error, Result};
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
use serde_json::{Map, Value};
|
|
use sp_client::bitcoin::OutPoint;
|
|
use tsify::Tsify;
|
|
use uuid::Uuid;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, Tsify)]
|
|
#[tsify(into_wasm_abi, from_wasm_abi)]
|
|
pub struct Process {
|
|
pub uuid: String,
|
|
pub html: String,
|
|
pub style: String,
|
|
pub script: String,
|
|
pub init_state: Map<String, Value>,
|
|
pub commited_in: OutPoint,
|
|
}
|
|
|
|
impl Process {
|
|
pub fn new(
|
|
html: String,
|
|
style: String,
|
|
script: String,
|
|
init_state: Map<String, Value>,
|
|
commited_in: OutPoint,
|
|
) -> Self {
|
|
Self {
|
|
uuid: Uuid::new_v4().to_string(),
|
|
html,
|
|
style,
|
|
script,
|
|
init_state,
|
|
commited_in,
|
|
}
|
|
}
|
|
}
|