Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom authored Oct 24, 2023
1 parent f7527e1 commit da9e5b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zcash_primitives/src/transaction/components/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ impl NonNegativeAmount {
Self::from_u64(amount)
}

/// Reads a NonNegativeAmount from a signed 64-bit little-endian integer.
/// Reads a NonNegativeAmount from a signed 63-bit integer represented as a 64-bit little-endian value.
///
/// Returns an error if the amount is outside the range `{0..MAX_MONEY}`.
pub fn from_nonnegative_i64_le_bytes(bytes: [u8; 8]) -> Result<Self, ()> {
let amount = i64::from_le_bytes(bytes);
Self::from_nonnegative_i64(amount)
}

/// Returns this NonNegativeAmount encoded as a signed 64-bit little-endian integer.
/// Returns this NonNegativeAmount encoded as 64 bits in little-endian order.
pub fn to_i64_le_bytes(self) -> [u8; 8] {
self.0.to_i64_le_bytes()
}
Expand Down

0 comments on commit da9e5b6

Please sign in to comment.