@@ -110,7 +110,7 @@ impl DirkManager {
110110 . iter ( )
111111 . filter_map ( |account| {
112112 if expected_accounts. contains ( & account. name ) {
113- Some ( BlsPublicKey :: from ( FixedBytes :: from_slice ( & account. public_key ) ) )
113+ BlsPublicKey :: try_from ( account. public_key . as_slice ( ) ) . ok ( )
114114 } else {
115115 None
116116 }
@@ -128,7 +128,7 @@ impl DirkManager {
128128 if self . wallets . contains ( & wallet. to_string ( ) ) &&
129129 account. name != format ! ( "{wallet}/consensus" )
130130 {
131- Some ( BlsPublicKey :: from ( FixedBytes :: from_slice ( & account. public_key ) ) )
131+ BlsPublicKey :: try_from ( account. public_key . as_slice ( ) ) . ok ( )
132132 } else {
133133 None
134134 }
@@ -147,7 +147,7 @@ impl DirkManager {
147147 for wallet in self . wallets . iter ( ) {
148148 let Some ( consensus_key) = accounts. iter ( ) . find_map ( |account| {
149149 if account. name == format ! ( "{wallet}/consensus" ) {
150- Some ( BlsPublicKey :: from ( FixedBytes :: from_slice ( & account. public_key ) ) )
150+ BlsPublicKey :: try_from ( account. public_key . as_slice ( ) ) . ok ( )
151151 } else {
152152 None
153153 }
@@ -159,7 +159,7 @@ impl DirkManager {
159159 . iter ( )
160160 . filter_map ( |account| {
161161 if account. name . starts_with ( & format ! ( "{wallet}/{module_id}" ) ) {
162- Some ( BlsPublicKey :: from ( FixedBytes :: from_slice ( & account. public_key ) ) )
162+ BlsPublicKey :: try_from ( account. public_key . as_slice ( ) ) . ok ( )
163163 } else {
164164 None
165165 }
@@ -244,7 +244,7 @@ impl DirkManager {
244244 self . store_password ( account_name. clone ( ) , new_password. clone ( ) ) ?;
245245
246246 let proxy_key =
247- BlsPublicKey :: from ( FixedBytes :: from_slice ( & generate_response. into_inner ( ) . public_key ) ) ;
247+ BlsPublicKey :: try_from ( generate_response. into_inner ( ) . public_key . as_slice ( ) ) ? ;
248248
249249 self . unlock_account ( account_name, new_password) . await ?;
250250
@@ -296,6 +296,8 @@ impl DirkManager {
296296 eyre:: bail!( "Sign request failed" ) ;
297297 }
298298
299- Ok ( BlsSignature :: from ( FixedBytes :: from_slice ( & sign_response. into_inner ( ) . signature ) ) )
299+ Ok ( BlsSignature :: from ( FixedBytes :: try_from (
300+ sign_response. into_inner ( ) . signature . as_slice ( ) ,
301+ ) ?) )
300302 }
301303}
0 commit comments