Skip to content

Commit

Permalink
Rename to InvalidPendingNonce & Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Nov 19, 2024
1 parent af928ba commit d5ab77b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pub mod pallet {
/// Invalid Gateway
InvalidGateway,
/// No pending nonce
PendingNonceNotExist,
InvalidPendingNonce,
}

/// Messages to be committed in the current block. This storage value is killed in
Expand Down Expand Up @@ -274,9 +274,8 @@ pub mod pallet {
ensure!(T::GatewayAddress::get() == envelope.gateway, Error::<T>::InvalidGateway);

let nonce = envelope.nonce;
ensure!(<PendingOrders<T>>::contains_key(nonce), Error::<T>::PendingNonceNotExist);

let order = <PendingOrders<T>>::get(nonce).ok_or(Error::<T>::PendingNonceNotExist)?;
let order = <PendingOrders<T>>::get(nonce).ok_or(Error::<T>::InvalidPendingNonce)?;

// No fee for governance order
if !order.fee.is_zero() {
Expand Down

0 comments on commit d5ab77b

Please sign in to comment.