mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Introduce new Runtime API endpoint for fetching the validation data (#3728)
* Introduce new Runtime API endpoint `persisted_validation_data_with_code_hash` that will be used by the candidate validation subsystem in order to decrease amount of runtime API requests. * Node-side part of new runtime API request * Define code hash getter via macro * Rename new endpoint to `assumed_validation_data` * Docs for runtime API impl of new endpoint * AssumedValidationData specialized request function * fmt
This commit is contained in:
@@ -365,6 +365,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Corresponding code can be retrieved with [`CodeByHash`].
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn current_code_hash)]
|
||||
pub(super) type CurrentCodeHash<T: Config> =
|
||||
StorageMap<_, Twox64Concat, ParaId, ValidationCodeHash>;
|
||||
|
||||
@@ -623,7 +624,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
/// The validation code of live para.
|
||||
pub(crate) fn current_code(para_id: &ParaId) -> Option<ValidationCode> {
|
||||
CurrentCodeHash::<T>::get(para_id).and_then(|code_hash| {
|
||||
Self::current_code_hash(para_id).and_then(|code_hash| {
|
||||
let code = CodeByHash::<T>::get(&code_hash);
|
||||
if code.is_none() {
|
||||
log::error!(
|
||||
|
||||
Reference in New Issue
Block a user