mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
expose offchain worker storage prefix (#3977)
* expose offchain worker storage prefix * add docs * move STORAGE_PREFIX to primitives
This commit is contained in:
committed by
GitHub
parent
2ff04d332d
commit
4852763d73
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user