diff --git a/src/uint.rs b/src/uint.rs index 62d647c..4d7243d 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -12,9 +12,8 @@ pub use self::convert::AsU256; use crate::I256; use borsh::{BorshDeserialize, BorshSerialize}; use core::num::ParseIntError; -use cosmwasm_std::Uint128; #[cfg(feature = "cosmwasm")] -use cosmwasm_std::{Decimal256, Uint256}; +use cosmwasm_std::{Decimal256, Uint128, Uint256, Uint64}; use serde::{Deserialize, Serialize}; /// A 256-bit unsigned integer type. @@ -51,6 +50,21 @@ impl Into for U256 { } } +#[cfg(feature = "cosmwasm")] +impl From for U256 { + fn from(u: Uint64) -> Self { + U256::from(u.u64()) + } +} + +#[cfg(feature = "cosmwasm")] +#[allow(clippy::from_over_into)] +impl Into for U256 { + fn into(self) -> Uint64 { + Uint64::new(self.as_u64()) + } +} + #[cfg(feature = "cosmwasm")] #[allow(clippy::from_over_into)] impl Into for U256 {