Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
chore: cargo fmt-stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnelson committed Jan 17, 2024
1 parent 5801992 commit 9012cf7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion stackslib/src/core/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use std::hash::Hasher;
use std::io::{Read, Write};
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::time::Instant;
use std::{fs, io};
use std::str::FromStr;

use clarity::vm::types::PrincipalData;
use rand::distributions::Uniform;
Expand Down
4 changes: 2 additions & 2 deletions stackslib/src/core/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ use crate::chainstate::stacks::{
C32_ADDRESS_VERSION_TESTNET_SINGLESIG,
};
use crate::core::mempool::{
db_get_all_nonces, MemPoolSyncData, MemPoolWalkSettings, MemPoolWalkTxTypes, TxTag, BLOOM_COUNTER_DEPTH,
BLOOM_COUNTER_ERROR_RATE, MAX_BLOOM_COUNTER_TXS,
db_get_all_nonces, MemPoolSyncData, MemPoolWalkSettings, MemPoolWalkTxTypes, TxTag,
BLOOM_COUNTER_DEPTH, BLOOM_COUNTER_ERROR_RATE, MAX_BLOOM_COUNTER_TXS,
};
use crate::core::{FIRST_BURNCHAIN_CONSENSUS_HASH, FIRST_STACKS_BLOCK_HASH};
use crate::net::Error as NetError;
Expand Down
5 changes: 1 addition & 4 deletions stackslib/src/cost_estimates/fee_scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::iter::FromIterator;
use std::path::Path;

use clarity::vm::costs::ExecutionCost;
use clarity::vm::database::{ClaritySerializable, STXBalance};
use rusqlite::types::{FromSql, FromSqlError};
use rusqlite::{
Connection, Error as SqliteError, OptionalExtension, ToSql, Transaction as SqlTransaction,
Expand All @@ -12,10 +13,6 @@ use serde_json::Value as JsonValue;

use super::metrics::CostMetric;
use super::{EstimatorError, FeeEstimator, FeeRateEstimate};

use clarity::vm::database::ClaritySerializable;
use clarity::vm::database::STXBalance;

use crate::chainstate::stacks::db::StacksEpochReceipt;
use crate::chainstate::stacks::events::TransactionOrigin;
use crate::chainstate::stacks::TransactionPayload;
Expand Down
16 changes: 12 additions & 4 deletions stackslib/src/net/httpcore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use stacks_common::types::chainstate::{
use stacks_common::types::net::PeerHost;
use stacks_common::types::Address;
use stacks_common::util::chunked_encoding::*;
use stacks_common::util::retry::{BoundReader, RetryReader};
use stacks_common::util::get_epoch_time_ms;
use stacks_common::util::retry::{BoundReader, RetryReader};
use url::Url;

use crate::burnchains::Txid;
Expand Down Expand Up @@ -436,12 +436,16 @@ pub trait RPCRequestHandler: HttpRequest + HttpResponse + RPCRequestHandlerClone
pub struct StacksHttpRequest {
preamble: HttpRequestPreamble,
contents: HttpRequestContents,
start_time: u128
start_time: u128,
}

impl StacksHttpRequest {
pub fn new(preamble: HttpRequestPreamble, contents: HttpRequestContents) -> Self {
Self { preamble, contents, start_time: get_epoch_time_ms() }
Self {
preamble,
contents,
start_time: get_epoch_time_ms(),
}
}

/// Instantiate a request to a remote Stacks peer
Expand Down Expand Up @@ -472,7 +476,11 @@ impl StacksHttpRequest {
preamble.path_and_query_str = decoded_path;
}

Ok(Self { preamble, contents, start_time: get_epoch_time_ms() })
Ok(Self {
preamble,
contents,
start_time: get_epoch_time_ms(),
})
}

/// Get a reference to the request premable metadata
Expand Down

0 comments on commit 9012cf7

Please sign in to comment.