newly generated keys representation fix, thanks to @sargio, @ASB_clown and @metanomad

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-01-20 13:39:38 +03:00
parent 3b7aaa7fd2
commit 3662f9c666
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 6 additions and 6 deletions

View File

@ -173,11 +173,11 @@ impl StashInfo {
}
fn generate_and_save_new_key(&mut self) -> Result<()> {
let (pair, seed) = Pair::generate(); // TODO: revisit
let (pair, seed) = Pair::generate();
let secret_seed = hex::encode(seed);
let address = AccountId32::from(pair.public().0)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
let account_id = pair.public().0;
let address = AccountId32::from(account_id)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
let pair_signer = PairSigner::<CasperConfig, Pair>::new(pair);
let mut new_file = File::create(&self.file_path)?;

View File

@ -136,10 +136,10 @@ impl Accounts {
}
fn create_new_account(&mut self, name: String) {
let (pair, seed) = Pair::generate(); // TODO: generate_with_phrase()
let (pair, seed) = Pair::generate();
let secret_seed = hex::encode(seed);
let account_id = pair.public().0;
let address = AccountId32::from(seed)
let address = AccountId32::from(account_id)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
self.log_event(
@ -278,7 +278,7 @@ impl Accounts {
let secret_seed = hex::encode(seed);
let account_id = pair.public().0;
let address = AccountId32::from(pair.public().0)
let address = AccountId32::from(account_id)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
let mut new_file = File::create(file_path)?;