From 2e7eef8f6704af9a5443725cda5cb04d8bfcd2b0 Mon Sep 17 00:00:00 2001 From: patrick Date: Wed, 8 Feb 2023 15:41:08 -0800 Subject: [PATCH] fixup after rebase --- crates/sui-types/src/base_types.rs | 17 +++-------------- crates/sui-types/src/digests.rs | 6 +++--- crates/sui-types/src/messages_checkpoint.rs | 3 --- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/crates/sui-types/src/base_types.rs b/crates/sui-types/src/base_types.rs index fcd826b8593e7..8d46a4b72b0c4 100644 --- a/crates/sui-types/src/base_types.rs +++ b/crates/sui-types/src/base_types.rs @@ -6,6 +6,7 @@ pub use crate::committee::EpochId; use crate::crypto::{ AuthorityPublicKey, AuthorityPublicKeyBytes, KeypairTraits, PublicKey, SuiPublicKey, }; +pub use crate::digests::{ObjectDigest, TransactionDigest, TransactionEffectsDigest}; use crate::error::ExecutionError; use crate::error::ExecutionErrorKind; use crate::error::SuiError; @@ -16,6 +17,8 @@ use crate::sui_serde::Readable; use crate::sui_serde::ToArray; use anyhow::anyhow; use fastcrypto::encoding::decode_bytes_hex; +use fastcrypto::encoding::{Encoding, Hex}; +use fastcrypto::hash::{HashFunction, Sha3_256}; use move_core_types::account_address::AccountAddress; use move_core_types::ident_str; use move_core_types::identifier::IdentStr; @@ -29,20 +32,6 @@ use std::convert::{TryFrom, TryInto}; use std::fmt; use std::str::FromStr; -pub use crate::committee::EpochId; -use crate::crypto::{ - AuthorityPublicKey, AuthorityPublicKeyBytes, KeypairTraits, PublicKey, SuiPublicKey, -}; -pub use crate::digests::{ObjectDigest, TransactionDigest, TransactionEffectsDigest}; -use crate::error::ExecutionError; -use crate::error::ExecutionErrorKind; -use crate::error::SuiError; -use crate::gas_coin::GasCoin; -use crate::object::{Object, Owner}; -use crate::sui_serde::Readable; -use fastcrypto::encoding::{Encoding, Hex}; -use fastcrypto::hash::{HashFunction, Sha3_256}; - #[cfg(test)] #[path = "unit_tests/base_types_tests.rs"] mod base_types_tests; diff --git a/crates/sui-types/src/digests.rs b/crates/sui-types/src/digests.rs index 383add21f888a..3e9bc3ca86a69 100644 --- a/crates/sui-types/src/digests.rs +++ b/crates/sui-types/src/digests.rs @@ -4,11 +4,11 @@ use std::fmt; use crate::sui_serde::Readable; +use crate::sui_serde::ToArray; use fastcrypto::encoding::{Base58, Base64, Encoding}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, Bytes}; - /// A representation of a SHA3-256 Digest #[serde_as] #[derive( @@ -16,7 +16,7 @@ use serde_with::{serde_as, Bytes}; )] pub struct Sha3Digest( #[schemars(with = "Base58")] - #[serde_as(as = "Readable")] + #[serde_as(as = "Readable, Bytes>")] [u8; 32], ); @@ -464,7 +464,7 @@ impl fmt::UpperHex for TransactionEffectsDigest { #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema)] pub struct ObjectDigest( #[schemars(with = "Base64")] - #[serde_as(as = "Readable")] + #[serde_as(as = "Readable, Bytes>")] [u8; 32], // Sha3Digest, ); diff --git a/crates/sui-types/src/messages_checkpoint.rs b/crates/sui-types/src/messages_checkpoint.rs index da0842cbb7af5..bced8f2ee8179 100644 --- a/crates/sui-types/src/messages_checkpoint.rs +++ b/crates/sui-types/src/messages_checkpoint.rs @@ -18,15 +18,12 @@ use crate::{ crypto::{sha3_hash, AuthoritySignature, VerificationObligation}, error::SuiError, }; -use fastcrypto::encoding::{Base58, Encoding, Hex}; use schemars::JsonSchema; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; pub use crate::digests::CheckpointContentsDigest; pub use crate::digests::CheckpointDigest; -use std::fmt::{Debug, Display, Formatter}; -use std::slice::Iter; pub type CheckpointSequenceNumber = u64; pub type CheckpointTimestamp = u64;