Skip to content

Commit 4a7f9e9

Browse files
committed
chore: cargo fmt
1 parent 3ba07f9 commit 4a7f9e9

File tree

16 files changed

+46
-43
lines changed

16 files changed

+46
-43
lines changed

clarity/src/vm/database/clarity_db.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ use stacks_common::consts::{
2323
};
2424
use stacks_common::types::chainstate::{
2525
BlockHeaderHash, BurnchainHeaderHash, ConsensusHash, SortitionId, StacksAddress, StacksBlockId,
26-
VRFSeed,
26+
TrieHash, VRFSeed,
2727
};
2828
use stacks_common::types::{Address, StacksEpoch as GenericStacksEpoch, StacksEpochId};
29-
use stacks_common::types::chainstate::TrieHash;
3029
use stacks_common::util::hash::{to_hex, Hash160, Sha256Sum, Sha512Trunc256Sum};
3130

3231
use super::clarity_store::SpecialCaseHandler;
@@ -465,7 +464,7 @@ impl<'a> ClarityDatabase<'a> {
465464
{
466465
self.store.get_data::<T>(key)
467466
}
468-
467+
469468
pub fn get_data_by_hash<T>(&mut self, hash: &TrieHash) -> Result<Option<T>>
470469
where
471470
T: ClarityDeserializable<T>,
@@ -529,8 +528,11 @@ impl<'a> ClarityDatabase<'a> {
529528
{
530529
self.store.get_data_with_proof(key)
531530
}
532-
533-
pub fn get_data_with_proof_by_hash<T>(&mut self, hash: &TrieHash) -> Result<Option<(T, Vec<u8>)>>
531+
532+
pub fn get_data_with_proof_by_hash<T>(
533+
&mut self,
534+
hash: &TrieHash,
535+
) -> Result<Option<(T, Vec<u8>)>>
534536
where
535537
T: ClarityDeserializable<T>,
536538
{

clarity/src/vm/database/clarity_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl ClarityBackingStore for NullBackingStore {
214214
fn get_data(&mut self, _key: &str) -> Result<Option<String>> {
215215
panic!("NullBackingStore can't retrieve data")
216216
}
217-
217+
218218
fn get_data_from_path(&mut self, _hash: &TrieHash) -> Result<Option<String>> {
219219
panic!("NullBackingStore can't retrieve data")
220220
}

clarity/src/vm/database/key_value_wrapper.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
use std::hash::Hash;
1818

1919
use hashbrown::HashMap;
20-
use stacks_common::types::chainstate::StacksBlockId;
21-
use stacks_common::types::chainstate::TrieHash;
20+
use stacks_common::types::chainstate::{StacksBlockId, TrieHash};
2221
use stacks_common::types::StacksEpochId;
2322
use stacks_common::util::hash::Sha512Trunc256Sum;
2423

@@ -369,10 +368,13 @@ impl<'a> RollbackWrapper<'a> {
369368
.map(|(value, proof)| Ok((T::deserialize(&value)?, proof)))
370369
.transpose()
371370
}
372-
371+
373372
/// this function will only return commitment proofs for values _already_ materialized
374373
/// in the underlying store. otherwise it returns None.
375-
pub fn get_data_with_proof_by_hash<T>(&mut self, hash: &TrieHash) -> InterpreterResult<Option<(T, Vec<u8>)>>
374+
pub fn get_data_with_proof_by_hash<T>(
375+
&mut self,
376+
hash: &TrieHash,
377+
) -> InterpreterResult<Option<(T, Vec<u8>)>>
376378
where
377379
T: ClarityDeserializable<T>,
378380
{
@@ -404,7 +406,7 @@ impl<'a> RollbackWrapper<'a> {
404406
.map(|x| T::deserialize(&x))
405407
.transpose()
406408
}
407-
409+
408410
/// DO NOT USE IN CONSENSUS CODE.
409411
///
410412
/// Load data directly from the underlying store, given its trie hash. The lookup map will not

clarity/src/vm/database/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl ClarityBackingStore for MemoryBackingStore {
326326

327327
fn get_data_from_path(&mut self, hash: &TrieHash) -> Result<Option<String>> {
328328
SqliteConnection::get(self.get_side_store(), hash.to_string().as_str())
329-
}
329+
}
330330

331331
fn get_data_with_proof(&mut self, key: &str) -> Result<Option<(String, Vec<u8>)>> {
332332
Ok(SqliteConnection::get(self.get_side_store(), key)?.map(|x| (x, vec![])))

stackslib/src/chainstate/stacks/index/marf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub trait MarfConnection<T: MarfTrieId> {
126126
fn get(&mut self, block_hash: &T, key: &str) -> Result<Option<MARFValue>, Error> {
127127
self.with_conn(|c| MARF::get_by_key(c, block_hash, key))
128128
}
129-
129+
130130
/// Resolve a TrieHash from the MARF to a MARFValue with respect to the given block height.
131131
fn get_from_hash(&mut self, block_hash: &T, th: &TrieHash) -> Result<Option<MARFValue>, Error> {
132132
self.with_conn(|c| MARF::get_by_hash(c, block_hash, th))
@@ -1397,7 +1397,7 @@ impl<T: MarfTrieId> MARF<T> {
13971397
let proof = TrieMerkleProof::from_raw_entry(&mut conn, key, &marf_value, block_hash)?;
13981398
Ok(Some((marf_value, proof)))
13991399
}
1400-
1400+
14011401
pub fn get_with_proof_from_hash(
14021402
&mut self,
14031403
block_hash: &T,

stackslib/src/chainstate/stacks/index/node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use crate::chainstate::stacks::index::bits::{
3232
get_path_byte_len, get_ptrs_byte_len, path_from_bytes, ptrs_from_bytes, write_path_to_bytes,
3333
};
3434
use crate::chainstate::stacks::index::{
35-
BlockMap, ClarityMarfTrieId, Error, MARFValue, MarfTrieId, TrieHasher,
36-
TrieLeaf, MARF_VALUE_ENCODED_SIZE,
35+
BlockMap, ClarityMarfTrieId, Error, MARFValue, MarfTrieId, TrieHasher, TrieLeaf,
36+
MARF_VALUE_ENCODED_SIZE,
3737
};
3838

3939
#[derive(Debug, Clone, PartialEq)]

stackslib/src/chainstate/stacks/index/proofs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ use crate::chainstate::stacks::index::bits::{
3535
use crate::chainstate::stacks::index::marf::MARF;
3636
use crate::chainstate::stacks::index::node::{
3737
clear_backptr, is_backptr, set_backptr, ConsensusSerializable, CursorError, TrieCursor,
38-
TrieNode, TrieNode16, TrieNode256, TrieNode4, TrieNode48, TrieNodeID, TrieNodeType,
39-
TriePtr,
38+
TrieNode, TrieNode16, TrieNode256, TrieNode4, TrieNode48, TrieNodeID, TrieNodeType, TriePtr,
4039
};
4140
use crate::chainstate::stacks::index::storage::{TrieFileStorage, TrieStorageConnection};
4241
use crate::chainstate::stacks::index::trie::Trie;

stackslib/src/chainstate/stacks/index/storage.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ use crate::chainstate::stacks::index::node::{
5151
use crate::chainstate::stacks::index::profile::TrieBenchmark;
5252
use crate::chainstate::stacks::index::trie::Trie;
5353
use crate::chainstate::stacks::index::{
54-
trie_sql, BlockMap, ClarityMarfTrieId, Error, MarfTrieId, TrieHasher,
55-
TrieLeaf,
54+
trie_sql, BlockMap, ClarityMarfTrieId, Error, MarfTrieId, TrieHasher, TrieLeaf,
5655
};
5756
use crate::util_lib::db::{
5857
sql_pragma, sqlite_open, tx_begin_immediate, tx_busy_handler, Error as db_error,

stackslib/src/chainstate/stacks/index/test/marf.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ use crate::chainstate::stacks::index::proofs::*;
3232
use crate::chainstate::stacks::index::storage::*;
3333
use crate::chainstate::stacks::index::test::*;
3434
use crate::chainstate::stacks::index::trie::*;
35-
use crate::chainstate::stacks::index::{
36-
ClarityMarfTrieId, Error, MARFValue, TrieLeaf,
37-
};
35+
use crate::chainstate::stacks::index::{ClarityMarfTrieId, Error, MARFValue, TrieLeaf};
3836

3937
#[test]
4038
fn marf_insert_different_leaf_same_block_100() {

stackslib/src/chainstate/stacks/index/test/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ use crate::chainstate::stacks::index::node::*;
3131
use crate::chainstate::stacks::index::proofs::*;
3232
use crate::chainstate::stacks::index::storage::*;
3333
use crate::chainstate::stacks::index::trie::*;
34-
use crate::chainstate::stacks::index::{
35-
MARFValue, MarfTrieId, TrieLeaf, TrieMerkleProof,
36-
};
34+
use crate::chainstate::stacks::index::{MARFValue, MarfTrieId, TrieLeaf, TrieMerkleProof};
3735
use crate::chainstate::stacks::{BlockHeaderHash, TrieHash};
3836

3937
pub mod cache;

0 commit comments

Comments
 (0)