Procházet zdrojové kódy

contract/dao: impl Display for DaoBulla

parazyd před 3 roky
rodič
revize
aa5caa7988
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  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,