Handle local storage race conditions better (#3177)

* Make local_storage_compare_and_set take Option for old_value

* Adapt srml/im-online to API changes

* Bump version

* Bump version again

* Replace match
This commit is contained in:
Michael Müller authored and Gavin Wood committed 2019-07-26 07:42:40 +08:00
1 parent af914e9f40
commit 23fba990ba
11 files changed
+118 -33

No files matched your search

+2 -2
View File
@@ -384,7 +384,7 @@ pub trait Externalities {
&mut self,
kind: StorageKind,
key: &[u8],
old_value: &[u8],
old_value: Option<&[u8]>,
new_value: &[u8],
) -> bool;
@@ -514,7 +514,7 @@ impl<T: Externalities + ?Sized> Externalities for Box<T> {
&mut self,
kind: StorageKind,
key: &[u8],
old_value: &[u8],
old_value: Option<&[u8]>,
new_value: &[u8],
) -> bool {
(&mut **self).local_storage_compare_and_set(kind, key, old_value, new_value)