diff --git a/Cargo.lock b/Cargo.lock index 3bb1095c20..e3f915979d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8386,6 +8386,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-std", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 081c4ba32e..7b7b477a84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ async-trait = "0.1.59" clap = { version = "4.2.5", features = ["derive"] } env_logger = "0.10.0" futures = { version = "0.3.26" } -serde = { version = "1.0.151", default-features = false, features = ["derive"] } +serde = { version = "1.0.151", default-features = false, features = ["derive", "alloc"] } serde_json = "1.0.92" tokio = { version = "1.24.2", features = ["macros", "sync"] } url = "2.2.2" @@ -188,7 +188,7 @@ ethereum = { version = "0.14.0", default-features = false } # Frontier # (wasm) fp-rpc = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false } -fp-self-contained = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false } +fp-self-contained = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false, features = ["serde"] } pallet-ethereum = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false, features = ["forbid-evm-reentrancy"] } pallet-evm = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false, features = ["forbid-evm-reentrancy"] } pallet-evm-precompile-blake2 = { git = "https://github.com/AstarNetwork/frontier", branch = "polkadot-v1.1.0", default-features = false } diff --git a/pallets/block-rewards-hybrid/src/lib.rs b/pallets/block-rewards-hybrid/src/lib.rs index f78e94b509..e7859fcdad 100644 --- a/pallets/block-rewards-hybrid/src/lib.rs +++ b/pallets/block-rewards-hybrid/src/lib.rs @@ -82,6 +82,7 @@ use astar_primitives::Balance; use frame_support::pallet_prelude::*; use frame_support::traits::{Currency, Get, Imbalance, OnTimestampSet}; use frame_system::{ensure_root, pallet_prelude::*}; +use serde::{Deserialize, Serialize}; use sp_runtime::{ traits::{CheckedAdd, Zero}, Perbill, @@ -279,8 +280,18 @@ pub mod pallet { /// /// Note that if `ideal_dapps_staking_tvl` is set to `Zero`, entire `adjustable_percent` goes to the stakers. /// -#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + PartialEq, + Eq, + Clone, + Encode, + Decode, + RuntimeDebug, + TypeInfo, + MaxEncodedLen, + Serialize, + Deserialize, +)] pub struct RewardDistributionConfig { /// Base percentage of reward that goes to treasury #[codec(compact)] diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index 2cae6ca6a2..b626bdbf6d 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -95,6 +95,7 @@ pub mod pallet { use pallet_session::SessionManager; use sp_runtime::{traits::Convert, Perbill}; use sp_staking::SessionIndex; + use sp_std::prelude::*; type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; @@ -223,7 +224,7 @@ pub mod pallet { let duplicate_invulnerables = self .invulnerables .iter() - .collect::>(); + .collect::>(); assert!( duplicate_invulnerables.len() == self.invulnerables.len(), "duplicate invulnerables in genesis." diff --git a/pallets/dapp-staking-migration/src/benchmarking.rs b/pallets/dapp-staking-migration/src/benchmarking.rs index 345a622cad..24e20928e2 100644 --- a/pallets/dapp-staking-migration/src/benchmarking.rs +++ b/pallets/dapp-staking-migration/src/benchmarking.rs @@ -20,6 +20,7 @@ use super::{Pallet as Migration, *}; use frame_benchmarking::{account as benchmark_account, v2::*}; use frame_support::{assert_ok, traits::Currency}; +use sp_std::prelude::*; /// Generate an unique smart contract using the provided index as a sort-of indetifier fn smart_contract(index: u8) -> T::SmartContract { diff --git a/pallets/dapp-staking-v3/Cargo.toml b/pallets/dapp-staking-v3/Cargo.toml index c79755828d..84b1535999 100644 --- a/pallets/dapp-staking-v3/Cargo.toml +++ b/pallets/dapp-staking-v3/Cargo.toml @@ -15,7 +15,7 @@ num-traits = { workspace = true } parity-scale-codec = { workspace = true } scale-info = { workspace = true } -serde = { workspace = true, optional = true } +serde = { workspace = true } sp-arithmetic = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } @@ -33,7 +33,7 @@ pallet-balances = { workspace = true } [features] default = ["std"] std = [ - "serde", + "serde/std", "log/std", "parity-scale-codec/std", "scale-info/std", diff --git a/pallets/dapp-staking-v3/src/benchmarking/mod.rs b/pallets/dapp-staking-v3/src/benchmarking/mod.rs index fc08855563..804db87432 100644 --- a/pallets/dapp-staking-v3/src/benchmarking/mod.rs +++ b/pallets/dapp-staking-v3/src/benchmarking/mod.rs @@ -23,6 +23,7 @@ use frame_benchmarking::v2::*; use frame_support::assert_ok; use frame_system::{Pallet as System, RawOrigin}; +use sp_std::prelude::*; use ::assert_matches::assert_matches; diff --git a/pallets/dapp-staking-v3/src/types.rs b/pallets/dapp-staking-v3/src/types.rs index 870e00223f..16e9747e18 100644 --- a/pallets/dapp-staking-v3/src/types.rs +++ b/pallets/dapp-staking-v3/src/types.rs @@ -66,6 +66,7 @@ use frame_support::{pallet_prelude::*, BoundedBTreeMap, BoundedVec}; use parity_scale_codec::{Decode, Encode}; +use serde::{Serialize, Deserialize} use sp_arithmetic::fixed_point::FixedU64; use sp_runtime::{ traits::{CheckedAdd, UniqueSaturatedInto, Zero}, @@ -1370,8 +1371,20 @@ where } /// Description of tier entry requirement. -#[derive(Encode, Decode, MaxEncodedLen, Copy, Clone, Debug, PartialEq, Eq, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + Encode, + Decode, + MaxEncodedLen, + Copy, + Clone, + Debug, + PartialEq, + Eq, + TypeInfo, + Serialize, + Deserialize, +)] +// #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub enum TierThreshold { /// Entry into tier is mandated by minimum amount of staked funds. /// Value is fixed, and is not expected to change in between periods. @@ -1530,7 +1543,7 @@ impl> TiersConfiguration { // All vector length must match number of tiers. && number_of_tiers == self.reward_portion.len() && number_of_tiers == self.tier_thresholds.len() - // Total number of slots must match the sum of slots per tier. + // Total number of slots must match the sum of slots per tier. && self.slots_per_tier.iter().fold(0, |acc, x| acc + x) == self.number_of_slots } diff --git a/pallets/dynamic-evm-base-fee/Cargo.toml b/pallets/dynamic-evm-base-fee/Cargo.toml index 864a03b054..c6ecb9208e 100644 --- a/pallets/dynamic-evm-base-fee/Cargo.toml +++ b/pallets/dynamic-evm-base-fee/Cargo.toml @@ -19,6 +19,7 @@ frame-system = { workspace = true } pallet-transaction-payment = { workspace = true } sp-core = { workspace = true } sp-runtime = { workspace = true } +sp-std = { workspace = true } # Frontier fp-evm = { workspace = true } @@ -40,6 +41,7 @@ std = [ "frame-system/std", "sp-core/std", "sp-runtime/std", + "sp-std/std", "pallet-transaction-payment/std", "pallet-balances/std", "pallet-timestamp/std", diff --git a/pallets/dynamic-evm-base-fee/src/benchmarking.rs b/pallets/dynamic-evm-base-fee/src/benchmarking.rs index 6b1312e97f..8c3d63e1b4 100644 --- a/pallets/dynamic-evm-base-fee/src/benchmarking.rs +++ b/pallets/dynamic-evm-base-fee/src/benchmarking.rs @@ -22,6 +22,7 @@ use fp_evm::FeeCalculator; use frame_benchmarking::v2::*; use frame_support::traits::Hooks; use frame_system::{pallet_prelude::*, RawOrigin}; +use sp_std::prelude::*; #[benchmarks( where diff --git a/pallets/ethereum-checked/src/benchmarking.rs b/pallets/ethereum-checked/src/benchmarking.rs index 6abf9f8075..ec189dff52 100644 --- a/pallets/ethereum-checked/src/benchmarking.rs +++ b/pallets/ethereum-checked/src/benchmarking.rs @@ -20,6 +20,7 @@ use super::*; use astar_primitives::ethereum_checked::EthereumTxInput; use frame_benchmarking::v2::*; +use sp_std::prelude::*; #[benchmarks] mod benchmarks { diff --git a/pallets/inflation/src/benchmarking.rs b/pallets/inflation/src/benchmarking.rs index 857e77593d..83fc78d693 100644 --- a/pallets/inflation/src/benchmarking.rs +++ b/pallets/inflation/src/benchmarking.rs @@ -21,6 +21,7 @@ use super::*; use astar_primitives::BlockNumber; use frame_benchmarking::v2::*; use frame_system::{Pallet as System, RawOrigin}; +use sp_std::prelude::*; /// Assert that the last event equals the provided one. fn assert_last_event(generic_event: ::RuntimeEvent) { diff --git a/pallets/inflation/src/lib.rs b/pallets/inflation/src/lib.rs index 5bcf460055..0164cfdc42 100644 --- a/pallets/inflation/src/lib.rs +++ b/pallets/inflation/src/lib.rs @@ -110,6 +110,7 @@ use frame_support::{ DefaultNoBound, }; use frame_system::{ensure_root, pallet_prelude::*}; +use serde::{Deserialize, Serialize}; use sp_runtime::{traits::CheckedAdd, Perquintill}; use sp_std::marker::PhantomData; @@ -518,8 +519,20 @@ pub struct InflationConfiguration { /// Inflation parameters. /// /// The parts of the inflation that go towards different purposes must add up to exactly 100%. -#[derive(Encode, Decode, MaxEncodedLen, Copy, Clone, Debug, PartialEq, Eq, TypeInfo)] -#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] +#[derive( + Encode, + Decode, + MaxEncodedLen, + Copy, + Clone, + Debug, + PartialEq, + Eq, + TypeInfo, + Serialize, + Deserialize, +)] +// #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] pub struct InflationParameters { /// Maximum possible inflation rate, based on the total issuance at some point in time. /// From this value, all the other inflation parameters are derived. diff --git a/pallets/unified-accounts/src/benchmarking.rs b/pallets/unified-accounts/src/benchmarking.rs index a781b8abb4..8b2dff2b15 100644 --- a/pallets/unified-accounts/src/benchmarking.rs +++ b/pallets/unified-accounts/src/benchmarking.rs @@ -22,6 +22,7 @@ use super::*; use frame_benchmarking::v2::*; use frame_support::assert_ok; use frame_system::RawOrigin; +use sp_std::prelude::*; /// Assert that the last event equals the provided one. fn assert_last_event(generic_event: ::RuntimeEvent) { diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index bca98006df..7f7ed3302e 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -77,8 +77,6 @@ pub type Hash = sp_core::H256; /// [2^64; 2^128-1] Ecosystem assets /// 2^128-1 Relay chain token (KSM) pub type AssetId = u128; -/// Index of a transaction in the chain. -pub type Index = u32; /// Block type. pub type Block = sp_runtime::generic::Block; /// Index of a transaction in the chain. diff --git a/runtime/astar/src/lib.rs b/runtime/astar/src/lib.rs index 3dedf85630..b69c5560e4 100644 --- a/runtime/astar/src/lib.rs +++ b/runtime/astar/src/lib.rs @@ -25,7 +25,7 @@ pub use crate::precompiles::WhitelistedCalls; pub use astar_primitives::{ evm::EvmRevertCodeHandler, xcm::AssetLocationIdConverter, AccountId, Address, AssetId, Balance, - BlockNumber, Hash, Header, Index, Signature, + BlockNumber, Hash, Header, Nonce, Signature, }; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use frame_support::{ @@ -224,7 +224,7 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; + type Index = Nonce; /// The index type for blocks. type BlockNumber = BlockNumber; /// The type for hashing blocks and tries. @@ -1217,8 +1217,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index 99adbc6c84..4d4555bafd 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -63,7 +63,7 @@ use sp_std::{collections::btree_map::BTreeMap, prelude::*}; use astar_primitives::{ dapp_staking::{CycleConfiguration, DAppId, EraNumber, PeriodNumber, SmartContract, TierId}, evm::{EvmRevertCodeHandler, HashedDefaultMappings}, - Address, AssetId, Balance, BlockNumber, Hash, Header, Index, + Address, AssetId, Balance, BlockNumber, Hash, Header, Nonce, }; pub use astar_primitives::{AccountId, Signature}; @@ -207,7 +207,7 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = (AccountIdLookup, UnifiedAccounts); /// The index type for storing how many extrinsics an account has signed. - type Nonce = Index; + type Nonce = Nonce; /// The index type for blocks. type Block = Block; /// The type for hashing blocks and tries. @@ -1365,8 +1365,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index c6e969308b..3b8790d019 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -71,7 +71,7 @@ use astar_primitives::{ dapp_staking::{CycleConfiguration, DAppId, EraNumber, PeriodNumber, SmartContract, TierId}, evm::{EvmRevertCodeHandler, HashedDefaultMappings}, xcm::AssetLocationIdConverter, - Address, AssetId, BlockNumber, Hash, Header, Index, + Address, AssetId, BlockNumber, Hash, Header, Nonce, }; pub use astar_primitives::{AccountId, Balance, Signature}; @@ -261,16 +261,14 @@ impl frame_system::Config for Runtime { type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = (AccountIdLookup, UnifiedAccounts); - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + /// The nonce type for storing how many extrinsics an account has signed. + type Nonce = Nonce; + /// The type for blocks. + type Block = Block; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -500,12 +498,16 @@ impl parachain_info::Config for Runtime {} parameter_types! { pub const MaxAuthorities: u32 = 250; + // Should be only enabled (`true`) when async backing is enabled + // otherwise set to `false` + pub const AllowMultipleBlocksPerSlot: bool = false; } impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; + type AllowMultipleBlocksPerSlot = AllowMultipleBlocksPerSlot; } impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -590,7 +592,7 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = frame_system::Pallet; type WeightInfo = weights::pallet_balances::SubstrateWeight; - type HoldIdentifier = (); + type RuntimeHoldReason = RuntimeHoldReason; type FreezeIdentifier = RuntimeFreezeReason; type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<1>; @@ -652,6 +654,9 @@ parameter_types! { pub const DepositPerByte: Balance = contracts_deposit(0, 1); // Fallback value if storage deposit limit not set by the user pub const DefaultDepositLimit: Balance = contracts_deposit(16, 16 * 1024); + // TODO: re-vist to make sure values are appropriate + pub const MaxDelegateDependencies: u32 = 32; + pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30); pub Schedule: pallet_contracts::Schedule = Default::default(); } @@ -685,6 +690,19 @@ impl pallet_contracts::Config for Runtime { type MaxStorageKeyLen = ConstU32<128>; type UnsafeUnstableInterface = ConstBool; type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; + type MaxDelegateDependencies = MaxDelegateDependencies; + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type RuntimeHoldReason = RuntimeHoldReason; + type Debug = (); + type Environment = (); + // TODO: re-vist to make sure migration sequence is correct + type Migrations = ( + pallet_contracts::migration::v11::Migration, + pallet_contracts::migration::v12::Migration, + pallet_contracts::migration::v13::Migration, + pallet_contracts::migration::v14::Migration, + pallet_contracts::migration::v15::Migration, + ); } // These values are based on the Astar 2.0 Tokenomics Modeling report. @@ -1242,10 +1260,7 @@ impl pallet_unified_accounts::Config for Runtime { } construct_runtime!( - pub struct Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic + pub struct Runtime { System: frame_system = 10, Utility: pallet_utility = 11, @@ -1577,8 +1592,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } @@ -2008,9 +2023,9 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, BenchmarkError}; use frame_system_benchmarking::Pallet as SystemBench; - use frame_support::{traits::{WhitelistedStorageKeys, tokens::fungible::{ItemOf}}, assert_ok}; + use frame_support::{traits::{WhitelistedStorageKeys, TrackedStorageKey, tokens::fungible::{ItemOf}}, assert_ok}; use baseline::Pallet as BaselineBench; use xcm::latest::prelude::*; use xcm_builder::MintLocation; @@ -2021,9 +2036,7 @@ impl_runtime_apis! { // XCM Benchmarks impl astar_xcm_benchmarks::Config for Runtime {} impl astar_xcm_benchmarks::generic::Config for Runtime {} - impl astar_xcm_benchmarks::fungible::Config for Runtime { - type TrustedReserve = TrustedReserve; - } + impl astar_xcm_benchmarks::fungible::Config for Runtime {} impl pallet_xcm_benchmarks::Config for Runtime { type XcmConfig = xcm_config::XcmConfig; @@ -2075,6 +2088,9 @@ impl_runtime_apis! { ) -> Result<(MultiLocation, NetworkId, InteriorMultiLocation), BenchmarkError> { Err(BenchmarkError::Skip) } + fn alias_origin() -> Result<(MultiLocation, MultiLocation), BenchmarkError> { + Err(BenchmarkError::Skip) + } } parameter_types! { @@ -2092,6 +2108,7 @@ impl_runtime_apis! { type TransactAsset = ItemOf; type CheckedAccount = NoCheckingAccount; type TrustedTeleporter = NoTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { let min_balance = 100u128; diff --git a/runtime/shibuya/src/xcm_config.rs b/runtime/shibuya/src/xcm_config.rs index 4b91a10878..89ef809a45 100644 --- a/runtime/shibuya/src/xcm_config.rs +++ b/runtime/shibuya/src/xcm_config.rs @@ -28,31 +28,28 @@ use frame_support::{ weights::Weight, }; use frame_system::EnsureRoot; -use sp_runtime::traits::Convert; +use sp_runtime::traits::{Convert, MaybeEquivalence}; // Polkadot imports use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, - EnsureXcmOrigin, FungiblesAdapter, IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, WeightInfoBounds, WithComputedOrigin, -}; -use xcm_executor::{ - traits::{Convert as XcmConvert, JustTry}, - XcmExecutor, + DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FungiblesAdapter, HashedDescription, + IsConcrete, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, + WeightInfoBounds, WithComputedOrigin, }; +use xcm_executor::{traits::JustTry, XcmExecutor}; // ORML imports use orml_xcm_support::DisabledParachainFee; // Astar imports use astar_primitives::xcm::{ - AbsoluteAndRelativeReserveProvider, AccountIdToMultiLocation, DescribeAllTerminal, - DescribeFamily, FixedRateOfForeignAsset, HashedDescription, ReserveAssetFilter, - XcmFungibleFeeHandler, MAX_ASSETS, + AbsoluteAndRelativeReserveProvider, AccountIdToMultiLocation, FixedRateOfForeignAsset, + ReserveAssetFilter, XcmFungibleFeeHandler, MAX_ASSETS, }; parameter_types! { @@ -204,6 +201,7 @@ impl xcm_executor::Config for XcmConfig { type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; type SafeCallFilter = Everything; + type Aliasers = Nothing; } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -293,7 +291,7 @@ parameter_types! { pub struct AssetIdConvert; impl Convert> for AssetIdConvert { fn convert(asset_id: AssetId) -> Option { - ShibuyaAssetLocationIdConverter::reverse_ref(&asset_id).ok() + ShibuyaAssetLocationIdConverter::convert_back(&asset_id) } } diff --git a/runtime/shiden/src/lib.rs b/runtime/shiden/src/lib.rs index 81267a40a4..ab6a7d6863 100644 --- a/runtime/shiden/src/lib.rs +++ b/runtime/shiden/src/lib.rs @@ -68,7 +68,7 @@ use sp_std::prelude::*; pub use crate::precompiles::WhitelistedCalls; pub use astar_primitives::{ evm::EvmRevertCodeHandler, xcm::AssetLocationIdConverter, AccountId, Address, AssetId, Balance, - BlockNumber, Hash, Header, Index, Signature, + BlockNumber, Hash, Header, Nonce, Signature, }; pub use pallet_block_rewards_hybrid::RewardDistributionConfig; use pallet_evm_precompile_assets_erc20::AddressToAssetId; @@ -226,7 +226,7 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; + type Index = Nonce; /// The index type for blocks. type BlockNumber = BlockNumber; /// The type for hashing blocks and tries. @@ -1213,8 +1213,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } }