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

Commit 704e973

Browse files
committed
Fix formatting
Signed-off-by: Joseph Livesey <joseph.livesey@btp.works>
1 parent f94deba commit 704e973

File tree

5 files changed

+27
-31
lines changed

5 files changed

+27
-31
lines changed

families/battleship/src/client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ impl<'a> BattleshipClient<'a> {
8686
let mut contents = String::new();
8787
file.read_to_string(&mut contents)?;
8888
Box::new(
89-
Secp256k1PrivateKey::from_hex(contents.trim())
90-
.map_err(|e| format_err!("{}", e))?,
89+
Secp256k1PrivateKey::from_hex(contents.trim()).map_err(|e| format_err!("{}", e))?,
9190
)
9291
};
9392

families/settings/sawtooth_settings/src/handler.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,12 @@ impl TransactionHandler for SettingsTransactionHandler {
114114
let settings_payload: SettingsPayload = unpack_data(transaction.get_payload())?;
115115

116116
match settings_payload.get_action() {
117-
SettingsPayload_Action::PROPOSE => apply_proposal(
118-
&auth_keys,
119-
public_key,
120-
settings_payload.get_data(),
121-
context,
122-
),
123-
SettingsPayload_Action::VOTE => apply_vote(
124-
&auth_keys,
125-
public_key,
126-
settings_payload.get_data(),
127-
context,
128-
),
117+
SettingsPayload_Action::PROPOSE => {
118+
apply_proposal(&auth_keys, public_key, settings_payload.get_data(), context)
119+
}
120+
SettingsPayload_Action::VOTE => {
121+
apply_vote(&auth_keys, public_key, settings_payload.get_data(), context)
122+
}
129123
SettingsPayload_Action::ACTION_UNSET => Err(ApplyError::InvalidTransaction(
130124
String::from("'action' must be one of {PROPOSE, VOTE} in 'Ballot' mode"),
131125
)),

perf/intkey_workload/src/intkey_transformer.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ impl<'a> IntKeyTransformer<'a> {
7171
}
7272
}
7373

74-
fn payload_to_cbor_bytes(&mut self, payload: &IntKeyPayload) -> Result<Vec<u8>, Box<dyn Error>> {
74+
fn payload_to_cbor_bytes(
75+
&mut self,
76+
payload: &IntKeyPayload,
77+
) -> Result<Vec<u8>, Box<dyn Error>> {
7578
let mut encoder = GenericEncoder::new(Vec::new());
7679
encoder.value(&payload.construct())?;
7780
Ok(encoder.into_inner().into_writer())

perf/intkey_workload/src/main.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,21 @@ fn run_load_command(args: &ArgMatches) -> Result<(), Box<dyn Error>> {
296296

297297
let context = signing::create_context("secp256k1")?;
298298

299-
let private_key: Result<Box<dyn signing::PrivateKey>, Box<dyn Error>> = match args.value_of("key") {
300-
Some(file) => {
301-
let mut key_file = File::open(file)?;
302-
let mut buf = String::new();
303-
key_file.read_to_string(&mut buf)?;
304-
buf.pop(); // remove the new line
305-
let private_key = Secp256k1PrivateKey::from_hex(&buf)?;
306-
Ok(Box::new(private_key))
307-
}
308-
None => {
309-
let private_key = context.new_random_private_key()?;
310-
Ok(private_key)
311-
}
312-
};
299+
let private_key: Result<Box<dyn signing::PrivateKey>, Box<dyn Error>> =
300+
match args.value_of("key") {
301+
Some(file) => {
302+
let mut key_file = File::open(file)?;
303+
let mut buf = String::new();
304+
key_file.read_to_string(&mut buf)?;
305+
buf.pop(); // remove the new line
306+
let private_key = Secp256k1PrivateKey::from_hex(&buf)?;
307+
Ok(Box::new(private_key))
308+
}
309+
None => {
310+
let private_key = context.new_random_private_key()?;
311+
Ok(private_key)
312+
}
313+
};
313314

314315
let priv_key = private_key?;
315316

perf/smallbank_workload/src/playlist.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ pub fn process_smallbank_playlist(
150150
txn.set_header_signature(signature);
151151
txn.set_payload(payload_bytes);
152152

153-
txn
154-
.write_length_delimited_to_writer(output)
153+
txn.write_length_delimited_to_writer(output)
155154
.map_err(PlaylistError::MessageError)?
156155
}
157156

0 commit comments

Comments
 (0)