Skip to content

Commit

Permalink
[typo] Resultions -> Resolutions (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa authored Apr 17, 2024
2 parents 5f2f864 + c63e4e8 commit 7fed0e3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
12 changes: 6 additions & 6 deletions pallets/rolldown/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ impl<T: Config> Pallet<T> {
pub fn validate_l1_update(l1: L1, update: &messages::L1Update) -> DispatchResult {
ensure!(
!update.pendingDeposits.is_empty() ||
!update.pendingCancelResultions.is_empty() ||
!update.pendingCancelResolutions.is_empty() ||
!update.pendingL2UpdatesToRemove.is_empty(),
Error::<T>::EmptyUpdate
);
Expand All @@ -874,7 +874,7 @@ impl<T: Config> Pallet<T> {
);
ensure!(
update
.pendingCancelResultions
.pendingCancelResolutions
.iter()
.map(|v| v.requestId.origin)
.all(|v| v == Origin::L1),
Expand Down Expand Up @@ -903,7 +903,7 @@ impl<T: Config> Pallet<T> {

ensure!(
update
.pendingCancelResultions
.pendingCancelResolutions
.iter()
.map(|v| v.requestId.id)
.into_iter()
Expand Down Expand Up @@ -936,7 +936,7 @@ impl<T: Config> Pallet<T> {

let lowest_id = [
update.pendingDeposits.first().map(|v| v.requestId.id),
update.pendingCancelResultions.first().map(|v| v.requestId.id),
update.pendingCancelResolutions.first().map(|v| v.requestId.id),
update.pendingWithdrawalResolutions.first().map(|v| v.requestId.id),
update.pendingL2UpdatesToRemove.first().map(|v| v.requestId.id),
]
Expand All @@ -956,14 +956,14 @@ impl<T: Config> Pallet<T> {
let last_id = lowest_id +
(update.pendingDeposits.len() as u128) +
(update.pendingWithdrawalResolutions.len() as u128) +
(update.pendingCancelResultions.len() as u128) +
(update.pendingCancelResolutions.len() as u128) +
(update.pendingL2UpdatesToRemove.len() as u128);

ensure!(last_id > last_processed_request_on_l2::<T>::get(l1), Error::<T>::WrongRequestId);

let mut deposit_it = update.pendingDeposits.iter();
let mut withdrawal_it = update.pendingWithdrawalResolutions.iter();
let mut cancel_it = update.pendingCancelResultions.iter();
let mut cancel_it = update.pendingCancelResolutions.iter();
let mut updates_it = update.pendingL2UpdatesToRemove.iter();
let mut withdrawal = withdrawal_it.next();

Expand Down
22 changes: 11 additions & 11 deletions pallets/rolldown/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl Into<eth_abi::WithdrawalResolution> for WithdrawalResolution {
#[derive(Eq, PartialEq, RuntimeDebug, Clone, Encode, Decode, TypeInfo, Default, Serialize)]
pub struct L1Update {
pub pendingDeposits: Vec<Deposit>,
pub pendingCancelResultions: Vec<CancelResolution>,
pub pendingCancelResolutions: Vec<CancelResolution>,
pub pendingWithdrawalResolutions: Vec<WithdrawalResolution>,
pub pendingL2UpdatesToRemove: Vec<L2UpdatesToRemove>,
}
Expand Down Expand Up @@ -226,7 +226,7 @@ impl L1Update {
pub fn range(&self) -> Option<Range> {
let first = [
self.pendingDeposits.first().map(|v| v.requestId.id),
self.pendingCancelResultions.first().map(|v| v.requestId.id),
self.pendingCancelResolutions.first().map(|v| v.requestId.id),
self.pendingL2UpdatesToRemove.first().map(|v| v.requestId.id),
self.pendingWithdrawalResolutions.first().map(|v| v.requestId.id),
]
Expand All @@ -237,7 +237,7 @@ impl L1Update {

let last = [
self.pendingDeposits.last().map(|v| v.requestId.id),
self.pendingCancelResultions.last().map(|v| v.requestId.id),
self.pendingCancelResolutions.last().map(|v| v.requestId.id),
self.pendingL2UpdatesToRemove.last().map(|v| v.requestId.id),
self.pendingWithdrawalResolutions.last().map(|v| v.requestId.id),
]
Expand All @@ -257,13 +257,13 @@ impl L1Update {

let L1Update {
pendingDeposits,
pendingCancelResultions,
pendingCancelResolutions,
pendingL2UpdatesToRemove,
pendingWithdrawalResolutions,
} = self;

let mut deposits_it = pendingDeposits.into_iter().peekable();
let mut cancel_it = pendingCancelResultions.into_iter().peekable();
let mut cancel_it = pendingCancelResolutions.into_iter().peekable();
let mut remove_it = pendingL2UpdatesToRemove.into_iter().peekable();
let mut withdrawal_it = pendingWithdrawalResolutions.into_iter().peekable();

Expand Down Expand Up @@ -330,8 +330,8 @@ impl Into<eth_abi::L1Update> for L1Update {
fn into(self) -> eth_abi::L1Update {
eth_abi::L1Update {
pendingDeposits: self.pendingDeposits.into_iter().map(Into::into).collect::<Vec<_>>(),
pendingCancelResultions: self
.pendingCancelResultions
pendingCancelResolutions: self
.pendingCancelResolutions
.into_iter()
.map(Into::into)
.collect::<Vec<_>>(),
Expand Down Expand Up @@ -398,7 +398,7 @@ impl TryFrom<eth_abi::L1Update> for L1Update {
let pending_deposits: Result<Vec<_>, _> =
update.pendingDeposits.into_iter().map(|d| d.try_into()).collect();
let pending_cancel_resultions: Result<Vec<_>, _> =
update.pendingCancelResultions.into_iter().map(|c| c.try_into()).collect();
update.pendingCancelResolutions.into_iter().map(|c| c.try_into()).collect();
let pending_l2_updates_to_remove: Result<Vec<_>, _> =
update.pendingL2UpdatesToRemove.into_iter().map(|u| u.try_into()).collect();
let pending_withdrawal_resolutions: Result<Vec<_>, _> =
Expand All @@ -407,8 +407,8 @@ impl TryFrom<eth_abi::L1Update> for L1Update {
Ok(Self {
pendingDeposits: pending_deposits
.map_err(|e| format!("Error converting pendingDeposits: {}", e))?,
pendingCancelResultions: pending_cancel_resultions
.map_err(|e| format!("Error converting pendingCancelResultions: {}", e))?,
pendingCancelResolutions: pending_cancel_resultions
.map_err(|e| format!("Error converting pendingCancelResolutions: {}", e))?,
pendingL2UpdatesToRemove: pending_l2_updates_to_remove
.map_err(|e| format!("Error converting pendingL2UpdatesToRemove: {}", e))?,
pendingWithdrawalResolutions: pending_withdrawal_resolutions
Expand Down Expand Up @@ -536,7 +536,7 @@ pub mod eth_abi {
#[derive(Debug)]
struct L1Update {
Deposit[] pendingDeposits;
CancelResolution[] pendingCancelResultions;
CancelResolution[] pendingCancelResolutions;
WithdrawalResolution[] pendingWithdrawalResolutions;
L2UpdatesToRemove[] pendingL2UpdatesToRemove;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/rolldown/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl L1UpdateBuilder {
},
L1UpdateRequest::CancelResolution(mut c) => {
c.requestId.id = rid;
update.pendingCancelResultions.push(c);
update.pendingCancelResolutions.push(c);
},
L1UpdateRequest::Remove(mut r) => {
r.requestId.id = rid;
Expand Down
4 changes: 4 additions & 0 deletions pallets/sequencer-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ pub mod pallet {
// add +1 cancel right to all other sequencers (non active are deleted from sequencer_rights @ rolldown)
assert!(T::Currency::reserve(&sender, *stake_amount).is_ok());
}

if let Some(seq) = ActiveSequencers::<T>::get().get(0) {
SelectedSequencer::<T>::put(seq.clone());
}
}
}

Expand Down

0 comments on commit 7fed0e3

Please sign in to comment.