Skip to content

Commit

Permalink
store ResourceGroup in resource_tree
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjiao committed Jan 17, 2025
1 parent f98cd64 commit 5025139
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions state/statedb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ impl AccountStateObject {
.flatten()),
DataPath::Resource(struct_tag) => self.resource_tree.lock().get(struct_tag),
DataPath::ResourceGroup(_) => {
debug!("resource_group_tree not support get");
Ok(None)
bail!("resource_group_tree not support get");
}
}
}
Expand All @@ -135,8 +134,7 @@ impl AccountStateObject {
.unwrap_or((None, SparseMerkleProof::new(None, vec![])))),
DataPath::Resource(struct_tag) => self.resource_tree.lock().get_with_proof(struct_tag),
DataPath::ResourceGroup(_) => {
debug!("resource_group_tree not support get");
Ok((None, SparseMerkleProof::new(None, vec![])))
bail!("resource_group_tree not support get");
}
}
}
Expand All @@ -157,8 +155,9 @@ impl AccountStateObject {
DataPath::Resource(struct_tag) => {
self.resource_tree.lock().put(struct_tag, value);
}
DataPath::ResourceGroup(_) => {
debug!("resource_group_tree not support set")
DataPath::ResourceGroup(struct_tag) => {
eprintln!("treat resource_group as resource");
self.resource_tree.lock().put(struct_tag, value);
}
}
}
Expand Down

0 comments on commit 5025139

Please sign in to comment.