-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aptos-vm] add state value metadata support for module storage
- Loading branch information
1 parent
882dfc8
commit d7437e8
Showing
3 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
24 changes: 22 additions & 2 deletions
24
aptos-move/aptos-vm-types/src/module_and_script_storage/module_storage.rs
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 |
---|---|---|
@@ -1,9 +1,29 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use aptos_types::state_store::state_value::StateValueMetadata; | ||
use move_binary_format::errors::PartialVMResult; | ||
use move_core_types::{account_address::AccountAddress, identifier::IdentStr}; | ||
use move_vm_runtime::{DummyCodeStorage, ModuleStorage}; | ||
|
||
/// Represents module storage used by the Aptos blockchain. | ||
pub trait AptosModuleStorage: ModuleStorage {} | ||
pub trait AptosModuleStorage: ModuleStorage { | ||
/// Returns the state value metadata of an associated with this module. The | ||
/// error is returned if there is a storage error. If the module does not exist, | ||
/// `None` is returned. | ||
fn fetch_state_value_metadata( | ||
&self, | ||
address: &AccountAddress, | ||
module_name: &IdentStr, | ||
) -> PartialVMResult<Option<StateValueMetadata>>; | ||
} | ||
|
||
impl AptosModuleStorage for DummyCodeStorage {} | ||
impl AptosModuleStorage for DummyCodeStorage { | ||
fn fetch_state_value_metadata( | ||
&self, | ||
_address: &AccountAddress, | ||
_module_name: &IdentStr, | ||
) -> PartialVMResult<Option<StateValueMetadata>> { | ||
Ok(None) | ||
} | ||
} |
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