Skip to content

Commit

Permalink
Make Uint256::new const
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Sep 3, 2021
1 parent 2dffdd0 commit 5d0745a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ and this project adheres to

- cosmwasm-std: Implement `Mul` and `MulAssign` for `Uint128`.
- cosmwasm-std: Implement `FromStr` for `Uint128`, `Uint256`, and `Uint512`.
- cosmwasm-std: Make `Uint256::from_le_bytes` and `::from_be_bytes` const.
- cosmwasm-std: Make `Uint256::from_le_bytes`, `::from_be_bytes` and `::new`
const.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion packages/std/src/math/uint256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Uint256 {

/// Creates a Uint256(value) from a big endian representation. It's just an alias for
/// `from_big_endian`.
pub fn new(value: [u8; 32]) -> Self {
pub const fn new(value: [u8; 32]) -> Self {
Self::from_be_bytes(value)
}

Expand Down

0 comments on commit 5d0745a

Please sign in to comment.