Skip to content

Commit

Permalink
fix CI fail
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Jan 8, 2024
1 parent a0d9fa4 commit 5483439
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions substrate/dex/pallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ pub mod pallet {
}
};

// We should always have a next since we are follwing the items in the key lists.
let next = next.unwrap();
// We should always have a next since we are follwing the items in the key lists except
// very specific scenario which `current_size` is `1` and inserted value and current is the
// same value, in which next is already the current.
let next = next.unwrap_or(current.to_be_bytes());
MedianPrice::<T>::set(coin, Some(Amount(u64::from_be_bytes(next))));
}
}
Expand Down

0 comments on commit 5483439

Please sign in to comment.