Skip to content
Snippets Groups Projects
Commit 8d6d1f7f authored by Éloïs's avatar Éloïs
Browse files

fix(pallet-randomness): RequestsId should be pruned

parent eedb2c52
No related branches found
No related tags found
No related merge requests found
...@@ -172,6 +172,7 @@ pub mod pallet { ...@@ -172,6 +172,7 @@ pub mod pallet {
let randomness = T::CurrentBlockRandomness::random(salt.as_ref()) let randomness = T::CurrentBlockRandomness::random(salt.as_ref())
.0 .0
.unwrap_or_default(); .unwrap_or_default();
RequestsIds::<T>::remove(request_id);
total_weight += T::OnFilledRandomness::on_filled_randomness(request_id, randomness); total_weight += T::OnFilledRandomness::on_filled_randomness(request_id, randomness);
Self::deposit_event(Event::FilledRandomness { Self::deposit_event(Event::FilledRandomness {
request_id, request_id,
...@@ -189,6 +190,7 @@ pub mod pallet { ...@@ -189,6 +190,7 @@ pub mod pallet {
RequestsReadyAtEpoch::<T>::take(T::GetCurrentEpochIndex::get()) RequestsReadyAtEpoch::<T>::take(T::GetCurrentEpochIndex::get())
{ {
let randomness = T::RandomnessFromOneEpochAgo::random(salt.as_ref()).0; let randomness = T::RandomnessFromOneEpochAgo::random(salt.as_ref()).0;
RequestsIds::<T>::remove(request_id);
total_weight += total_weight +=
T::OnFilledRandomness::on_filled_randomness(request_id, randomness); T::OnFilledRandomness::on_filled_randomness(request_id, randomness);
Self::deposit_event(Event::FilledRandomness { Self::deposit_event(Event::FilledRandomness {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment