-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Implement GetPackage gRPC API #22435
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
fn extract_modules(package: &MovePackage) -> Result<Vec<Module>> { | ||
let mut modules = Vec::new(); | ||
|
||
for module_name in package.serialized_module_map().keys() { | ||
// Only return module names | ||
// Full module data is provided by GetModule | ||
modules.push(Module { | ||
name: Some(module_name.clone()), | ||
data_types: vec![], | ||
functions: vec![], | ||
}); | ||
} | ||
|
||
Ok(modules) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe this isn't what we want. I think we'd want this to fully render data types and function descriptors. And the other apis (get module/function/datatype) are a way to get a smaller amount of scoped data. Also i must have forgotten to change data_types
to be one word in the Module message, we should do that to be consistent with how its used elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. I think I slightly misunderstood what you were explaining yesterday. Where was the risk for exponential payload growth due to repeated type definitions that we were discussing again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yeah thats with the old JSONRPC shape of a NormalizedMoveModule
. With these new message shapes the output is bounded by the size of the just the package itself
Description
Implementing GetPackage for the defined gRPC stub. Leaving the other methods unimplemented for now.
Test plan
Added unit tests and did a quick manual grpcurl sanity check -
Release notes