mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-03 22:03:06 +00:00
fmt
This commit is contained in:
parent
4e0ad2b47b
commit
81cf5a4039
@ -38,12 +38,11 @@ mod tests {
|
||||
|
||||
fn pad_to_32(slice: &[u8]) -> [u8; 32] {
|
||||
let mut padded = [0u8; 32];
|
||||
let len = slice.len().min(32);
|
||||
let len = slice.len().min(32);
|
||||
padded[..len].copy_from_slice(&slice[..len]);
|
||||
padded
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_create_empty_store() {
|
||||
let store = NodeAccountsStore::new();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use std::path::Path;
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use anyhow::{anyhow, Result};
|
||||
use storage::{block::Block, RocksDBIO};
|
||||
|
||||
pub struct NodeBlockStore {
|
||||
@ -42,9 +42,9 @@ impl NodeBlockStore {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::path::PathBuf;
|
||||
use tempfile::tempdir;
|
||||
use storage::block::{Block, BlockHash, BlockId, Data};
|
||||
use storage::transaction::Transaction;
|
||||
use tempfile::tempdir;
|
||||
|
||||
fn create_genesis_block() -> Block {
|
||||
Block {
|
||||
@ -74,8 +74,8 @@ mod tests {
|
||||
let path = temp_dir.path();
|
||||
|
||||
let genesis_block = create_genesis_block();
|
||||
let node_store = NodeBlockStore::open_db_with_genesis(path, Some(genesis_block.clone()))
|
||||
.unwrap();
|
||||
let node_store =
|
||||
NodeBlockStore::open_db_with_genesis(path, Some(genesis_block.clone())).unwrap();
|
||||
|
||||
// Verify the genesis block is stored
|
||||
let stored_block = node_store.get_block_at_id(0).unwrap();
|
||||
|
||||
@ -102,10 +102,8 @@ impl RocksDBIO {
|
||||
let mut db_opts = Options::default();
|
||||
db_opts.create_missing_column_families(true);
|
||||
db_opts.create_if_missing(true);
|
||||
DBWithThreadMode::<MultiThreaded>::destroy(
|
||||
&db_opts,
|
||||
path,
|
||||
).map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))
|
||||
DBWithThreadMode::<MultiThreaded>::destroy(&db_opts, path)
|
||||
.map_err(|rerr| DbError::rocksdb_cast_message(rerr, None))
|
||||
}
|
||||
|
||||
pub fn meta_column(&self) -> Arc<BoundColumnFamily> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user