Skip to content

Commit

Permalink
Use archival offchain workingset (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh authored Jan 7, 2025
1 parent cab8f54 commit a6f1edd
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ impl<S: Storage> WorkingSet<S> {
ArchivalJmtWorkingSet::new(&self.delta.inner.inner, version)
}

/// Returns a handler for the archival offchain state.
fn archival_offchain_state(&mut self, version: Version) -> ArchivalOffchainWorkingSet<S> {
ArchivalOffchainWorkingSet::new(&self.offchain_delta.inner.storage, version)
}

/// Returns a handler for the archival accessory state (non-JMT state).
fn archival_accessory_state(&mut self, version: Version) -> ArchivalAccessoryWorkingSet<S> {
ArchivalAccessoryWorkingSet::new(&self.accessory_delta.inner.storage, version)
Expand All @@ -464,12 +469,14 @@ impl<S: Storage> WorkingSet<S> {
/// Sets archival version for a working set
pub fn set_archival_version(&mut self, version: Version) {
self.archival_working_set = Some(self.archival_state(version));
self.archival_offchain_working_set = Some(self.archival_offchain_state(version));
self.archival_accessory_working_set = Some(self.archival_accessory_state(version));
}

/// Unset archival version
pub fn unset_archival_version(&mut self) {
self.archival_working_set = None;
self.archival_offchain_working_set = None;
self.archival_accessory_working_set = None;
}

Expand Down

0 comments on commit a6f1edd

Please sign in to comment.