Explorar el Código

contract/dao: impl Display for DaoBulla

parazyd hace 3 años
padre
commit
aa5caa7988
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      src/contract/dao/src/dao_model.rs

+ 7 - 0
src/contract/dao/src/dao_model.rs

@@ -66,6 +66,13 @@ impl TryFrom<&str> for DaoBulla {
     }
 }
 
+impl core::fmt::Display for DaoBulla {
+    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
+        let disp: String = bs58::encode(self.0.to_repr()).into_string();
+        write!(f, "{}", disp)
+    }
+}
+
 #[derive(SerialEncodable, SerialDecodable)]
 pub struct DaoMintParams {
     pub dao_bulla: DaoBulla,