use crate::{
blueprint::plain::Plain,
codec::{
postcard::Postcard,
raw::Raw,
},
column::Column,
structured_storage::TableWithBlueprint,
tables::{
ContractsLatestUtxo,
ContractsRawCode,
},
};
impl TableWithBlueprint for ContractsRawCode {
type Blueprint = Plain<Raw, Raw>;
type Column = Column;
fn column() -> Column {
Column::ContractsRawCode
}
}
impl TableWithBlueprint for ContractsLatestUtxo {
type Blueprint = Plain<Raw, Postcard>;
type Column = Column;
fn column() -> Column {
Column::ContractsLatestUtxo
}
}
#[cfg(test)]
mod test {
use super::*;
crate::basic_storage_tests!(
ContractsRawCode,
<ContractsRawCode as crate::Mappable>::Key::from([1u8; 32]),
vec![32u8],
<ContractsRawCode as crate::Mappable>::OwnedValue::from(vec![32u8])
);
crate::basic_storage_tests!(
ContractsLatestUtxo,
<ContractsLatestUtxo as crate::Mappable>::Key::from([1u8; 32]),
<ContractsLatestUtxo as crate::Mappable>::Value::default()
);
}