Skip to content

Commit

Permalink
usize wrapping arithmetic for num_readonly_accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Sep 10, 2024
1 parent 9caa62c commit 56be399
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions transaction-view/src/resolved_transaction_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,11 @@ impl<D: TransactionData> ResolvedTransactionView<D> {
}

fn num_readonly_accounts(&self) -> usize {
usize::from(
self.view
.total_readonly_lookup_accounts()
.wrapping_add(u16::from(self.view.num_readonly_signed_static_accounts()))
.wrapping_add(u16::from(self.view.num_readonly_unsigned_static_accounts())),
)
usize::from(self.view.total_readonly_lookup_accounts())
.wrapping_add(usize::from(self.view.num_readonly_signed_static_accounts()))
.wrapping_add(usize::from(
self.view.num_readonly_unsigned_static_accounts(),
))
}

fn signature_details(&self) -> TransactionSignatureDetails {
Expand Down

0 comments on commit 56be399

Please sign in to comment.