Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/offchain/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/offchain/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/offchain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down