Skip to content

Commit 0957658

Browse files
Preempt undesirable rustfmt changes.
- Add skips to places where lists get over-expanded. - Add variables to avoid some long function call lines. - Prevent some end-of-line comments from being put onto next line.
1 parent 7fa2bbf commit 0957658

File tree

3 files changed

+97
-28
lines changed

3 files changed

+97
-28
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,27 @@ struct KeyProvider {
136136
impl KeysInterface for KeyProvider {
137137
type ChanKeySigner = EnforcingChannelKeys;
138138

139+
#[cfg_attr(rustfmt, rustfmt_skip)]
139140
fn get_node_secret(&self) -> SecretKey {
140141
SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, self.node_id]).unwrap()
141142
}
142143

143144
fn get_destination_script(&self) -> Script {
144145
let secp_ctx = Secp256k1::signing_only();
146+
147+
#[cfg_attr(rustfmt, rustfmt_skip)]
145148
let channel_monitor_claim_key = SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, self.node_id]).unwrap();
146149
let our_channel_monitor_claim_key_hash = WPubkeyHash::hash(&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize());
147150
Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_monitor_claim_key_hash[..]).into_script()
148151
}
149152

153+
#[cfg_attr(rustfmt, rustfmt_skip)]
150154
fn get_shutdown_pubkey(&self) -> PublicKey {
151155
let secp_ctx = Secp256k1::signing_only();
152156
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, self.node_id]).unwrap())
153157
}
154158

159+
#[cfg_attr(rustfmt, rustfmt_skip)]
155160
fn get_channel_keys(&self, _inbound: bool, channel_value_satoshis: u64) -> EnforcingChannelKeys {
156161
let secp_ctx = Secp256k1::signing_only();
157162
EnforcingChannelKeys::new(InMemoryChannelKeys::new(
@@ -166,12 +171,14 @@ impl KeysInterface for KeyProvider {
166171
))
167172
}
168173

174+
#[cfg_attr(rustfmt, rustfmt_skip)]
169175
fn get_onion_rand(&self) -> (SecretKey, [u8; 32]) {
170176
let id = self.session_id.fetch_add(1, atomic::Ordering::Relaxed);
171177
(SecretKey::from_slice(&[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, id, 10, self.node_id]).unwrap(),
172178
[0; 32])
173179
}
174180

181+
#[cfg_attr(rustfmt, rustfmt_skip)]
175182
fn get_channel_id(&self) -> [u8; 32] {
176183
let id = self.channel_id.fetch_add(1, atomic::Ordering::Relaxed);
177184
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, id, 11, self.node_id]

0 commit comments

Comments
 (0)