This repository was archived by the owner on Feb 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +30
-33
lines changed
Expand file tree Collapse file tree 8 files changed +30
-33
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ name = "sawtooth-sawadm"
1818version = " 0.1.0"
1919authors = [" sawtooth" ]
2020description = " The sawadm command is used for Sawtooth administration tasks."
21+ edition = ' 2021'
2122
2223[[bin ]]
2324name = " sawadm"
Original file line number Diff line number Diff line change 1515 * ------------------------------------------------------------------------------
1616 */
1717
18- use proto:: block:: { Block , BlockHeader } ;
18+ use crate :: proto:: block:: { Block , BlockHeader } ;
1919use protobuf:: Message ;
2020
21- use database:: error:: DatabaseError ;
22- use database:: lmdb:: LmdbDatabase ;
21+ use crate :: database:: error:: DatabaseError ;
22+ use crate :: database:: lmdb:: LmdbDatabase ;
2323
2424pub struct Blockstore < ' a > {
2525 db : LmdbDatabase < ' a > ,
@@ -207,10 +207,10 @@ impl<'a> Blockstore<'a> {
207207#[ cfg( test) ]
208208mod tests {
209209 use super :: * ;
210- use config;
211- use database:: lmdb:: LmdbContext ;
212- use proto:: batch:: { Batch , BatchHeader } ;
213- use proto:: transaction:: Transaction ;
210+ use crate :: config;
211+ use crate :: database:: lmdb:: LmdbContext ;
212+ use crate :: proto:: batch:: { Batch , BatchHeader } ;
213+ use crate :: proto:: transaction:: Transaction ;
214214
215215 /// Asserts that BLOCKSTORE has a current height of COUNT.
216216 fn assert_current_height ( count : usize , blockstore : & Blockstore ) {
Original file line number Diff line number Diff line change @@ -24,15 +24,15 @@ use protobuf;
2424use protobuf:: Message ;
2525use serde_yaml;
2626
27- use proto:: block:: { Block , BlockHeader } ;
28- use proto:: transaction:: TransactionHeader ;
29-
30- use blockstore:: Blockstore ;
31- use config;
32- use database:: error:: DatabaseError ;
33- use database:: lmdb;
34- use err:: CliError ;
35- use wrappers:: Block as BlockWrapper ;
27+ use crate :: proto:: block:: { Block , BlockHeader } ;
28+ use crate :: proto:: transaction:: TransactionHeader ;
29+
30+ use crate :: blockstore:: Blockstore ;
31+ use crate :: config;
32+ use crate :: database:: error:: DatabaseError ;
33+ use crate :: database:: lmdb;
34+ use crate :: err:: CliError ;
35+ use crate :: wrappers:: Block as BlockWrapper ;
3636
3737const NULL_BLOCK_IDENTIFIER : & str = "0000000000000000" ;
3838
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ use clap::ArgMatches;
2424use protobuf;
2525use protobuf:: Message ;
2626
27- use proto:: batch:: { Batch , BatchList } ;
28- use proto:: genesis:: GenesisData ;
29- use proto:: settings:: { SettingProposal , SettingsPayload , SettingsPayload_Action } ;
30- use proto:: transaction:: TransactionHeader ;
27+ use crate :: proto:: batch:: { Batch , BatchList } ;
28+ use crate :: proto:: genesis:: GenesisData ;
29+ use crate :: proto:: settings:: { SettingProposal , SettingsPayload , SettingsPayload_Action } ;
30+ use crate :: proto:: transaction:: TransactionHeader ;
3131
32- use config;
33- use err:: CliError ;
32+ use crate :: config;
33+ use crate :: err:: CliError ;
3434
3535pub fn run ( args : & ArgMatches ) -> Result < ( ) , CliError > {
3636 let genesis_file_path = if args. is_present ( "output" ) {
@@ -177,8 +177,8 @@ mod tests {
177177
178178 use protobuf:: RepeatedField ;
179179
180- use proto:: batch:: BatchHeader ;
181- use proto:: transaction:: Transaction ;
180+ use crate :: proto:: batch:: BatchHeader ;
181+ use crate :: proto:: transaction:: Transaction ;
182182
183183 fn get_required_settings_batch ( ) -> Batch {
184184 let required_settings = vec ! [
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ use libc;
3030
3131use sawtooth_sdk:: signing;
3232
33- use config;
34- use err:: CliError ;
33+ use crate :: config;
34+ use crate :: err:: CliError ;
3535
3636pub fn run ( args : & ArgMatches ) -> Result < ( ) , CliError > {
3737 let path_config = config:: get_path_config ( ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use std::path::Path;
2020
2121use lmdb_zero as lmdb;
2222
23- use database:: error:: DatabaseError ;
23+ use crate :: database:: error:: DatabaseError ;
2424
2525const DEFAULT_SIZE : usize = 1 << 40 ; // 1024 ** 4
2626
@@ -234,7 +234,7 @@ impl<'a> LmdbDatabaseWriter<'a> {
234234#[ cfg( test) ]
235235mod tests {
236236 use super :: * ;
237- use config;
237+ use crate :: config;
238238
239239 /// Asserts that there are COUNT many objects in DB.
240240 fn assert_database_count ( count : usize , db : & LmdbDatabase ) {
Original file line number Diff line number Diff line change 1515 * ------------------------------------------------------------------------------
1616 */
1717
18- use std;
19-
2018#[ allow( clippy:: enum_variant_names) ]
2119#[ derive( Debug ) ]
2220pub enum CliError {
Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 * ------------------------------------------------------------------------------
1616 */
17- use std;
18-
1917use protobuf:: Message ;
2018
21- use proto;
19+ use crate :: proto;
2220
2321#[ derive( Debug ) ]
2422pub enum Error {
You can’t perform that action at this time.
0 commit comments