Skip to content
Snippets Groups Projects
Commit 4852763d authored by Benjamin Kampmann's avatar Benjamin Kampmann Committed by GitHub
Browse files

expose offchain worker storage prefix (#3977)

* expose offchain worker storage prefix

* add docs

* move STORAGE_PREFIX to primitives
parent 2ff04d33
Branches
No related merge requests found
......@@ -22,6 +22,9 @@
use client::decl_runtime_apis;
use sr_primitives::traits::NumberFor;
/// Local Storage Prefix used by the Offchain Worker API to
pub const STORAGE_PREFIX: &[u8] = b"storage";
decl_runtime_apis! {
/// The offchain worker api.
pub trait OffchainWorkerApi {
......
......@@ -30,6 +30,7 @@ use primitives::offchain::{
Externalities as OffchainExt, HttpRequestId, Timestamp, HttpRequestStatus, HttpError,
OpaqueNetworkState, OpaquePeerId, OpaqueMultiaddr, StorageKind,
};
pub use offchain_primitives::STORAGE_PREFIX;
use sr_primitives::{generic::BlockId, traits::{self, Extrinsic}};
use transaction_pool::txpool::{Pool, ChainApi};
......@@ -71,7 +72,6 @@ fn unavailable_yet<R: Default>(name: &str) -> R {
}
const LOCAL_DB: &str = "LOCAL (fork-aware) DB";
const STORAGE_PREFIX: &[u8] = b"storage";
impl<Storage, Block> OffchainExt for Api<Storage, Block>
where
......
......@@ -53,7 +53,7 @@ mod api;
pub mod testing;
pub use offchain_primitives::OffchainWorkerApi;
pub use offchain_primitives::{OffchainWorkerApi, STORAGE_PREFIX};
/// An offchain workers manager.
pub struct OffchainWorkers<Client, Storage, Block: traits::Block> {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment