|
14 | 14 | // You should have received a copy of the GNU General Public License
|
15 | 15 | // along with Litentry. If not, see <https://www.gnu.org/licenses/>.
|
16 | 16 |
|
17 |
| -use crate::{self as pallet_omni_account, Decode, Encode, EnsureOmniAccount, MaxEncodedLen}; |
| 17 | +use crate::{self as pallet_omni_account, Decode, Encode, EnsureOmniAccount}; |
18 | 18 | use frame_support::{
|
19 | 19 | assert_ok, derive_impl,
|
20 | 20 | pallet_prelude::EnsureOrigin,
|
21 | 21 | parameter_types,
|
22 |
| - traits::{ConstU32, ConstU64, InstanceFilter}, |
| 22 | + traits::{ConstU32, ConstU64}, |
23 | 23 | };
|
24 | 24 | use frame_system::EnsureRoot;
|
25 | 25 | use heima_primitives::{DefaultOmniAccountConverter, Identity, MemberAccount};
|
@@ -166,100 +166,13 @@ impl pallet_teebag::Config for Test {
|
166 | 166 | type WeightInfo = ();
|
167 | 167 | }
|
168 | 168 |
|
169 |
| -#[derive( |
170 |
| - Copy, |
171 |
| - Clone, |
172 |
| - PartialEq, |
173 |
| - Eq, |
174 |
| - Ord, |
175 |
| - PartialOrd, |
176 |
| - Encode, |
177 |
| - Decode, |
178 |
| - RuntimeDebug, |
179 |
| - MaxEncodedLen, |
180 |
| - scale_info::TypeInfo, |
181 |
| -)] |
182 |
| -pub enum OmniAccountPermission { |
183 |
| - All, |
184 |
| - AccountManagement, |
185 |
| - RequestNativeIntent, |
186 |
| - RequestEthereumIntent, |
187 |
| - RequestSolanaIntent, |
188 |
| -} |
189 |
| - |
190 |
| -impl Default for OmniAccountPermission { |
191 |
| - fn default() -> Self { |
192 |
| - Self::All |
193 |
| - } |
194 |
| -} |
195 |
| - |
196 |
| -impl InstanceFilter<RuntimeCall> for OmniAccountPermission { |
197 |
| - fn filter(&self, call: &RuntimeCall) -> bool { |
198 |
| - match self { |
199 |
| - Self::All => true, |
200 |
| - Self::AccountManagement => { |
201 |
| - matches!( |
202 |
| - call, |
203 |
| - RuntimeCall::OmniAccount(pallet_omni_account::Call::add_account { .. }) |
204 |
| - | RuntimeCall::OmniAccount( |
205 |
| - pallet_omni_account::Call::remove_accounts { .. } |
206 |
| - ) | RuntimeCall::OmniAccount( |
207 |
| - pallet_omni_account::Call::publicize_account { .. } |
208 |
| - ) | RuntimeCall::OmniAccount(pallet_omni_account::Call::set_permissions { .. }) |
209 |
| - ) |
210 |
| - }, |
211 |
| - Self::RequestNativeIntent => { |
212 |
| - if let RuntimeCall::OmniAccount(pallet_omni_account::Call::request_intent { |
213 |
| - intent, |
214 |
| - }) = call |
215 |
| - { |
216 |
| - matches!( |
217 |
| - intent, |
218 |
| - pallet_omni_account::Intent::SystemRemark(_) |
219 |
| - | pallet_omni_account::Intent::TransferNative(_) |
220 |
| - ) |
221 |
| - } else { |
222 |
| - false |
223 |
| - } |
224 |
| - }, |
225 |
| - Self::RequestEthereumIntent => { |
226 |
| - if let RuntimeCall::OmniAccount(pallet_omni_account::Call::request_intent { |
227 |
| - intent, |
228 |
| - }) = call |
229 |
| - { |
230 |
| - matches!( |
231 |
| - intent, |
232 |
| - pallet_omni_account::Intent::TransferEthereum(_) |
233 |
| - | pallet_omni_account::Intent::CallEthereum(_) |
234 |
| - ) |
235 |
| - } else { |
236 |
| - false |
237 |
| - } |
238 |
| - }, |
239 |
| - Self::RequestSolanaIntent => { |
240 |
| - if let RuntimeCall::OmniAccount(pallet_omni_account::Call::request_intent { |
241 |
| - intent, |
242 |
| - }) = call |
243 |
| - { |
244 |
| - matches!(intent, pallet_omni_account::Intent::TransferSolana(_)) |
245 |
| - } else { |
246 |
| - false |
247 |
| - } |
248 |
| - }, |
249 |
| - } |
250 |
| - } |
251 |
| -} |
252 |
| - |
253 | 169 | impl pallet_omni_account::Config for Test {
|
254 | 170 | type RuntimeOrigin = RuntimeOrigin;
|
255 | 171 | type RuntimeCall = RuntimeCall;
|
256 | 172 | type RuntimeEvent = RuntimeEvent;
|
257 | 173 | type TEECallOrigin = EnsureEnclaveSigner<Self>;
|
258 |
| - type MaxAccountStoreLength = ConstU32<3>; |
259 | 174 | type OmniAccountOrigin = EnsureOmniAccount<Self::AccountId>;
|
260 | 175 | type OmniAccountConverter = DefaultOmniAccountConverter;
|
261 |
| - type MaxPermissions = ConstU32<4>; |
262 |
| - type Permission = OmniAccountPermission; |
263 | 176 | }
|
264 | 177 |
|
265 | 178 | pub fn get_tee_signer() -> SystemAccountId {
|
|
0 commit comments