implement Debug for num256
@@ -18,7 +18,7 @@ use serde::{Deserialize, Deserializer, Serializer};
use std::str::FromStr;
-#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Uint256(BigUint);
impl Deref for Uint256 {
@@ -58,6 +58,13 @@ impl fmt::Display for Uint256 {
}
}
+impl fmt::Debug for Uint256 {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "Uint256 {}", self.to_string())
+ }
+}
+
+
impl Serialize for Uint256 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
@@ -118,7 +125,7 @@ impl CheckedSub for Uint256 {
}
}
-#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Int256(BigInt);
impl Deref for Int256 {
@@ -162,6 +169,12 @@ impl fmt::Display for Int256 {
}
}
+impl fmt::Debug for Int256 {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "Int256 {}", self.to_string())
+ }
+}
+
impl Serialize for Int256 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
