Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/web-client/src/miden_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ macro_rules! declare_js_miden_arrays {
Self::new(Some(vec))
}
}

impl $miden_type_array_name {
#[allow(dead_code)]
pub(crate) fn iter(&self) -> core::slice::Iter<'_, $miden_type_name> {
self.__inner.iter()
}

#[allow(dead_code)]
pub(crate) fn into_iter(self) -> alloc::vec::IntoIter<$miden_type_name> {
self.__inner.into_iter()
}
}
)+
}
};
Expand Down
1 change: 0 additions & 1 deletion crates/web-client/src/models/account_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ impl AccountComponent {
let native_package: NativePackage = package.into();
let native_library = (*native_package.mast).clone();
let native_slots: Vec<NativeStorageSlot> = storage_slots
.__inner
.iter()
.map(|storage_slot| storage_slot.clone().into())
.collect();
Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/src/models/felt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ impl From<&Felt> for NativeFelt {

impl From<&FeltArray> for Vec<NativeFelt> {
fn from(felt_array: &FeltArray) -> Self {
felt_array.__inner.iter().map(Into::into).collect()
felt_array.iter().map(Into::into).collect()
}
}
4 changes: 2 additions & 2 deletions crates/web-client/src/models/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ impl From<&Note> for NativeNote {

impl From<crate::models::miden_arrays::NoteArray> for Vec<NativeNote> {
fn from(note_array: crate::models::miden_arrays::NoteArray) -> Self {
note_array.__inner.into_iter().map(Into::into).collect()
note_array.into_iter().map(Into::into).collect()
}
}

impl From<&crate::models::miden_arrays::NoteArray> for Vec<NativeNote> {
fn from(note_array: &crate::models::miden_arrays::NoteArray) -> Self {
note_array.__inner.iter().cloned().map(Into::into).collect()
note_array.iter().cloned().map(Into::into).collect()
}
}
1 change: 0 additions & 1 deletion crates/web-client/src/models/note_recipient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ impl From<&NoteRecipient> for NativeNoteRecipient {
impl From<&RecipientArray> for Vec<NativeNoteRecipient> {
fn from(recipient_array: &RecipientArray) -> Self {
recipient_array
.__inner
.iter()
.map(NativeNoteRecipient::from)
.collect()
Expand Down
13 changes: 2 additions & 11 deletions crates/web-client/src/models/output_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,12 @@ impl From<&OutputNote> for NativeRawOutputNote {

impl From<OutputNoteArray> for Vec<NativeRawOutputNote> {
fn from(output_notes_array: OutputNoteArray) -> Self {
output_notes_array
.__inner
.into_iter()
.map(Into::into)
.collect()
output_notes_array.into_iter().map(Into::into).collect()
}
}

impl From<&OutputNoteArray> for Vec<NativeRawOutputNote> {
fn from(output_notes_array: &OutputNoteArray) -> Self {
output_notes_array
.__inner
.iter()
.cloned()
.map(Into::into)
.collect()
output_notes_array.iter().cloned().map(Into::into).collect()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,12 @@ impl From<&NoteAndArgs> for (NativeNote, Option<NativeNoteArgs>) {

impl From<NoteAndArgsArray> for Vec<(NativeNote, Option<NativeNoteArgs>)> {
fn from(note_and_args_array: NoteAndArgsArray) -> Self {
note_and_args_array
.__inner
.into_iter()
.map(Into::into)
.collect()
note_and_args_array.into_iter().map(Into::into).collect()
}
}

impl From<&NoteAndArgsArray> for Vec<(NativeNote, Option<NativeNoteArgs>)> {
fn from(note_and_args_array: &NoteAndArgsArray) -> Self {
note_and_args_array.__inner.iter().map(Into::into).collect()
note_and_args_array.iter().map(Into::into).collect()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ impl From<&NoteDetailsAndTag> for (NativeNoteDetails, NativeNoteTag) {
impl From<NoteDetailsAndTagArray> for Vec<(NativeNoteDetails, NativeNoteTag)> {
fn from(note_details_and_tag_array: NoteDetailsAndTagArray) -> Self {
note_details_and_tag_array
.__inner
.into_iter()
.map(Into::into)
.collect()
Expand All @@ -64,10 +63,6 @@ impl From<NoteDetailsAndTagArray> for Vec<(NativeNoteDetails, NativeNoteTag)> {

impl From<&NoteDetailsAndTagArray> for Vec<(NativeNoteDetails, NativeNoteTag)> {
fn from(note_details_and_tag_array: &NoteDetailsAndTagArray) -> Self {
note_details_and_tag_array
.__inner
.iter()
.map(Into::into)
.collect()
note_details_and_tag_array.iter().map(Into::into).collect()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,12 @@ impl From<&NoteIdAndArgs> for (NativeNoteId, Option<NativeNoteArgs>) {

impl From<NoteIdAndArgsArray> for Vec<(NativeNoteId, Option<NativeNoteArgs>)> {
fn from(note_id_and_args_array: NoteIdAndArgsArray) -> Self {
note_id_and_args_array
.__inner
.into_iter()
.map(Into::into)
.collect()
note_id_and_args_array.into_iter().map(Into::into).collect()
}
}

impl From<&NoteIdAndArgsArray> for Vec<(NativeNoteId, Option<NativeNoteArgs>)> {
fn from(note_id_and_args_array: &NoteIdAndArgsArray) -> Self {
note_id_and_args_array
.__inner
.iter()
.map(Into::into)
.collect()
note_id_and_args_array.iter().map(Into::into).collect()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ impl TransactionRequestBuilder {
#[wasm_bindgen(js_name = "withForeignAccounts")]
pub fn with_foreign_accounts(mut self, foreign_accounts: &ForeignAccountArray) -> Self {
let native_foreign_accounts: Vec<NativeForeignAccount> = foreign_accounts
.__inner
.iter()
.map(|account| account.clone().into())
.collect();
Expand Down
4 changes: 0 additions & 4 deletions crates/web-client/src/models/transaction_script_inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ impl From<TransactionScriptInputPair> for (NativeWord, Vec<NativeFelt>) {
let native_word: NativeWord = transaction_script_input_pair.word.into();
let native_felts: Vec<NativeFelt> = transaction_script_input_pair
.felts
.__inner
.into_iter()
.map(Into::into)
.collect();
Expand All @@ -53,7 +52,6 @@ impl From<&TransactionScriptInputPair> for (NativeWord, Vec<NativeFelt>) {
let native_word: NativeWord = transaction_script_input_pair.word.clone().into();
let native_felts: Vec<NativeFelt> = transaction_script_input_pair
.felts
.__inner
.iter()
.map(|felt| (*felt).into())
.collect();
Expand All @@ -64,7 +62,6 @@ impl From<&TransactionScriptInputPair> for (NativeWord, Vec<NativeFelt>) {
impl From<TransactionScriptInputPairArray> for Vec<(NativeWord, Vec<NativeFelt>)> {
fn from(transaction_script_input_pair_array: TransactionScriptInputPairArray) -> Self {
transaction_script_input_pair_array
.__inner
.into_iter()
.map(Into::into)
.collect()
Expand All @@ -74,7 +71,6 @@ impl From<TransactionScriptInputPairArray> for Vec<(NativeWord, Vec<NativeFelt>)
impl From<&TransactionScriptInputPairArray> for Vec<(NativeWord, Vec<NativeFelt>)> {
fn from(transaction_script_input_pair_array: &TransactionScriptInputPairArray) -> Self {
transaction_script_input_pair_array
.__inner
.iter()
.map(Into::into)
.collect()
Expand Down
1 change: 0 additions & 1 deletion crates/web-client/src/new_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ impl WebClient {
if let Some(client) = self.get_mut_inner() {
let foreign_accounts_map: BTreeMap<NativeAccountId, NativeForeignAccount> =
foreign_accounts
.__inner
.iter()
.map(|a| {
let fa: NativeForeignAccount = a.clone().into();
Expand Down