Skip to content

Commit

Permalink
feat: add hash() method to Block struct
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbinth committed Apr 25, 2024
1 parent 405d46f commit 1f6a1c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bench-tx/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use vm_processor::{ExecutionOptions, RecAdviceProvider, Word};

mod utils;
use utils::{
get_account_with_default_account_code, write_bench_results_to_json, MockDataStore, String,
ToString, Vec, ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN,
ACCOUNT_ID_REGULAR_ACCOUNT_UPDATABLE_CODE_OFF_CHAIN, ACCOUNT_ID_SENDER, DEFAULT_AUTH_SCRIPT,
get_account_with_default_account_code, write_bench_results_to_json, MockDataStore,
ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN, ACCOUNT_ID_REGULAR_ACCOUNT_UPDATABLE_CODE_OFF_CHAIN,
ACCOUNT_ID_SENDER, DEFAULT_AUTH_SCRIPT,
};

pub enum Benchmark {
Expand Down
6 changes: 1 addition & 5 deletions bench-tx/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
extern crate alloc;
pub use alloc::{
collections::BTreeMap,
string::{String, ToString},
vec::Vec,
};
pub use alloc::collections::BTreeMap;

use miden_lib::transaction::TransactionKernel;
use miden_objects::{
Expand Down
7 changes: 6 additions & 1 deletion objects/src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ impl Block {
}
}

/// Returns the block header.
/// Returns a commitment to this block.
pub fn hash(&self) -> Digest {
self.header.hash()
}

/// Returns the header of this block.
pub fn header(&self) -> BlockHeader {
self.header
}
Expand Down

0 comments on commit 1f6a1c1

Please sign in to comment.