Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Revert "frame/remote-externalities: Eliminate side effect on batch re…
Browse files Browse the repository at this point in the history
…quest failure"

This reverts commit 3678529.
  • Loading branch information
lexnv committed Dec 13, 2022
1 parent 56d9b70 commit dcaf580
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions utils/frame/remote-externalities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ where
// `pending_ext`.
let mut terminated = 0usize;
let mut batch_failed = false;
let mut batch_kv = Vec::with_capacity(keys.len());

loop {
match rx.next().await.unwrap() {
Message::Batch(kv) => {
Expand All @@ -526,7 +524,7 @@ where
if is_default_child_storage_key(k.as_ref()) {
continue
}
batch_kv.push((k, v));
pending_ext.insert(k, v);
}
},
Message::BatchFailed(error) => {
Expand All @@ -551,11 +549,6 @@ where
return Err("Batch failed.")
}

// Ensure that `pending_ext` is populated only if the batch succeeded.
for (k, v) in batch_kv.into_iter() {
pending_ext.insert(k, v);
}

Ok(keys_and_values)
}

Expand Down

0 comments on commit dcaf580

Please sign in to comment.