I have a single object on a blockchain that is going to get updated from time to time. I'd like to track these changes. How do I describe such a struct Vec<(u32, u32)>
and initialize it at the start? For now I have:
encoding_struct! {
struct AC {
const SIZE = 16;
field s: Vec<u32> [00 => 08]
field o: Vec<u32> [08 => 16]
}
}
and then wait for a special empty init transaction
message! {
struct TxInitAC {
const TYPE = SERVICE_ID;
const ID = TX_INIT_AC;
const SIZE = 0;
}
}
with the execute
method
fn execute(&self, view: &mut Fork) {
let mut schema = CurrencySchema { view };
let ac = AC::new(vec![], vec![]);
schema.access_control().push(ac);
}