use substrate_data::Schema;
#[derive(Schema, Debug, PartialEq)]
pub(crate) struct Doc {
pub(crate) name: String,
pub(crate) n: u32,
}
#[derive(Schema, Debug, PartialEq)]
pub(crate) struct Grown {
pub(crate) name: String,
pub(crate) n: u32,
#[data(default)]
pub(crate) tags: Vec<String>,
}
#[derive(Schema, Debug, PartialEq)]
pub(crate) struct In<T: Schema> {
pub(crate) v: T,
pub(crate) after: u8,
}
pub(crate) fn base() -> Doc {
Doc {
name: "x".into(),
n: 7,
}
}
pub(crate) fn grown(tags: &[&str]) -> Grown {
Grown {
name: "x".into(),
n: 7,
tags: tags.iter().map(|t| (*t).to_owned()).collect(),
}
}