Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix naming and remove unused field
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Aug 25, 2021
1 parent 00777ce commit e01bfcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ polkadot.*
!.rpm/*
.DS_Store
.cargo
.env
10 changes: 3 additions & 7 deletions utils/staking-miner/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ pub(crate) struct Signer {

/// The full crypto key-pair.
pub(crate) pair: Pair,

/// The raw URI read from file.
pub(crate) uri: String,
}

pub(crate) async fn get_account_info<T: frame_system::Config>(
Expand Down Expand Up @@ -63,10 +60,9 @@ pub(crate) async fn signer_uri_from_string<
seed: &str,
client: &WsClient,
) -> Result<Signer, Error> {
// trim any trailing garbage.
let uri = seed.trim_end();
let seed = seed.trim();

let pair = Pair::from_string(uri, None)?;
let pair = Pair::from_string(seed, None)?;
let account = T::AccountId::from(pair.public());
let _info = get_account_info::<T>(client, &account, None)
.await?
Expand All @@ -78,5 +74,5 @@ pub(crate) async fn signer_uri_from_string<
Token::from(_info.data.free),
_info
);
Ok(Signer { account, pair, uri: uri.to_string() })
Ok(Signer { account, pair })
}

0 comments on commit e01bfcd

Please sign in to comment.