Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit e61308d

Browse files
committed
Update perf to rust 2021
Signed-off-by: Joseph Livesey <joseph.livesey@btp.works>
1 parent a124f36 commit e61308d

File tree

10 files changed

+24
-18
lines changed

10 files changed

+24
-18
lines changed

perf/intkey_workload/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "sawtooth-intkey-workload"
33
version = "0.1.0"
44
authors = ["Intel Corporation"]
55
description = "Workload generator for Sawtooth Intkey"
6+
edition = '2021'
67

78
[[bin]]
89
name = "intkey-workload"

perf/intkey_workload/src/intkey_transformer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
* ------------------------------------------------------------------------------
1616
*/
1717

18+
use crate::intkey_addresser::IntKeyAddresser;
19+
use crate::intkey_iterator::IntKeyPayload;
1820
use cbor::GenericEncoder;
1921
use crypto::digest::Digest;
2022
use crypto::sha2::Sha512;
21-
use intkey_addresser::IntKeyAddresser;
22-
use intkey_iterator::IntKeyPayload;
2323
use protobuf::{Message, RepeatedField};
2424
use rand::prelude::*;
2525
use sawtooth_sdk::messages::transaction::{Transaction, TransactionHeader};
@@ -186,7 +186,7 @@ impl<'a> IntKeyTransformer<'a> {
186186
#[cfg(test)]
187187
mod tests {
188188
use super::IntKeyTransformer;
189-
use intkey_iterator::IntKeyIterator;
189+
use crate::intkey_iterator::IntKeyIterator;
190190
use protobuf::Message;
191191
use sawtooth_sdk::messages::transaction::TransactionHeader;
192192
use sawtooth_sdk::signing;

perf/sawtooth_perf/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
name = "sawtooth_perf"
1717
version = "0.1.0"
1818
authors = ["Intel Corporation"]
19+
edition = '2021'
1920

2021
[dependencies]
2122
sawtooth-sdk = "0.3"

perf/sawtooth_perf/src/batch_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use sawtooth_sdk::messages::transaction::Transaction;
3131

3232
use sawtooth_sdk::signing;
3333

34-
use source::LengthDelimitedMessageSource;
34+
use crate::source::LengthDelimitedMessageSource;
3535

3636
/// Generates signed batches from a stream of length-delimited transactions.
3737
/// Constrains the batches to `max_batch_size` number of transactions per

perf/sawtooth_perf/src/batch_submit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ use tokio_timer;
4242
use sawtooth_sdk::messages::batch::Batch;
4343
use sawtooth_sdk::messages::batch::BatchList;
4444

45-
use batch_gen::{BatchResult, BatchingError};
46-
use batch_map::BatchMap;
47-
use source::LengthDelimitedMessageSource;
48-
use workload;
45+
use crate::batch_gen::{BatchResult, BatchingError};
46+
use crate::batch_map::BatchMap;
47+
use crate::source::LengthDelimitedMessageSource;
48+
use crate::workload;
4949

5050
/// Populates a channel from a stream of length-delimited batches.
5151
/// Starts one workload submitter of the appropriate type (http, zmq)

perf/sawtooth_perf/src/workload.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ use tokio_core::reactor::Handle;
4242

4343
use sawtooth_sdk::messages::batch::BatchList;
4444

45-
use batch_submit::BatchListResult;
46-
use batch_submit::BatchReadingError;
45+
use crate::batch_submit::BatchListResult;
46+
use crate::batch_submit::BatchReadingError;
4747

48-
use batch_map::BatchMap;
48+
use crate::batch_map::BatchMap;
4949

5050
#[allow(clippy::enum_variant_names)]
5151
#[derive(Debug)]

perf/sawtooth_workload/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
[package]
1616
name = "sawtooth_workload"
1717
version = "0.1.0"
18+
edition = '2021'
1819

1920
[dependencies]
2021
sawtooth-sdk = "0.3"

perf/smallbank_workload/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ version = "0.1.0"
1818
build = "build.rs"
1919
authors = ["Intel Corporation"]
2020
description = "Workload generator for Sawtooth Smallbank"
21+
edition = '2021'
2122

2223
[dependencies]
2324
sawtooth-sdk = "0.3"

perf/smallbank_workload/src/playlist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ use self::yaml_rust::YamlEmitter;
3636
use self::yaml_rust::YamlLoader;
3737
use rand::prelude::*;
3838

39-
use protos::smallbank;
40-
use protos::smallbank::SmallbankTransactionPayload;
41-
use protos::smallbank::SmallbankTransactionPayload_PayloadType as SBPayloadType;
39+
use crate::protos::smallbank;
40+
use crate::protos::smallbank::SmallbankTransactionPayload;
41+
use crate::protos::smallbank::SmallbankTransactionPayload_PayloadType as SBPayloadType;
4242

4343
use protobuf;
4444
use protobuf::Message;

perf/smallbank_workload/src/smallbank_transformer.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ use protobuf::Message;
2929
use sawtooth_sdk::messages::transaction::{Transaction, TransactionHeader};
3030
use sawtooth_sdk::signing;
3131

32-
use playlist::bytes_to_hex_str;
33-
use playlist::make_addresses;
34-
use protos::smallbank::{SmallbankTransactionPayload, SmallbankTransactionPayload_PayloadType};
32+
use crate::playlist::bytes_to_hex_str;
33+
use crate::playlist::make_addresses;
34+
use crate::protos::smallbank::{
35+
SmallbankTransactionPayload, SmallbankTransactionPayload_PayloadType,
36+
};
3537

3638
/// Transforms SmallbankTransactionPayloads into Sawtooth Transactions.
3739
pub struct SBPayloadTransformer<'a> {
@@ -171,7 +173,7 @@ mod tests {
171173
use sawtooth_sdk::messages::transaction::TransactionHeader;
172174
use sawtooth_sdk::signing;
173175

174-
use playlist::SmallbankGeneratingIter;
176+
use crate::playlist::SmallbankGeneratingIter;
175177

176178
const NUM_CREATE_ACCOUNTS: usize = 100;
177179
const NUM_TO_CONSIDER: usize = 1_000;

0 commit comments

Comments
 (0)