Skip to content

Commit

Permalink
Merge pull request #5410 from stacks-network/fix/signer-clippy
Browse files Browse the repository at this point in the history
Clippy fix signer and stackslib cli.rs
  • Loading branch information
hstove authored Oct 31, 2024
2 parents a335dcd + 18662cc commit 830c4b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion stacks-signer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Metrics endpoint: {metrics_endpoint}

/// Get the chain ID for the network
pub fn to_chain_id(&self) -> u32 {
self.chain_id.unwrap_or_else(|| match self.network {
self.chain_id.unwrap_or(match self.network {
Network::Mainnet => CHAIN_ID_MAINNET,
Network::Testnet | Network::Mocknet => CHAIN_ID_TESTNET,
})
Expand Down
6 changes: 1 addition & 5 deletions stacks-signer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ fn handle_generate_stacking_signature(

fn handle_check_config(args: RunSignerArgs) {
let config = GlobalConfig::try_from(&args.config).unwrap();
println!(
"Signer version: {}\nConfig: \n{}",
VERSION_STRING.to_string(),
config
);
println!("Signer version: {}\nConfig: \n{}", *VERSION_STRING, config);
}

fn handle_generate_vote(args: GenerateVoteArgs, do_print: bool) -> MessageSignature {
Expand Down
3 changes: 1 addition & 2 deletions stacks-signer/src/monitoring/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ pub fn update_signer_nonce(nonce: u64) {
#[allow(dead_code)]
/// Remove the origin from the full path to avoid duplicate metrics for different origins
fn remove_origin_from_path(full_path: &str, origin: &str) -> String {
let path = full_path.replace(origin, "");
path
full_path.replace(origin, "")
}

/// Start a new RPC call timer.
Expand Down
2 changes: 1 addition & 1 deletion stacks-signer/src/v0/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl SignerTrait<SignerMessage> for Signer {
"block_height" => b.header.chain_length,
"signer_sighash" => %b.header.signer_signature_hash(),
);
stacks_client.post_block_until_ok(self, &b);
stacks_client.post_block_until_ok(self, b);
}
SignerMessage::MockProposal(mock_proposal) => {
let epoch = match stacks_client.get_node_epoch() {
Expand Down
4 changes: 1 addition & 3 deletions stackslib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ fn replay_block(
fn replay_block_nakamoto(
sort_db: &mut SortitionDB,
stacks_chain_state: &mut StacksChainState,
mut chainstate_tx: ChainstateTx,
clarity_instance: &mut ClarityInstance,
block: &NakamotoBlock,
block_size: u64,
) -> Result<(), ChainstateError> {
Expand Down Expand Up @@ -785,7 +783,7 @@ fn replay_block_nakamoto(
return Err(e);
};

let (receipt, clarity_commit, reward_set_data) = ok_opt.expect("FATAL: unreachable");
let (receipt, _clarity_commit, _reward_set_data) = ok_opt.expect("FATAL: unreachable");

assert_eq!(
receipt.header.anchored_header.block_hash(),
Expand Down

0 comments on commit 830c4b1

Please sign in to comment.