Skip to content

Commit

Permalink
[RPC] Fix coin metadata api inefficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfind committed Oct 10, 2024
1 parent 8be878a commit 295e735
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/sui-json-rpc/src/coin_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ async fn find_package_object_id(
spawn_monitored_task!(async move {
let publish_txn_digest = state.find_publish_txn_digest(package_id)?;

let (_, effect) = state
.get_executed_transaction_and_effects(publish_txn_digest, kv_store)
.await?;
let effect = kv_store.get_fx_by_tx_digest(publish_txn_digest).await?;

for ((id, _, _), _) in effect.created() {
if let Ok(object_read) = state.get_object_read(&id) {
Expand All @@ -269,7 +267,7 @@ async fn find_package_object_id(
}
}
Err(SuiRpcInputError::GenericNotFound(format!(
"Cannot find object [{}] from [{}] package event.",
"Cannot find object with type [{}] from [{}] package created objects.",
object_struct_tag, package_id,
))
.into())
Expand Down

0 comments on commit 295e735

Please sign in to comment.