Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RPC]Add an API or API argument option to query an object based on the specific root state. #2330

Closed
steelgeek091 opened this issue Aug 1, 2024 · 2 comments
Labels
area:rpc RPC relative issues help wanted Extra attention is needed skill::rust Need the rust language skill to complete the issue
Milestone

Comments

@steelgeek091
Copy link
Collaborator

Currently, objects are queried based on the latest root state. An interface is needed to query objects based on a specific root state.

@steelgeek091 steelgeek091 added skill::rust Need the rust language skill to complete the issue area:rpc RPC relative issues labels Aug 1, 2024
@jolestar jolestar added this to the TBD milestone Aug 1, 2024
@jolestar jolestar changed the title Add an interface to query an object based on the specific root state. [RPC]Add an API or API argument option to query an object based on the specific root state. Aug 1, 2024
@jolestar jolestar modified the milestones: TBD, Rooch v0.8 Sep 8, 2024
@jolestar
Copy link
Contributor

jolestar commented Sep 8, 2024

  1. Add state_root: Option<H256> to StateOptions.
  2. Query state with the special state_root:
    #[async_trait]
    impl Handler<ListStatesMessage> for ReaderExecutorActor {
    async fn handle(
    &mut self,
    msg: ListStatesMessage,
    _ctx: &mut ActorContext,
    ) -> Result<Vec<StateKV>, anyhow::Error> {
    let resolver = RootObjectResolver::new(self.root.clone(), &self.moveos_store);
    resolver.list_states(msg.access_path, msg.cursor, msg.limit)
    }
    }
  3. Implement StateReslver to Client

@jolestar jolestar added the help wanted Extra attention is needed label Sep 8, 2024
@jolestar
Copy link
Contributor

Finished in #2616

@github-project-automation github-project-automation bot moved this to Done in Rooch Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rpc RPC relative issues help wanted Extra attention is needed skill::rust Need the rust language skill to complete the issue
Projects
Status: Done
Development

No branches or pull requests

2 participants