Skip to content

Commit 9ad0bdb

Browse files
committed
chore: Remove leftovers
1 parent f69a2fe commit 9ad0bdb

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

crates/miden-tx/src/executor/data_store.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ use crate::DataStoreError;
1515
// DATA STORE TRAIT
1616
// ================================================================================================
1717

18-
/// The [`DataStore] trait defines the interface that transaction objects use to fetch data
18+
/// The [DataStore] trait defines the interface that transaction objects use to fetch data
1919
/// required for transaction execution.
2020
#[maybe_async_trait]
2121
pub trait DataStore {
2222
/// Returns blockchain-related data required to execute a transaction against a specific
2323
/// account, that consumes specific notes.
2424
///
2525
/// The returned [`ChainMmr`] is expected to contain the complete set of requested
26-
/// block numbers.
26+
/// block numbers (`ref_blocks`).
2727
///
2828
/// # Errors
2929
/// Returns an error if:
@@ -34,6 +34,7 @@ pub trait DataStore {
3434
fn get_chain_inputs(
3535
&self,
3636
ref_blocks: BTreeSet<BlockNumber>,
37+
block_header: BlockNumber,
3738
) -> Result<(ChainMmr, BlockHeader), DataStoreError>;
3839

3940
/// Returns account data required to execute a transaction.

crates/miden-tx/src/executor/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ impl TransactionExecutor {
114114
notes: InputNotes<InputNote>,
115115
tx_args: TransactionArgs,
116116
) -> Result<ExecutedTransaction, TransactionExecutorError> {
117+
// Get all required
117118
let mut ref_blocks: BTreeSet<BlockNumber> = BTreeSet::new();
118119
ref_blocks.insert(block_ref);
119120
for notes in notes.iter() {
@@ -128,7 +129,7 @@ impl TransactionExecutor {
128129
let (account, seed) = maybe_await!(self.data_store.get_account_inputs(account_id))
129130
.map_err(TransactionExecutorError::FetchTransactionInputsFailed)?;
130131

131-
let (mmr, header) = maybe_await!(self.data_store.get_chain_inputs(ref_blocks))
132+
let (mmr, header) = maybe_await!(self.data_store.get_chain_inputs(ref_blocks, block_ref))
132133
.map_err(TransactionExecutorError::FetchTransactionInputsFailed)?;
133134

134135
let tx_inputs = TransactionInputs::new(account, seed, header, mmr, notes)
@@ -139,9 +140,6 @@ impl TransactionExecutor {
139140

140141
let advice_recorder: RecAdviceProvider = advice_inputs.into();
141142

142-
// load note script MAST into the MAST store
143-
// self.mast_store.load_transaction_code(&tx_inputs, &tx_args);
144-
145143
let mut host = TransactionHost::new(
146144
tx_inputs.account().into(),
147145
advice_recorder,
@@ -205,7 +203,7 @@ impl TransactionExecutor {
205203
let (account, seed) = maybe_await!(self.data_store.get_account_inputs(account_id))
206204
.map_err(TransactionExecutorError::FetchTransactionInputsFailed)?;
207205

208-
let (mmr, header) = maybe_await!(self.data_store.get_chain_inputs(ref_blocks))
206+
let (mmr, header) = maybe_await!(self.data_store.get_chain_inputs(ref_blocks, block_ref))
209207
.map_err(TransactionExecutorError::FetchTransactionInputsFailed)?;
210208

211209
let tx_inputs = TransactionInputs::new(account, seed, header, mmr, Default::default())

crates/miden-tx/src/testing/tx_context/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ impl DataStore for TransactionContext {
155155
fn get_chain_inputs(
156156
&self,
157157
_ref_blocks: BTreeSet<BlockNumber>,
158+
_block_header: BlockNumber,
158159
) -> Result<(ChainMmr, BlockHeader), DataStoreError> {
159160
let mmr = self.tx_inputs.block_chain().clone();
160161
let block = self.tx_inputs.block_header().clone();

crates/miden-tx/src/tests/kernel_tests/test_note.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,21 +625,26 @@ pub fn test_timelock() {
625625

626626
let code = format!(
627627
"
628-
use.miden::note
629-
use.miden::tx
628+
use.miden::note
629+
use.miden::tx
630+
630631
begin
631632
# store the note inputs to memory starting at address 0
632633
push.0 exec.note::get_inputs
633634
# => [num_inputs, inputs_ptr]
635+
634636
# make sure the number of inputs is 1
635637
eq.1 assert.err=789
636638
# => [inputs_ptr]
639+
637640
# read the timestamp at which the note can be consumed
638641
mem_load
639642
# => [timestamp]
643+
640644
exec.tx::get_block_timestamp
641645
# => [block_timestamp, timestamp]
642646
# ensure block timestamp is newer than timestamp
647+
643648
lte assert.err={TIMESTAMP_ERROR}
644649
# => []
645650
end"

0 commit comments

Comments
 (0)