wallet public addres fix, thanks to DoctorK for pointing out the issue

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2024-12-04 14:11:58 +03:00
parent b5ad10ad6d
commit 7e776ca7e9
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 8 additions and 9 deletions

View File

@ -147,9 +147,9 @@ impl Accounts {
.expect("stored seed is valid length; qed");
let pair = Pair::from_seed(&seed);
let pair_signer = PairSigner::<CasperConfig, Pair>::new(pair);
let address = AccountId32::from(seed.clone())
let address = AccountId32::from(pair.public().0)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
let pair_signer = PairSigner::<CasperConfig, Pair>::new(pair);
self.wallet_keys.push((wallet_name.to_string(), address, wallet_key.to_string(), pair_signer));
}
@ -175,14 +175,13 @@ impl Accounts {
};
let secret_seed = hex::encode(seed);
let address = AccountId32::from(pair.public().0)
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
let pair_signer = PairSigner::<CasperConfig, Pair>::new(pair);
let mut new_file = File::create(file_path)?;
writeln!(new_file, "ghostie:0x{}", &secret_seed)?;
let address = AccountId32::from(seed.clone())
.to_ss58check_with_version(Ss58AddressFormat::custom(1996));
self.wallet_keys.push(("ghostie".to_string(), address, secret_seed, pair_signer));
}
};
@ -317,8 +316,8 @@ impl Component for Accounts {
Cell::from(Text::from("31 CSPR".to_string()).alignment(Alignment::Right)),
])),
[
Constraint::Min(0),
Constraint::Min(15),
Constraint::Min(5),
Constraint::Max(51),
Constraint::Min(10),
],
)

View File

@ -250,8 +250,8 @@ impl Component for AddressBook {
Cell::from(Text::from("31 CSPR".to_string()).alignment(Alignment::Right)),
])),
[
Constraint::Min(0),
Constraint::Min(13),
Constraint::Min(5),
Constraint::Max(51),
Constraint::Min(10),
],
)