mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
Define RangeInclusiveExt (#2037)
* Define RangeInclusiveExt * Use RangeInclusiveExt * Add docs
This commit is contained in:
committed by
Bastian Köcher
parent
ea39f4c0d2
commit
b8f4086095
@@ -115,22 +115,6 @@ pub enum CallInfo {
|
||||
ReceiveMessagesDeliveryProof(ReceiveMessagesDeliveryProofInfo),
|
||||
}
|
||||
|
||||
impl CallInfo {
|
||||
/// Returns number of messages, bundled with this transaction.
|
||||
pub fn bundled_messages(&self) -> MessageNonce {
|
||||
let bundled_range = match *self {
|
||||
Self::ReceiveMessagesProof(ref info) => &info.base.bundled_range,
|
||||
Self::ReceiveMessagesDeliveryProof(ref info) => &info.0.bundled_range,
|
||||
};
|
||||
|
||||
bundled_range
|
||||
.end()
|
||||
.checked_sub(*bundled_range.start())
|
||||
.map(|d| d.saturating_add(1))
|
||||
.unwrap_or(0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper struct that provides methods for working with a call supported by `CallInfo`.
|
||||
pub struct CallHelper<T: Config<I>, I: 'static> {
|
||||
pub _phantom_data: sp_std::marker::PhantomData<(T, I)>,
|
||||
|
||||
Reference in New Issue
Block a user