Skip to content

Commit

Permalink
fix starcoin-resource-view
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Sep 23, 2024
1 parent ecd01db commit bf03319
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions vm/resource-viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use move_core_types::u256;
use starcoin_vm_types::language_storage::TypeTag;
use starcoin_vm_types::state_store::state_key::StateKey;
use starcoin_vm_types::state_store::state_value::StateValue;
use starcoin_vm_types::state_view::{StateView, TStateView};
use starcoin_vm_types::state_store::TStateView;
use starcoin_vm_types::state_view::StateView;
use starcoin_vm_types::value::MoveTypeLayout;
use starcoin_vm_types::{
account_address::AccountAddress,
Expand All @@ -29,6 +30,7 @@ use std::{
convert::TryInto,
fmt::{Display, Formatter},
};
use starcoin_vm_types::state_store::state_storage_usage::StateStorageUsage;

mod fat_type;
pub mod module_cache;
Expand Down Expand Up @@ -316,11 +318,11 @@ pub struct NullStateView;
impl TStateView for NullStateView {
type Key = StateKey;

fn get_state_value(&self, _state_key: &StateKey) -> Result<Option<StateValue>> {
fn get_state_value(&self, _state_key: &StateKey) -> starcoin_vm_types::state_store::Result<Option<StateValue>> {
Ok(None)
}

fn is_genesis(&self) -> bool {
false
fn get_usage(&self) -> starcoin_vm_types::state_store::Result<StateStorageUsage> {
unimplemented!()
}
}
4 changes: 1 addition & 3 deletions vm/resource-viewer/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use anyhow::{anyhow, Result};
use starcoin_vm_types::state_store::state_key::StateKey;
use starcoin_vm_types::{
access::ModuleAccess,
access_path::AccessPath,
account_address::AccountAddress,
errors::PartialVMError,
file_format::{
Expand Down Expand Up @@ -53,10 +52,9 @@ impl<'a> Resolver<'a> {
if let Some(module) = self.cache.get(&module_id) {
return Ok(module);
}
let access_path = AccessPath::from(&module_id);
let binding = self
.state
.get_state_value_bytes(&StateKey::AccessPath(access_path))?
.get_state_value_bytes(&StateKey::module_id(&module_id))?
.ok_or_else(|| anyhow!("Module {:?} can't be found", module_id))?;
let blob = binding.as_ref();
let compiled_module = CompiledModule::deserialize(&blob).map_err(|status| {
Expand Down

0 comments on commit bf03319

Please sign in to comment.