import { writeFixture } from '../test/util' ; import { toKeyPair } from '..' ; import { wallet } from '@sidetree/test-vectors' ; const WRITE_FIXTURE_TO_DISK = false ; it ( 'can generate test fixture' , async ( ) => { const fixture = { keypair : [ ] } ; for ( let i = 0 ; i < wallet . mnemonic . length ; i ++ ) { const { mnemonic } = wallet . mnemonic [ i ] ; const kp0 = await toKeyPair ( mnemonic , 0 , 'Ed25519' ) ; const kp1 = await toKeyPair ( mnemonic , 0 , 'X25519' ) ; const kp2 = await toKeyPair ( mnemonic , 0 , 'secp256k1' ) ; fixture . keypair . push ( { mnemonic , Ed25519 : kp0 , X25519 : kp1 , secp256k1 : kp2 } ) ; } expect ( fixture . keypair ) . toEqual ( wallet . keypair ) ; if ( WRITE_FIXTURE_TO_DISK ) { writeFixture ( 'v1-keypair.json' , fixture ) ; } } ) ;