Add epoch index to RelayStateSproofBuilder (for testing) (#1419)

* insert zero epoch index into relay sproof

* fix
This commit is contained in:
Amar Singh
2022-07-28 18:41:23 -04:00
committed by GitHub
parent a01b884930
commit db5fdc6eff
+3 -1
View File
@@ -43,6 +43,7 @@ pub struct RelayStateSproofBuilder {
pub hrmp_egress_channel_index: Option<Vec<ParaId>>,
pub hrmp_channels: BTreeMap<relay_chain::v2::HrmpChannelId, AbridgedHrmpChannel>,
pub current_slot: relay_chain::v2::Slot,
pub current_epoch: u64,
}
impl Default for RelayStateSproofBuilder {
@@ -67,6 +68,7 @@ impl Default for RelayStateSproofBuilder {
hrmp_egress_channel_index: None,
hrmp_channels: BTreeMap::new(),
current_slot: 0.into(),
current_epoch: 0u64,
}
}
}
@@ -153,7 +155,7 @@ impl RelayStateSproofBuilder {
for (channel, metadata) in self.hrmp_channels {
insert(relay_chain::well_known_keys::hrmp_channels(channel), metadata.encode());
}
insert(relay_chain::well_known_keys::EPOCH_INDEX.to_vec(), self.current_epoch.encode());
insert(relay_chain::well_known_keys::CURRENT_SLOT.to_vec(), self.current_slot.encode());
}