Skip to content

Commit

Permalink
chore: add comments, rename test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Nov 15, 2024
1 parent 0619ab1 commit 8defcc4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion miden-tx/src/tests/kernel_tests/test_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,15 +821,26 @@ fn test_fpi_memory() {

let process = tx_context.execute_code(&code).unwrap();

// Check that the second invocation of the foreign procedure from the same account does not load
// the account data again: already loaded data should be reused.
//
// Native account: [2048; 4095] <- initialized during prologue
// Foreign account: [4096; 6143] <- initialized during first FPI
// Next account slot: [6144; 8191] <- should not be initialized
assert_eq!(
try_read_root_mem_value(&process, NATIVE_ACCOUNT_DATA_PTR + ACCOUNT_DATA_LENGTH as u32 * 2),
None,
"Memory starting from 6144 should stay uninitialized"
);
}

/// Test the correctness of the foreign procedure execution.
///
/// It checks the foreign account code loading, providing the mast forest to the executor,
/// construction of the account procedure maps and execution the foreign procedure in order to
/// obtain the data from the foreign account's storage slot.
#[test]
fn test_fpi_basic() {
fn test_fpi_execute_foreign_procedure() {
let foreign_account_code_source = "
use.miden::account
Expand Down

0 comments on commit 8defcc4

Please sign in to comment.