Skip to content

Commit

Permalink
Changed procedure offsets from enumerate to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Aug 4, 2024
1 parent ebd14bb commit 504e5d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions miden-lib/asm/miden/kernels/tx/account.masm
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,11 @@ end
#! Output: [offset_slot_index]
export.offset_storage_index
# verify that slot_index is in bounds
dup.1 exec.get_max_storage_slot_index lt assert.err=111
# assert.err=ERR_STORAGE_SLOT_INDEX_OUT_OF_BOUNDS
dup.1 exec.get_max_storage_slot_index lt assert.err=ERR_STORAGE_SLOT_INDEX_OUT_OF_BOUNDS
# => [storage_offset, slot_index]

# verify that the computed offset_slot_index is in bounds
add dup exec.get_max_storage_slot_index lt assert.err=112
# assert.err=ERR_STORAGE_SLOT_INDEX_OUT_OF_BOUNDS
add dup exec.get_max_storage_slot_index lt assert.err=ERR_STORAGE_SLOT_INDEX_OUT_OF_BOUNDS
# => [offset_slot_index]
end

Expand Down
7 changes: 2 additions & 5 deletions objects/src/accounts/code/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,8 @@ impl AccountCode {
.map_err(AccountError::AccountCodeAssemblerError)?;

// TODO: Find way to input offset
let procedures: Vec<AccountProcedureInfo> = procedures
.into_iter()
.enumerate()
.map(|(i, proc)| AccountProcedureInfo::new(proc, i as u16))
.collect();
let procedures: Vec<AccountProcedureInfo> =
procedures.into_iter().map(|proc| AccountProcedureInfo::new(proc, 0)).collect();

// make sure the number of procedures is between 1 and 256 (both inclusive)
if procedures.is_empty() {
Expand Down

0 comments on commit 504e5d8

Please sign in to comment.