@@ -37,7 +37,7 @@ use sp_core::bandersnatch;
3737}
3838
3939sp_keystore:: bls_experimental_enabled! {
40- use sp_core:: { bls377 , bls381, ecdsa_bls377 , KeccakHasher } ;
40+ use sp_core:: { bls381, ecdsa_bls381 , KeccakHasher } ;
4141}
4242
4343use crate :: { Error , Result } ;
@@ -357,68 +357,42 @@ impl Keystore for LocalKeystore {
357357 self . sign:: <bls381:: Pair >( key_type, public, msg)
358358 }
359359
360- fn bls377_public_keys ( & self , key_type: KeyTypeId ) -> Vec <bls377 :: Public > {
361- self . public_keys:: <bls377 :: Pair >( key_type)
360+ fn ecdsa_bls381_public_keys ( & self , key_type: KeyTypeId ) -> Vec <ecdsa_bls381 :: Public > {
361+ self . public_keys:: <ecdsa_bls381 :: Pair >( key_type)
362362 }
363363
364- /// Generate a new pair compatible with the 'bls377 ' signature scheme.
364+ /// Generate a new pair of paired-keys compatible with the '(ecdsa,bls381) ' signature scheme.
365365 ///
366366 /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory.
367- fn bls377_generate_new (
367+ fn ecdsa_bls381_generate_new (
368368 & self ,
369369 key_type: KeyTypeId ,
370370 seed: Option <& str >,
371- ) -> std:: result:: Result <bls377 :: Public , TraitError > {
372- self . generate_new:: <bls377 :: Pair >( key_type, seed)
371+ ) -> std:: result:: Result <ecdsa_bls381 :: Public , TraitError > {
372+ self . generate_new:: <ecdsa_bls381 :: Pair >( key_type, seed)
373373 }
374374
375- fn bls377_sign (
375+ fn ecdsa_bls381_sign (
376376 & self ,
377377 key_type: KeyTypeId ,
378- public: & bls377 :: Public ,
378+ public: & ecdsa_bls381 :: Public ,
379379 msg: & [ u8 ] ,
380- ) -> std:: result:: Result <Option <bls377 :: Signature >, TraitError > {
381- self . sign:: <bls377 :: Pair >( key_type, public, msg)
380+ ) -> std:: result:: Result <Option <ecdsa_bls381 :: Signature >, TraitError > {
381+ self . sign:: <ecdsa_bls381 :: Pair >( key_type, public, msg)
382382 }
383383
384- fn ecdsa_bls377_public_keys( & self , key_type: KeyTypeId ) -> Vec <ecdsa_bls377:: Public > {
385- self . public_keys:: <ecdsa_bls377:: Pair >( key_type)
386- }
387-
388- /// Generate a new pair of paired-keys compatible with the '(ecdsa,bls377)' signature scheme.
389- ///
390- /// If `[seed]` is `Some` then the key will be ephemeral and stored in memory.
391- fn ecdsa_bls377_generate_new(
392- & self ,
393- key_type: KeyTypeId ,
394- seed: Option <& str >,
395- ) -> std:: result:: Result <ecdsa_bls377:: Public , TraitError > {
396- self . generate_new:: <ecdsa_bls377:: Pair >( key_type, seed)
397- }
398-
399- fn ecdsa_bls377_sign(
400- & self ,
401- key_type: KeyTypeId ,
402- public: & ecdsa_bls377:: Public ,
403- msg: & [ u8 ] ,
404- ) -> std:: result:: Result <Option <ecdsa_bls377:: Signature >, TraitError > {
405- self . sign:: <ecdsa_bls377:: Pair >( key_type, public, msg)
406- }
407-
408- fn ecdsa_bls377_sign_with_keccak256(
384+ fn ecdsa_bls381_sign_with_keccak256(
409385 & self ,
410386 key_type: KeyTypeId ,
411- public: & ecdsa_bls377 :: Public ,
387+ public: & ecdsa_bls381 :: Public ,
412388 msg: & [ u8 ] ,
413- ) -> std:: result:: Result <Option <ecdsa_bls377 :: Signature >, TraitError > {
389+ ) -> std:: result:: Result <Option <ecdsa_bls381 :: Signature >, TraitError > {
414390 let sig = self . 0
415391 . read( )
416- . key_pair_by_type:: <ecdsa_bls377 :: Pair >( public, key_type) ?
392+ . key_pair_by_type:: <ecdsa_bls381 :: Pair >( public, key_type) ?
417393 . map( |pair| pair. sign_with_hasher:: <KeccakHasher >( msg) ) ;
418394 Ok ( sig)
419395 }
420-
421-
422396 }
423397}
424398
0 commit comments