From f330c8a3be7cd4cf152d08ddc7b2060f7180d901 Mon Sep 17 00:00:00 2001 From: Someone Else Date: Fri, 10 Feb 2023 22:18:47 +0100 Subject: [PATCH] rustfmt finally here --- blockchain_db/src/lib.rs | 13 ++++++++----- rustfmt.toml | 9 +++++++++ src/main.rs | 3 +-- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 rustfmt.toml diff --git a/blockchain_db/src/lib.rs b/blockchain_db/src/lib.rs index 66423bdf..112b3009 100644 --- a/blockchain_db/src/lib.rs +++ b/blockchain_db/src/lib.rs @@ -195,7 +195,7 @@ pub trait BlockchainDB { - fn add_transaction(); + // mutable uint64_t time_tx_exists = 0; //!< a performance metric // uint64_t time_commit1 = 0; //!< a performance metric @@ -274,7 +274,7 @@ pub trait BlockchainDB { fn get_num_outputs(amount: &u64) -> u64; // Should be hidden but it isn't???? - fn get_indexing_base() -> u64 { return 0;} + @@ -345,7 +345,7 @@ pub trait BlockchainDB { - // some note to help me + // some notes to help me // get_*_tx group : get_tx, get_pruned_tx. they are duplicate @@ -428,6 +428,9 @@ pub trait BlockchainDB { + /// + fn add_transaction(); + /// `get_tx_count` fetches the total number of transactions stored in the database /// /// Should return the count. In case of failure, a DB_FAILURES will be return. @@ -545,7 +548,7 @@ pub trait BlockchainDB { /// `cumulative_difficulty`: is the accumulated difficulty at this block. /// `coins_generated` is the number of coins generated after this block. /// `blk_hash`: is the hash of the block. - fn add_block() -> Result<(), DB_FAILURES>; + fn add_block(blk: Block, blk_hash: Hash, block_weight: u64, long_term_block_weight: u64, cumulative_difficulty: u128, coins_generated: u64) -> Result<(), DB_FAILURES>; /// `pop_block` pops the top block off the blockchain. /// @@ -771,4 +774,4 @@ pub trait BlockchainDB { //a } -// functions defined as useless : init_options(), is_open(), reset_stats(), show_stats(), open(), close(), get_output_histogram(), safesyncmode, get_filenames(), get_db_name(), remove_data_file(), lock(), unlock(), is_read_only(), get_database_size(), get_output_distribution(), set_auto_remove_logs(), check_hard_fork_info(), drop_hard_fork_info(); \ No newline at end of file +// functions defined as useless : init_options(), is_open(), reset_stats(), show_stats(), open(), close(), get_output_histogram(), safesyncmode, get_filenames(), get_db_name(), remove_data_file(), lock(), unlock(), is_read_only(), get_database_size(), get_output_distribution(), set_auto_remove_logs(), check_hard_fork_info(), drop_hard_fork_info(), get_indexing_base(); \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000..53d80476 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,9 @@ +indent_style = "Block" +reorder_imports = false +max_width = 120 +comment_width = 100 +match_block_trailing_comma = true +wrap_comments = true +edition = "2021" +error_on_line_overflow = true +version = "Two" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 811a7af5..d61b9a83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,8 @@ #![forbid(unsafe_code)] #![allow(non_camel_case_types)] #![deny(clippy::expect_used, clippy::panic)] -pub mod cryptonote_protocol; pub mod cryptonote_basic; - +pub mod cryptonote_protocol; fn main() { println!("Hello, world!");