fix(staking miner): use StorageKey in getStorage (#4231)

Use `StorageKey` in the rpc call `getStorage` instead of `[u8;32]`
This commit is contained in:
Niklas Adolfsson
2021-11-06 08:16:00 +01:00
committed by GitHub
parent bc61fa86f0
commit b5583c26b6
+3 -2
View File
@@ -25,13 +25,14 @@ use jsonrpsee_ws_client::{
WsClient,
};
use sc_transaction_pool_api::TransactionStatus;
use sp_core::storage::StorageKey;
/// Ensure that now is the signed phase.
async fn ensure_signed_phase<T: EPM::Config, B: BlockT>(
client: &WsClient,
at: B::Hash,
) -> Result<(), Error<T>> {
let key = sp_core::storage::StorageKey(EPM::CurrentPhase::<T>::hashed_key().to_vec());
let key = StorageKey(EPM::CurrentPhase::<T>::hashed_key().to_vec());
let phase = get_storage::<EPM::Phase<BlockNumber>>(client, params! {key, at})
.await
.map_err::<Error<T>, _>(Into::into)?
@@ -156,7 +157,7 @@ macro_rules! monitor_cmd_for { ($runtime:tt) => { paste::paste! {
TransactionStatus::Ready | TransactionStatus::Broadcast(_) | TransactionStatus::Future => continue,
TransactionStatus::InBlock(hash) => {
log::info!(target: LOG_TARGET, "included at {:?}", hash);
let key = frame_support::storage::storage_prefix(b"System", b"Events");
let key = StorageKey(frame_support::storage::storage_prefix(b"System",b"Events").to_vec());
let events = get_storage::<Vec<frame_system::EventRecord<Event, <Block as BlockT>::Hash>>,
>(client, params!{ key, hash }).await?.unwrap_or_default();
log::info!(target: LOG_TARGET, "events at inclusion {:?}", events);