-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure shared state between StateStore and BufferedState
- Loading branch information
Showing
13 changed files
with
169 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use aptos_storage_interface::state_store::state_delta::StateDelta; | ||
use derive_more::{Deref, DerefMut}; | ||
|
||
#[derive(Clone, Debug, Deref, DerefMut)] | ||
pub(crate) struct CurrentState { | ||
#[deref] | ||
#[deref_mut] | ||
from_latest_checkpoint_to_current: StateDelta, | ||
} | ||
|
||
impl CurrentState { | ||
pub fn new_dummy() -> Self { | ||
Self { | ||
from_latest_checkpoint_to_current: StateDelta::new_empty(), | ||
} | ||
} | ||
|
||
pub fn set(&mut self, from_latest_checkpoint_to_current: StateDelta) { | ||
self.from_latest_checkpoint_to_current = from_latest_checkpoint_to_current; | ||
} | ||
|
||
pub fn get(&self) -> &StateDelta { | ||
&self.from_latest_checkpoint_to_current | ||
} | ||
} |
Oops, something went wrong.