// a key storage to store new key pairs during testing
let keystore = KeyStore::new();
let alice_pub_key = keystore.write().sr25519_generate_new(SR25519, Some(ALICE_PHRASE)).unwrap();
...
// Print the values to get GENESIS_UTXO
let mut ext = sp_io::TestExternalities::from(t);
ext.register_extension(KeystoreExt(keystore));
Getting / using from keystore:
let alice_pub_key = sp_io::crypto::sr25519_public_keys(SR25519)[0];
Basically this:
Writing to keystore:
Getting / using from keystore:
let alice_pub_key = sp_io::crypto::sr25519_public_keys(SR25519)[0];