소스 검색

MerkleNode: display as hex string instead of base58

zero 2 년 전
부모
커밋
afa66e2bb0
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      src/sdk/src/crypto/merkle_node.rs

+ 7 - 4
src/sdk/src/crypto/merkle_node.rs

@@ -32,9 +32,12 @@ use subtle::{Choice, ConditionallySelectable};
 #[cfg(feature = "async")]
 use darkfi_serial::async_trait;
 
-use crate::crypto::constants::{
-    sinsemilla::{i2lebsp_k, L_ORCHARD_MERKLE, MERKLE_CRH_PERSONALIZATION},
-    MERKLE_DEPTH,
+use crate::crypto::{
+    constants::{
+        sinsemilla::{i2lebsp_k, L_ORCHARD_MERKLE, MERKLE_CRH_PERSONALIZATION},
+        MERKLE_DEPTH,
+    },
+    util::FieldElemAsStr,
 };
 
 pub type MerkleTree = BridgeTree<MerkleNode, usize, { MERKLE_DEPTH }>;
@@ -91,7 +94,7 @@ impl From<pallas::Base> for MerkleNode {
 
 impl fmt::Display for MerkleNode {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "{}", bs58::encode(self.to_bytes()).into_string())
+        write!(f, "{}", self.0.to_string())
     }
 }