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

refactor(iota-core): Add more comments for ReadApi::try_get_object_before_version #3844

Merged
merged 11 commits into from
Nov 4, 2024
8 changes: 7 additions & 1 deletion crates/iota-json-rpc-api/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ pub trait ReadApi {
/// version exists/existed. The result may vary across nodes depending
/// on their pruning policies. Returns the latest object information
/// with a version less than or equal to the given version
#[method(name = "tryGetObjectBeforeVersion", deprecated = "true")]
// Note that this endpoint is used by iota replay tool. Also the
// implementation in `iota-json-rpc` uses internally the
// `AuthorityState::find_object_lt_or_eq_version` method, which has
// underlying utility, e.g., `RemoteFetcher::get_child_object` uses
// `try_get_object_before_version` to get the object with the versions <=
// the given version. Thus we keep this endpoint for now.
#[method(name = "tryGetObjectBeforeVersion")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the deprecated flag here.
As far as I understand, having the flag causes it to not be exposed in the generated spec file.
Since it should be only for internal usage, I guess the comment is enough to not remove the function, even though it is marked as deprecated (I guess they did it for the same reason as explained).

Copy link
Contributor Author

@bingyanglin bingyanglin Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the flag to make it clearer. Added the flag at 5c480e4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also enhanced the comment at 8abb3b9.

async fn try_get_object_before_version(
&self,
/// the ID of the queried object
Expand Down
Loading