Skip to content

Commit

Permalink
Readable Debug impl for TransactionEffectsDigest (MystenLabs#2554)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Jun 14, 2022
1 parent 5751242 commit d880399
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/sui-types/src/base_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ pub struct ObjectDigest(
); // We use SHA3-256 hence 32 bytes here

#[serde_as]
#[derive(
Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Hash, Serialize, Deserialize, JsonSchema, Debug,
)]
#[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone, Hash, Serialize, Deserialize, JsonSchema)]
pub struct TransactionEffectsDigest(
#[schemars(with = "Base64")]
#[serde_as(as = "Readable<Base64, Bytes>")]
Expand Down Expand Up @@ -570,6 +568,14 @@ impl std::fmt::Debug for TransactionDigest {
}
}

impl std::fmt::Debug for TransactionEffectsDigest {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
let s = base64ct::Base64::encode_string(&self.0);
write!(f, "{}", s)?;
Ok(())
}
}

// TODO: rename to version
impl SequenceNumber {
pub const MIN: SequenceNumber = SequenceNumber(u64::MIN);
Expand Down

0 comments on commit d880399

Please sign in to comment.