diff --git a/src/components/wallet/accounts.rs b/src/components/wallet/accounts.rs index dc9ead3..665f0b2 100644 --- a/src/components/wallet/accounts.rs +++ b/src/components/wallet/accounts.rs @@ -147,9 +147,9 @@ impl Accounts { .expect("stored seed is valid length; qed"); let pair = Pair::from_seed(&seed); - let pair_signer = PairSigner::::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::::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::::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), ], ) diff --git a/src/components/wallet/address_book.rs b/src/components/wallet/address_book.rs index e51f3d9..c2cc2e2 100644 --- a/src/components/wallet/address_book.rs +++ b/src/components/wallet/address_book.rs @@ -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), ], )