Skip to content

Commit

Permalink
refactor: renaming for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant committed Aug 9, 2024
1 parent 7e17e83 commit 07946db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1722,10 +1722,10 @@ impl<'a> Context<'a> {
{
databus = BlockType::ReturnData;
}
for (user_id, array_id) in self.data_bus.call_data_array() {
for (call_data_id, array_id) in self.data_bus.call_data_array() {
if self.block_id(&array_id) == array {
assert!(databus == BlockType::Memory);
databus = BlockType::CallData(user_id);
databus = BlockType::CallData(call_data_id);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl DataBusBuilder {
#[derive(Clone, Debug)]
pub(crate) struct CallData {
/// The id to this calldata assigned by the user
pub(crate) calldata_id: u32,
pub(crate) call_data_id: u32,
pub(crate) array_id: ValueId,
pub(crate) index_map: HashMap<ValueId, usize>,
}
Expand All @@ -83,15 +83,15 @@ impl DataBus {
CallData {
array_id: f(cd.array_id),
index_map: call_data_map,
calldata_id: cd.calldata_id,
call_data_id: cd.call_data_id,
}
})
.collect();
DataBus { call_data, return_data: self.return_data.map(&mut f) }
}

pub(crate) fn call_data_array(&self) -> Vec<(u32, ValueId)> {
self.call_data.iter().map(|cd| (cd.calldata_id, cd.array_id)).collect()
self.call_data.iter().map(|cd| (cd.call_data_id, cd.array_id)).collect()
}
/// Construct a databus from call_data and return_data data bus builders
pub(crate) fn get_data_bus(
Expand All @@ -101,12 +101,9 @@ impl DataBus {
let mut call_data_args = Vec::new();
for call_data_item in call_data {
let array_id = call_data_item.databus.expect("Call data should have an array id");
let user_id = call_data_item.call_data_id.expect("Call data should have a user id");
call_data_args.push(CallData {
array_id,
calldata_id: user_id,
index_map: call_data_item.map,
});
let call_data_id =
call_data_item.call_data_id.expect("Call data should have a user id");
call_data_args.push(CallData { array_id, call_data_id, index_map: call_data_item.map });
}

DataBus { call_data: call_data_args, return_data: return_data.databus }
Expand Down

0 comments on commit 07946db

Please sign in to comment.