mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Replace mutate with get + set
I'm legitimately unsure why mutate doesn't work. Reading the impls, it should...
This commit is contained in:
@@ -169,10 +169,11 @@ pub mod pallet {
|
||||
fn new_set(network: NetworkId) {
|
||||
// Update CurrentSession
|
||||
let session = if network != NetworkId::Serai {
|
||||
CurrentSession::<T>::mutate(network, |session| {
|
||||
Some(session.map(|session| Session(session.0 + 1)).unwrap_or(Session(0)))
|
||||
})
|
||||
.unwrap()
|
||||
let new_session = CurrentSession::<T>::get(network)
|
||||
.map(|session| Session(session.0 + 1))
|
||||
.unwrap_or(Session(0));
|
||||
CurrentSession::<T>::set(network, Some(new_session));
|
||||
new_session
|
||||
} else {
|
||||
Self::session(network)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user