Reload Tributaries

add_active_tributary writes the spec to disk before it returns, so even if the
VecDeque it pushes to isn't popped, the tributary will still be loaded on boot.
This commit is contained in:
Luke Parker
2023-04-23 04:31:00 -04:00
parent 2b09309adc
commit f2d9d70068
5 changed files with 130 additions and 15 deletions

View File

@@ -61,7 +61,9 @@ pub fn new_spec<R: RngCore + CryptoRng>(
.unwrap(),
};
TributarySpec::new(serai_block, start_time, set, set_data)
let res = TributarySpec::new(serai_block, start_time, set, set_data);
assert_eq!(TributarySpec::read::<&[u8]>(&mut res.serialize().as_ref()).unwrap(), res);
res
}
pub async fn new_tributaries(