mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-25 23:27:56 +00:00
Replace T::AccountId with <T::Lookup as StaticLookup>::Source (#11670)
* initial * update * update * update * cargo fmt * update * update benchmarks * AccountIdLookupOf<T> * cargo fmt * fix conflits * cargo fmt * update Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -46,9 +46,12 @@ pub mod weights;
|
||||
|
||||
pub use pallet::*;
|
||||
use sp_core::OpaquePeerId as PeerId;
|
||||
use sp_runtime::traits::StaticLookup;
|
||||
use sp_std::{collections::btree_set::BTreeSet, iter::FromIterator, prelude::*};
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
type AccountIdLookupOf<T> = <<T as frame_system::Config>::Lookup as StaticLookup>::Source;
|
||||
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
@@ -211,9 +214,10 @@ pub mod pallet {
|
||||
pub fn add_well_known_node(
|
||||
origin: OriginFor<T>,
|
||||
node: PeerId,
|
||||
owner: T::AccountId,
|
||||
owner: AccountIdLookupOf<T>,
|
||||
) -> DispatchResult {
|
||||
T::AddOrigin::ensure_origin(origin)?;
|
||||
let owner = T::Lookup::lookup(owner)?;
|
||||
ensure!(node.0.len() < T::MaxPeerIdLength::get() as usize, Error::<T>::PeerIdTooLong);
|
||||
|
||||
let mut nodes = WellKnownNodes::<T>::get();
|
||||
@@ -355,9 +359,10 @@ pub mod pallet {
|
||||
pub fn transfer_node(
|
||||
origin: OriginFor<T>,
|
||||
node: PeerId,
|
||||
owner: T::AccountId,
|
||||
owner: AccountIdLookupOf<T>,
|
||||
) -> DispatchResult {
|
||||
let sender = ensure_signed(origin)?;
|
||||
let owner = T::Lookup::lookup(owner)?;
|
||||
|
||||
ensure!(node.0.len() < T::MaxPeerIdLength::get() as usize, Error::<T>::PeerIdTooLong);
|
||||
let pre_owner = Owners::<T>::get(&node).ok_or(Error::<T>::NotClaimed)?;
|
||||
|
||||
Reference in New Issue
Block a user