File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ import  {  describe ,  bench  }  from  'vitest' ; 
2+ 
3+ import  fixtures  from  './fixtures' ; 
4+ import  {  secp256k1 ,  SLIP10Node  }  from  '../src' ; 
5+ import  {  deriveChildKey  }  from  '../src/derivers/bip39' ; 
6+ 
7+ describe ( 'SLIP10Node' ,  async  ( )  =>  { 
8+   const  privateNode  =  await  deriveChildKey ( { 
9+     path : fixtures . local . seed , 
10+     curve : secp256k1 , 
11+   } ) ; 
12+ 
13+   const  publicNode  =  privateNode . neuter ( ) ; 
14+ 
15+   describe ( 'fromExtendedKey' ,  ( )  =>  { 
16+     describe ( 'from a JSON object' ,  ( )  =>  { 
17+       bench ( 'with a private key' ,  async  ( )  =>  { 
18+         await  SLIP10Node . fromExtendedKey ( privateNode . toJSON ( ) ) ; 
19+       } ) ; 
20+ 
21+       bench ( 'with a public key' ,  async  ( )  =>  { 
22+         await  SLIP10Node . fromExtendedKey ( publicNode . toJSON ( ) ) ; 
23+       } ) ; 
24+     } ) ; 
25+ 
26+     describe ( 'from an extended key' ,  ( )  =>  { 
27+       bench ( 'with a private key' ,  async  ( )  =>  { 
28+         await  SLIP10Node . fromExtendedKey ( privateNode . extendedKey ) ; 
29+       } ) ; 
30+ 
31+       bench ( 'with a public key' ,  async  ( )  =>  { 
32+         await  SLIP10Node . fromExtendedKey ( publicNode . extendedKey ) ; 
33+       } ) ; 
34+     } ) ; 
35+   } ) ; 
36+ } ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments