Skip to content

Commit

Permalink
[REST APIs] remove debug format printing for SequenceNumber in REST e…
Browse files Browse the repository at this point in the history
…ndpoints

Makes the output prettier/more likely to be used by clients without parsing
  • Loading branch information
sblackshear committed Mar 19, 2022
1 parent 380dd98 commit 6169655
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sui/src/rest_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ struct Object {
/** Type of object, i.e. Coin */
obj_type: String,
/** Object version */
version: String,
version: u64,
/** Hash of the object's contents used for local validation */
object_digest: String,
}
Expand Down Expand Up @@ -498,7 +498,7 @@ async fn get_objects(

let object_refs = state.gateway.get_owned_objects(*address);
let mut objects = vec![];
for (object_id, sequence_number, object_digest) in object_refs {
for (object_id, version, object_digest) in object_refs {
let object = match get_object_info(state, object_id).await {
Ok((_, object, _)) => object,
Err(error) => {
Expand All @@ -513,7 +513,7 @@ async fn get_objects(
objects.push(Object {
object_id: object_id.to_string(),
obj_type,
version: format!("{:?}", sequence_number),
version: version.into(),
object_digest: format!("{:?}", object_digest),
});
}
Expand Down Expand Up @@ -1053,7 +1053,10 @@ async fn get_effect(
.map_or("Unknown Type".to_owned(), |type_| format!("{}", type_)),
);
effect.insert("id".to_string(), object_id.to_string());
effect.insert("version".to_string(), format!("{:?}", sequence_number));
effect.insert(
"version".to_string(),
format!("{}", sequence_number.value()),
);
effect.insert("object_digest".to_string(), format!("{:?}", object_digest));
Ok(effect)
}
Expand Down

0 comments on commit 6169655

Please sign in to comment.