Skip to content

Commit 77380ea

Browse files
Merge branch 'master' into version_call
2 parents daca484 + 684c79c commit 77380ea

File tree

1,060 files changed

+5414
-4782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,060 files changed

+5414
-4782
lines changed

.rustfmt.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ imports_granularity = "Crate"
88
reorder_imports = true
99
# Consistency
1010
newline_style = "Unix"
11+
normalize_comments = true
12+
normalize_doc_attributes = true
1113
# Misc
1214
chain_width = 80
1315
spaces_around_ranges = false
1416
binop_separator = "Back"
1517
reorder_impl_items = false
16-
match_arm_leading_pipes = "Preserve"
18+
match_arm_leading_pipes = "Never"
1719
match_arm_blocks = false
1820
match_block_trailing_comma = true
1921
trailing_comma = "Vertical"
20-
trailing_semicolon = false
22+
trailing_semicolon = true
2123
use_field_init_shorthand = true
2224
# Format comments
2325
comment_width = 100

Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ members = [
424424
"substrate/frame/revive/proc-macro",
425425
"substrate/frame/revive/rpc",
426426
"substrate/frame/revive/uapi",
427+
"substrate/frame/revive/ui-tests",
427428
"substrate/frame/root-offences",
428429
"substrate/frame/root-testing",
429430
"substrate/frame/safe-mode",
@@ -1040,6 +1041,7 @@ pallet-revive-eth-rpc = { path = "substrate/frame/revive/rpc", default-features
10401041
pallet-revive-fixtures = { path = "substrate/frame/revive/fixtures", default-features = false }
10411042
pallet-revive-proc-macro = { path = "substrate/frame/revive/proc-macro", default-features = false }
10421043
pallet-revive-uapi = { path = "substrate/frame/revive/uapi", default-features = false }
1044+
pallet-revive-ui-tests = { path = "substrate/frame/revive/ui-tests", default-features = false }
10431045
pallet-root-offences = { default-features = false, path = "substrate/frame/root-offences" }
10441046
pallet-root-testing = { path = "substrate/frame/root-testing", default-features = false }
10451047
pallet-safe-mode = { default-features = false, path = "substrate/frame/safe-mode" }

bridges/bin/runtime-common/src/extensions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ where
105105
has_failed || !SubmitFinalityProofHelper::<T, I>::was_successful(bundled_block_number);
106106

107107
if !has_failed {
108-
return
108+
return;
109109
}
110110

111111
// let's slash registered relayer
@@ -176,7 +176,7 @@ where
176176
!SubmitParachainHeadsHelper::<T, ParachainsInstance>::was_successful(&update);
177177

178178
if !has_failed {
179-
return
179+
return;
180180
}
181181

182182
// let's slash registered relayer
@@ -465,7 +465,7 @@ mod tests {
465465
type ToPostDispatch = u64;
466466
fn validate(_who: &u64, call: &MockCall) -> (u64, TransactionValidity) {
467467
if call.data <= 1 {
468-
return (1, InvalidTransaction::Custom(1).into())
468+
return (1, InvalidTransaction::Custom(1).into());
469469
}
470470

471471
(1, Ok(ValidTransaction { priority: 1, ..Default::default() }))
@@ -493,7 +493,7 @@ mod tests {
493493
type ToPostDispatch = u64;
494494
fn validate(_who: &u64, call: &MockCall) -> (u64, TransactionValidity) {
495495
if call.data <= 2 {
496-
return (2, InvalidTransaction::Custom(2).into())
496+
return (2, InvalidTransaction::Custom(2).into());
497497
}
498498

499499
(2, Ok(ValidTransaction { priority: 2, ..Default::default() }))

bridges/bin/runtime-common/src/messages_benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn prepare_inbound_message<LaneId>(
4848

4949
// if we don't need a correct message, then we may just return some random blob
5050
if !params.is_successful_dispatch_expected {
51-
return vec![0u8; expected_size]
51+
return vec![0u8; expected_size];
5252
}
5353

5454
// else let's prepare successful message.

bridges/modules/beefy/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn verify_signatures<T: Config<I>, I: 'static>(
7575
if authority.verify(sig, &msg) {
7676
missing_signatures = missing_signatures.saturating_sub(1);
7777
if missing_signatures == 0 {
78-
break
78+
break;
7979
}
8080
} else {
8181
tracing::debug!(

bridges/modules/grandpa/src/call_ext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<T: Config<I>, I: 'static> SubmitFinalityProofHelper<T, I> {
154154
"Cannot finalize obsolete header"
155155
);
156156

157-
return Err(Error::<T, I>::OldHeader)
157+
return Err(Error::<T, I>::OldHeader);
158158
},
159159
};
160160

@@ -168,7 +168,7 @@ impl<T: Config<I>, I: 'static> SubmitFinalityProofHelper<T, I> {
168168
"Cannot finalize header signed by unknown authority set"
169169
);
170170

171-
return Err(Error::<T, I>::InvalidAuthoritySetId)
171+
return Err(Error::<T, I>::InvalidAuthoritySetId);
172172
}
173173
}
174174

@@ -200,7 +200,7 @@ pub trait CallSubType<T: Config<I, RuntimeCall = Self>, I: 'static>:
200200
justification,
201201
None,
202202
false,
203-
))
203+
));
204204
} else if let Some(crate::Call::<T, I>::submit_finality_proof_ex {
205205
finality_target,
206206
justification,
@@ -213,7 +213,7 @@ pub trait CallSubType<T: Config<I, RuntimeCall = Self>, I: 'static>:
213213
justification,
214214
Some(*current_set_id),
215215
*is_free_execution_expected,
216-
))
216+
));
217217
}
218218

219219
None
@@ -243,7 +243,7 @@ pub trait CallSubType<T: Config<I, RuntimeCall = Self>, I: 'static>:
243243
};
244244

245245
if Pallet::<T, I>::ensure_not_halted().is_err() {
246-
return Err(InvalidTransaction::Call.into())
246+
return Err(InvalidTransaction::Call.into());
247247
}
248248

249249
let result = SubmitFinalityProofHelper::<T, I>::check_obsolete_from_extension(&call_info);

bridges/modules/messages/src/benchmarking.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ impl<T: Config<I>, I: 'static> ReceiveMessagesProofSetup<T, I> {
191191
mod benchmarks {
192192
use super::*;
193193

194-
//
195194
// Benchmarks that are used directly by the runtime calls weight formulae.
196195
//
197196

@@ -501,7 +500,6 @@ mod benchmarks {
501500
assert!(T::is_relayer_rewarded(&relayer2_id));
502501
}
503502

504-
//
505503
// Benchmarks that the runtime developers may use for proper pallet configuration.
506504
//
507505

bridges/modules/messages/src/call_ext.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<T: Config<I>, I: 'static> CallHelper<T, I> {
5454
// so if relayer slots are released, then message slots are also
5555
// released
5656
return post_occupation.free_message_slots >
57-
info.unrewarded_relayers.free_message_slots
57+
info.unrewarded_relayers.free_message_slots;
5858
}
5959

6060
inbound_lane_data.last_delivered_nonce() == *info.base.bundled_range.end()
@@ -131,7 +131,7 @@ impl<
131131
best_stored_nonce: inbound_lane_data.last_delivered_nonce(),
132132
},
133133
unrewarded_relayers: unrewarded_relayers_occupation::<T, I>(&inbound_lane_data),
134-
})
134+
});
135135
}
136136

137137
None
@@ -157,19 +157,19 @@ impl<
157157
bundled_range: outbound_lane_data.latest_received_nonce + 1..=
158158
relayers_state.last_delivered_nonce,
159159
best_stored_nonce: outbound_lane_data.latest_received_nonce,
160-
}))
160+
}));
161161
}
162162

163163
None
164164
}
165165

166166
fn call_info(&self) -> Option<MessagesCallInfo<T::LaneId>> {
167167
if let Some(info) = self.receive_messages_proof_info() {
168-
return Some(MessagesCallInfo::ReceiveMessagesProof(info))
168+
return Some(MessagesCallInfo::ReceiveMessagesProof(info));
169169
}
170170

171171
if let Some(info) = self.receive_messages_delivery_proof_info() {
172-
return Some(MessagesCallInfo::ReceiveMessagesDeliveryProof(info))
172+
return Some(MessagesCallInfo::ReceiveMessagesDeliveryProof(info));
173173
}
174174

175175
None
@@ -195,7 +195,7 @@ impl<
195195
"Rejecting messages transaction on halted pallet"
196196
);
197197

198-
return sp_runtime::transaction_validity::InvalidTransaction::Call.into()
198+
return sp_runtime::transaction_validity::InvalidTransaction::Call.into();
199199
},
200200
Some(MessagesCallInfo::ReceiveMessagesProof(proof_info))
201201
if proof_info
@@ -207,7 +207,7 @@ impl<
207207
"Rejecting obsolete messages delivery transaction"
208208
);
209209

210-
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into()
210+
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
211211
},
212212
Some(MessagesCallInfo::ReceiveMessagesDeliveryProof(proof_info))
213213
if proof_info.is_obsolete() =>
@@ -218,7 +218,7 @@ impl<
218218
"Rejecting obsolete messages confirmation transaction"
219219
);
220220

221-
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into()
221+
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
222222
},
223223
_ => {},
224224
}

bridges/modules/messages/src/inbound_lane.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ impl<S: InboundLaneStorage> InboundLane<S> {
151151

152152
if outbound_lane_data.latest_received_nonce > last_delivered_nonce {
153153
// this is something that should never happen if proofs are correct
154-
return None
154+
return None;
155155
}
156156
if outbound_lane_data.latest_received_nonce <= data.last_confirmed_nonce {
157-
return None
157+
return None;
158158
}
159159

160160
let new_confirmed_nonce = outbound_lane_data.latest_received_nonce;
@@ -191,18 +191,18 @@ impl<S: InboundLaneStorage> InboundLane<S> {
191191
) -> ReceptionResult<Dispatch::DispatchLevelResult> {
192192
let mut data = self.storage.data();
193193
if Some(nonce) != data.last_delivered_nonce().checked_add(1) {
194-
return ReceptionResult::InvalidNonce
194+
return ReceptionResult::InvalidNonce;
195195
}
196196

197197
// if there are more unrewarded relayer entries than we may accept, reject this message
198198
if data.relayers.len() as MessageNonce >= self.storage.max_unrewarded_relayer_entries() {
199-
return ReceptionResult::TooManyUnrewardedRelayers
199+
return ReceptionResult::TooManyUnrewardedRelayers;
200200
}
201201

202202
// if there are more unconfirmed messages than we may accept, reject this message
203203
let unconfirmed_messages_count = nonce.saturating_sub(data.last_confirmed_nonce);
204204
if unconfirmed_messages_count > self.storage.max_unconfirmed_messages() {
205-
return ReceptionResult::TooManyUnconfirmedMessages
205+
return ReceptionResult::TooManyUnconfirmedMessages;
206206
}
207207

208208
// then, dispatch message

0 commit comments

Comments
 (0)