Merge pull request #3310 from stacks-network/fix/warnings

Fix/warnings
This commit is contained in:
Jude Nelson
2022-10-05 16:45:29 +00:00
committed by GitHub
10 changed files with 14 additions and 23 deletions

View File

@@ -2589,9 +2589,9 @@ impl SortitionDB {
pub fn is_db_version_supported_in_epoch(epoch: StacksEpochId, version: &str) -> bool {
match epoch {
StacksEpochId::Epoch10 => true,
StacksEpochId::Epoch20 => (version == "1" || version == "2" || version == "3"),
StacksEpochId::Epoch2_05 => (version == "2" || version == "3"),
StacksEpochId::Epoch21 => (version == "3"),
StacksEpochId::Epoch20 => version == "1" || version == "2" || version == "3",
StacksEpochId::Epoch2_05 => version == "2" || version == "3",
StacksEpochId::Epoch21 => version == "3",
}
}

View File

@@ -1830,7 +1830,7 @@ impl<'a, T: MarfTrieId> TrieStorageTransaction<'a, T> {
let size_hint = match self.data.uncommitted_writes {
Some((_, ref trie_storage)) => 2 * trie_storage.size_hint(),
None => (1024), // don't try to guess _byte_ allocation here.
None => 1024, // don't try to guess _byte_ allocation here.
};
let trie_buf = TrieRAM::new(bhh, size_hint, &self.data.cur_block);
@@ -1872,7 +1872,7 @@ impl<'a, T: MarfTrieId> TrieStorageTransaction<'a, T> {
// new trie
let size_hint = match self.data.uncommitted_writes {
Some((_, ref trie_storage)) => 2 * trie_storage.size_hint(),
None => (1024), // don't try to guess _byte_ allocation here.
None => 1024, // don't try to guess _byte_ allocation here.
};
(

View File

@@ -1680,10 +1680,6 @@ pub struct ParsedUTXO {
script_pub_key: String,
amount: Box<RawValue>,
confirmations: u32,
spendable: bool,
solvable: bool,
desc: Option<String>,
safe: bool,
}
#[derive(Clone, Debug, PartialEq)]

View File

@@ -523,7 +523,7 @@ impl Config {
name: node.name.unwrap_or(default_node_config.name),
seed: match node.seed {
Some(seed) => hex_bytes(&seed)
.map_err(|e| format!("node.seed should be a hex encoded string"))?,
.map_err(|_e| format!("node.seed should be a hex encoded string"))?,
None => default_node_config.seed,
},
working_dir: node.working_dir.unwrap_or(default_node_config.working_dir),
@@ -537,7 +537,7 @@ impl Config {
None => format!("http://{}", rpc_bind),
},
local_peer_seed: match node.local_peer_seed {
Some(seed) => hex_bytes(&seed).map_err(|e| {
Some(seed) => hex_bytes(&seed).map_err(|_e| {
format!("node.local_peer_seed should be a hex encoded string")
})?,
None => default_node_config.local_peer_seed,

View File

@@ -20,7 +20,6 @@ pub struct Keychain {
microblocks_secret_keys: Vec<StacksPrivateKey>,
vrf_secret_keys: Vec<VRFPrivateKey>,
vrf_map: HashMap<VRFPublicKey, VRFPrivateKey>,
rotations: u64,
}
impl Keychain {
@@ -46,7 +45,6 @@ impl Keychain {
microblocks_secret_keys: vec![],
secret_keys,
threshold,
rotations: 0,
vrf_secret_keys: vec![],
vrf_map: HashMap::new(),
}

View File

@@ -120,8 +120,8 @@ fn main() {
process::exit(1);
}
};
let conf = match Config::from_config_file(config_file) {
Ok(conf) => {
match Config::from_config_file(config_file) {
Ok(_) => {
info!("Loaded config!");
process::exit(0);
}

View File

@@ -68,7 +68,7 @@ use crate::run_loop::neon::RunLoop;
use crate::run_loop::RegisteredKey;
use crate::ChainTip;
use super::{BurnchainController, BurnchainTip, Config, EventDispatcher, Keychain};
use super::{BurnchainController, Config, EventDispatcher, Keychain};
use crate::stacks::vm::database::BurnStateDB;
use stacks::monitoring;

View File

@@ -27,8 +27,6 @@ pub struct PoxSyncWatchdogComms {
inv_sync_passes: Arc<AtomicU64>,
/// how many times have we done a download pass?
download_passes: Arc<AtomicU64>,
/// What's the burnchain tip we last saw?
burnchain_tip_height: Arc<AtomicU64>,
/// What's our last IBD status?
last_ibd: Arc<AtomicBool>,
/// Should keep running?
@@ -41,7 +39,6 @@ impl PoxSyncWatchdogComms {
p2p_state_passes: Arc::new(AtomicU64::new(0)),
inv_sync_passes: Arc::new(AtomicU64::new(0)),
download_passes: Arc::new(AtomicU64::new(0)),
burnchain_tip_height: Arc::new(AtomicU64::new(0)),
last_ibd: Arc::new(AtomicBool::new(true)),
should_keep_running,
}

View File

@@ -1023,7 +1023,7 @@ fn transition_adds_get_pox_addr_recipients() {
let stacked = 100_000_000_000 * (core::MICROSTACKS_PER_STACKS as u64);
for i in 0..4 {
for _i in 0..4 {
let spender_sk = StacksPrivateKey::new();
let spender_addr: PrincipalData = to_addr(&spender_sk).into();
@@ -1045,7 +1045,7 @@ fn transition_adds_get_pox_addr_recipients() {
.to_vec(),
);
let (conf, btcd_controller, mut btc_regtest_controller, blocks_processed, coord_channel) =
let (conf, _btcd_controller, mut btc_regtest_controller, blocks_processed, coord_channel) =
advance_to_2_1(initial_balances, None, Some(pox_constants.clone()));
let mut sort_height = coord_channel.get_sortitions_processed();
@@ -1167,7 +1167,7 @@ fn transition_adds_get_pox_addr_recipients() {
let parsed = StacksTransaction::consensus_deserialize(&mut &tx_bytes[..]).unwrap();
if parsed.txid() == cc_txid {
// check events for this block
for (i, event) in events.iter().enumerate() {
for (_i, event) in events.iter().enumerate() {
if let Some(cev) = event.get("contract_event") {
// strip leading `0x`
let clarity_serialized_value = hex_bytes(

View File

@@ -73,7 +73,7 @@ use super::{
SK_2,
};
use stacks::chainstate::stacks::miner::{
TransactionErrorEvent, TransactionEvent, TransactionSkippedEvent, TransactionSuccessEvent,
TransactionErrorEvent, TransactionEvent, TransactionSuccessEvent,
};
use crate::config::FeeEstimatorName;