mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
contracts: Refactor trait Ext::*_storage_transparent functions (#13600)
* Refactor _transparent methods rewrote commits, stashed the typo changes to remove some diff noise fixed my unverified email commit * remove type alias * Get rid of From<Fix/VarSizedKey> impl blocks * Get rid of KeyType impl block * remove unnecessary Key export * Update frame/contracts/src/exec.rs Co-authored-by: Sasha Gryaznov <hi@agryaznov.com> * PR review comment --------- Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
This commit is contained in:
@@ -100,7 +100,7 @@ pub mod weights;
|
||||
mod tests;
|
||||
|
||||
use crate::{
|
||||
exec::{AccountIdOf, ErrorOrigin, ExecError, Executable, Stack as ExecStack},
|
||||
exec::{AccountIdOf, ErrorOrigin, ExecError, Executable, Key, Stack as ExecStack},
|
||||
gas::GasMeter,
|
||||
storage::{meter::Meter as StorageMeter, ContractInfo, DeletedContract},
|
||||
wasm::{OwnerInfo, PrefabWasmModule, TryInstantiate},
|
||||
@@ -131,7 +131,7 @@ use sp_std::{fmt::Debug, marker::PhantomData, prelude::*};
|
||||
|
||||
pub use crate::{
|
||||
address::{AddressGenerator, DefaultAddressGenerator},
|
||||
exec::{Frame, VarSizedKey as StorageKey},
|
||||
exec::Frame,
|
||||
migration::Migration,
|
||||
pallet::*,
|
||||
schedule::{HostFnWeights, InstructionWeights, Limits, Schedule},
|
||||
@@ -1265,7 +1265,9 @@ impl<T: Config> Pallet<T> {
|
||||
ContractInfoOf::<T>::get(&address).ok_or(ContractAccessError::DoesntExist)?;
|
||||
|
||||
let maybe_value = contract_info.read(
|
||||
&StorageKey::<T>::try_from(key).map_err(|_| ContractAccessError::KeyDecodingFailed)?,
|
||||
&Key::<T>::try_from_var(key)
|
||||
.map_err(|_| ContractAccessError::KeyDecodingFailed)?
|
||||
.into(),
|
||||
);
|
||||
Ok(maybe_value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user