Skip to content

Commit

Permalink
test: Add expiration number to proven tx builder (#507)
Browse files Browse the repository at this point in the history
* feat: Add expiration num to mock tx builder

* Revery miden-base branch

* Lints
  • Loading branch information
igamigo authored Sep 30, 2024
1 parent 10df0e2 commit 8a9aa8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions crates/block-producer/src/test_utils/proven_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct MockProvenTxBuilder {
account_id: AccountId,
initial_account_hash: Digest,
final_account_hash: Digest,
expiration_block_num: u32,
output_notes: Option<Vec<OutputNote>>,
input_notes: Option<Vec<InputNote>>,
nullifiers: Option<Vec<Nullifier>>,
Expand All @@ -37,6 +38,7 @@ impl MockProvenTxBuilder {
account_id,
initial_account_hash,
final_account_hash,
expiration_block_num: u32::MAX,
output_notes: None,
input_notes: None,
nullifiers: None,
Expand All @@ -55,6 +57,12 @@ impl MockProvenTxBuilder {
self
}

pub fn expiration_block_num(mut self, expiration_block_num: u32) -> Self {
self.expiration_block_num = expiration_block_num;

self
}

pub fn output_notes(mut self, notes: Vec<OutputNote>) -> Self {
self.output_notes = Some(notes);

Expand Down Expand Up @@ -99,6 +107,7 @@ impl MockProvenTxBuilder {
self.initial_account_hash,
self.final_account_hash,
Digest::default(),
self.expiration_block_num,
ExecutionProof::new(Proof::new_dummy(), HashFunction::Blake3_192),
)
.add_input_notes(self.input_notes.unwrap_or_default())
Expand Down

0 comments on commit 8a9aa8b

Please sign in to comment.