11use std:: collections:: HashMap ;
22use std:: fmt:: Display ;
33use std:: str:: FromStr ;
4- use std:: sync:: Arc ;
4+ use std:: sync:: { Arc , LazyLock , OnceLock } ;
55
66use bitcoin:: bip32:: { DerivationPath , Xpriv , Xpub } ;
77use bitcoin:: hashes:: { ripemd160, sha256, Hash } ;
@@ -10,7 +10,6 @@ use bitcoin::secp256k1::{All, Message, Secp256k1};
1010use cosmos_sdk_proto:: cosmos:: bank:: v1beta1:: MsgSend ;
1111use cosmos_sdk_proto:: cosmos:: base:: abci:: v1beta1:: TxResponse ;
1212use cosmos_sdk_proto:: cosmos:: base:: v1beta1:: Coin ;
13- use once_cell:: sync:: { Lazy , OnceCell } ;
1413use parking_lot:: Mutex ;
1514use rand:: Rng ;
1615use tiny_keccak:: { Hasher , Keccak } ;
@@ -238,8 +237,8 @@ impl DerivationPathConfig {
238237
239238 pub fn as_derivation_path ( & self ) -> Arc < DerivationPath > {
240239 type DerivationPathMap = HashMap < DerivationPathConfig , Arc < DerivationPath > > ;
241- static PATHS : Lazy < Arc < Mutex < DerivationPathMap > > > =
242- Lazy :: new ( || Arc :: new ( Mutex :: new ( HashMap :: new ( ) ) ) ) ;
240+ static PATHS : LazyLock < Arc < Mutex < DerivationPathMap > > > =
241+ LazyLock :: new ( || Arc :: new ( Mutex :: new ( HashMap :: new ( ) ) ) ) ;
243242 let mut guard = PATHS . lock ( ) ;
244243 match guard. get ( self ) {
245244 Some ( s) => s. clone ( ) ,
@@ -302,7 +301,7 @@ pub(crate) enum WalletPublicKey {
302301}
303302
304303fn global_secp ( ) -> & ' static Secp256k1 < All > {
305- static CELL : OnceCell < Secp256k1 < All > > = OnceCell :: new ( ) ;
304+ static CELL : OnceLock < Secp256k1 < All > > = OnceLock :: new ( ) ;
306305 CELL . get_or_init ( Secp256k1 :: new)
307306}
308307
0 commit comments