@@ -29,7 +29,7 @@ use std::fs::File;
2929use std:: io:: { Read , Seek , SeekFrom } ;
3030use tracing:: info;
3131
32- pub use crate :: hash:: { AddrKeyhash , Hash , ScriptHash } ;
32+ pub use crate :: hash:: Hash ;
3333pub use crate :: stake_addresses:: { AccountState , StakeAddressState } ;
3434pub use crate :: StakeCredential ;
3535
@@ -74,7 +74,7 @@ impl<'b, C> minicbor::decode::Decode<'b, C> for StakeCredential {
7474 Ok ( StakeCredential :: ScriptHash ( key_hash) )
7575 }
7676 1 => {
77- // AddrKeyHash variant (second in enum) - decode bytes directly
77+ // AddrKeyHash variant (second in enum) - decodes bytes directly
7878 let bytes = d. bytes ( ) ?;
7979 let key_hash = KeyHash :: try_from ( bytes) . map_err ( |_| {
8080 minicbor:: decode:: Error :: message (
@@ -307,6 +307,8 @@ impl<'b, C> minicbor::Decode<'b, C> for Account {
307307// Type aliases for pool_params compatibility
308308// -----------------------------------------------------------------------------
309309
310+ pub use crate :: types:: AddrKeyhash ;
311+ pub use crate :: types:: ScriptHash ;
310312use crate :: { KeyHash , PoolId } ;
311313/// Alias minicbor as cbor for pool_params module
312314pub use minicbor as cbor;
@@ -1086,12 +1088,8 @@ impl StreamingSnapshotParser {
10861088 // Convert DRep delegation from StrictMaybe<DRep> to Option<DRepChoice>
10871089 let delegated_drep = match & account. drep {
10881090 StrictMaybe :: Just ( drep) => Some ( match drep {
1089- DRep :: Key ( hash) => crate :: DRepChoice :: Key (
1090- KeyHash :: try_from ( hash. as_ref ( ) . to_vec ( ) ) . unwrap ( ) ,
1091- ) ,
1092- DRep :: Script ( hash) => crate :: DRepChoice :: Script (
1093- KeyHash :: try_from ( hash. as_ref ( ) . to_vec ( ) ) . unwrap ( ) ,
1094- ) ,
1091+ DRep :: Key ( hash) => crate :: DRepChoice :: Key ( * hash) ,
1092+ DRep :: Script ( hash) => crate :: DRepChoice :: Script ( * hash) ,
10951093 DRep :: Abstain => crate :: DRepChoice :: Abstain ,
10961094 DRep :: NoConfidence => crate :: DRepChoice :: NoConfidence ,
10971095 } ) ,
@@ -1456,12 +1454,8 @@ impl StreamingSnapshotParser {
14561454 // Convert DRep delegation from StrictMaybe<DRep> to Option<DRepChoice>
14571455 let delegated_drep = match & account. drep {
14581456 StrictMaybe :: Just ( drep) => Some ( match drep {
1459- DRep :: Key ( hash) => crate :: DRepChoice :: Key (
1460- KeyHash :: try_from ( hash. as_ref ( ) . to_vec ( ) ) . unwrap ( ) ,
1461- ) ,
1462- DRep :: Script ( hash) => crate :: DRepChoice :: Script (
1463- KeyHash :: try_from ( hash. as_ref ( ) . to_vec ( ) ) . unwrap ( ) ,
1464- ) ,
1457+ DRep :: Key ( hash) => crate :: DRepChoice :: Key ( * hash) ,
1458+ DRep :: Script ( hash) => crate :: DRepChoice :: Script ( * hash) ,
14651459 DRep :: Abstain => crate :: DRepChoice :: Abstain ,
14661460 DRep :: NoConfidence => crate :: DRepChoice :: NoConfidence ,
14671461 } ) ,
0 commit comments