Refactors the offchain worker api (#3150)

* Update offchain primitives.

* Update offchain worker.

* Update im-online.

* Update service.

* Update node and node-template.

* Update runtime version.

* Fix build.

* Fix offchain worker tests.

* Generalize authority_pubkey.

* Add test.

* Update lib.rs
This commit is contained in:
David Craven
2019-07-22 11:20:57 +02:00
committed by Gavin Wood
parent 2edeef5825
commit a3d19baea3
17 changed files with 509 additions and 327 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ use parking_lot::Mutex;
/// Offchain local storage
#[derive(Clone)]
pub struct LocalStorage {
db: Arc<KeyValueDB>,
db: Arc<dyn KeyValueDB>,
locks: Arc<Mutex<HashMap<Vec<u8>, Arc<Mutex<()>>>>>,
}
@@ -48,7 +48,7 @@ impl LocalStorage {
}
/// Create offchain local storage with given `KeyValueDB` backend.
pub fn new(db: Arc<KeyValueDB>) -> Self {
pub fn new(db: Arc<dyn KeyValueDB>) -> Self {
Self {
db,
locks: Default::default(),