From 02f14597ed15b230c186ddcef33ce0f3edcfa64e Mon Sep 17 00:00:00 2001 From: Bing-Yang <51323441+bingyanglin@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:50:24 +0800 Subject: [PATCH] refactor(iota-core): Add more comments for `ReadApi::try_get_object_before_version` (#3844) * Add more comments for try_get_object_before_version * Remove unnecessary parenthesis * Update crates/iota-json-rpc-api/src/read.rs Co-authored-by: Thibault Martinez * Remove deprecated mark * Use code comments * Add the deprecated flag back * Enhance the code comment --------- Co-authored-by: Thibault Martinez --- crates/iota-json-rpc-api/src/read.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/iota-json-rpc-api/src/read.rs b/crates/iota-json-rpc-api/src/read.rs index 4798ae83f5d..9a78978d672 100644 --- a/crates/iota-json-rpc-api/src/read.rs +++ b/crates/iota-json-rpc-api/src/read.rs @@ -88,6 +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 + // 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. We have the `deprecated` flag here to not expose it in + // the generated spec file, and it should be only for internal usage. #[method(name = "tryGetObjectBeforeVersion", deprecated = "true")] async fn try_get_object_before_version( &self,