diff --git a/src/models/blockchain/block/mod.rs b/src/models/blockchain/block/mod.rs index 40323b3b..6bcc171e 100644 --- a/src/models/blockchain/block/mod.rs +++ b/src/models/blockchain/block/mod.rs @@ -89,7 +89,6 @@ pub enum BlockProof { /// // mutate an internal field. /// block.kernel.header.nonce = nonce; /// ``` - // ## About the private `digest` field: // // The `digest` field represents the `Block` hash. It is an optimization so @@ -118,8 +117,9 @@ pub enum BlockProof { // exist no impls for `OnceLock<_>` so derive fails. // // A unit test-suite exists in module tests::digest_encapsulation. -#[readonly::make] +#[allow(non_local_definitions)] // needed for [Deserialize] macro from serde #[derive(Clone, Debug, Serialize, Deserialize, BFieldCodec, GetSize)] +#[readonly::make] pub struct Block { /// Everything but the proof pub kernel: BlockKernel, diff --git a/src/models/blockchain/transaction/validity/tasm/transaction_kernel_mast_hash.rs b/src/models/blockchain/transaction/validity/tasm/transaction_kernel_mast_hash.rs index 15b8f7da..3cc23f3e 100644 --- a/src/models/blockchain/transaction/validity/tasm/transaction_kernel_mast_hash.rs +++ b/src/models/blockchain/transaction/validity/tasm/transaction_kernel_mast_hash.rs @@ -204,9 +204,6 @@ impl BasicSnippet for TransactionKernelMastHash { mod tests { use std::collections::HashMap; - use crate::models::blockchain::shared::Hash; - use crate::models::blockchain::transaction::transaction_kernel::transaction_kernel_tests::pseudorandom_transaction_kernel; - use crate::prelude::twenty_first; use num_traits::One; use rand::rngs::StdRng; use rand::Rng; @@ -226,7 +223,10 @@ mod tests { use twenty_first::util_types::algebraic_hasher::Domain; use super::*; + use crate::models::blockchain::shared::Hash; + use crate::models::blockchain::transaction::transaction_kernel::transaction_kernel_tests::pseudorandom_transaction_kernel; use crate::models::proof_abstractions::mast_hash::MastHash; + use crate::prelude::twenty_first; impl TransactionKernelMastHash { pub(crate) fn input_state_with_kernel_in_memory( diff --git a/src/models/state/mod.rs b/src/models/state/mod.rs index 8dec5588..1b744818 100644 --- a/src/models/state/mod.rs +++ b/src/models/state/mod.rs @@ -2346,7 +2346,7 @@ mod global_state_tests { "Exactly {expected_num_blocks_at_tip_height} blocks at height must be known" ); assert_eq!( - expected_parent.hash(), + expected_parent_digest, global_state .chain .archival_state()