|
21 | 21 | #![cfg_attr(not(feature = "std"), no_std)]
|
22 | 22 |
|
23 | 23 | mod mock;
|
24 |
| -pub mod address; |
25 | 24 | mod tests;
|
26 | 25 | mod benchmarking;
|
27 | 26 | pub mod weights;
|
28 | 27 |
|
29 | 28 | use sp_std::prelude::*;
|
30 | 29 | use codec::Codec;
|
| 30 | +use sp_runtime::MultiAddress; |
31 | 31 | use sp_runtime::traits::{
|
32 | 32 | StaticLookup, Member, LookupError, Zero, Saturating, AtLeast32Bit
|
33 | 33 | };
|
34 | 34 | use frame_support::{Parameter, decl_module, decl_error, decl_event, decl_storage, ensure};
|
35 | 35 | use frame_support::dispatch::DispatchResult;
|
36 | 36 | use frame_support::traits::{Currency, ReservableCurrency, Get, BalanceStatus::Reserved};
|
37 | 37 | use frame_system::{ensure_signed, ensure_root};
|
38 |
| -use self::address::Address as RawAddress; |
39 | 38 | pub use weights::WeightInfo;
|
40 | 39 |
|
41 |
| -pub type Address<T> = RawAddress<<T as frame_system::Trait>::AccountId, <T as Trait>::AccountIndex>; |
42 | 40 | type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
|
43 | 41 |
|
44 | 42 | /// The module's config trait.
|
@@ -287,24 +285,25 @@ impl<T: Trait> Module<T> {
|
287 | 285 |
|
288 | 286 | /// Lookup an address to get an Id, if there's one there.
|
289 | 287 | pub fn lookup_address(
|
290 |
| - a: address::Address<T::AccountId, T::AccountIndex> |
| 288 | + a: MultiAddress<T::AccountId, T::AccountIndex> |
291 | 289 | ) -> Option<T::AccountId> {
|
292 | 290 | match a {
|
293 |
| - address::Address::Id(i) => Some(i), |
294 |
| - address::Address::Index(i) => Self::lookup_index(i), |
| 291 | + MultiAddress::Id(i) => Some(i), |
| 292 | + MultiAddress::Index(i) => Self::lookup_index(i), |
| 293 | + _ => None, |
295 | 294 | }
|
296 | 295 | }
|
297 | 296 | }
|
298 | 297 |
|
299 | 298 | impl<T: Trait> StaticLookup for Module<T> {
|
300 |
| - type Source = address::Address<T::AccountId, T::AccountIndex>; |
| 299 | + type Source = MultiAddress<T::AccountId, T::AccountIndex>; |
301 | 300 | type Target = T::AccountId;
|
302 | 301 |
|
303 | 302 | fn lookup(a: Self::Source) -> Result<Self::Target, LookupError> {
|
304 | 303 | Self::lookup_address(a).ok_or(LookupError)
|
305 | 304 | }
|
306 | 305 |
|
307 | 306 | fn unlookup(a: Self::Target) -> Self::Source {
|
308 |
| - address::Address::Id(a) |
| 307 | + MultiAddress::Id(a) |
309 | 308 | }
|
310 | 309 | }
|
0 commit comments