Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polkadot v1.1.0 #1756

Merged
merged 84 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
fb19264
all dependencies set
lemunozm Mar 1, 2024
21107d8
migrate libs/*
lemunozm Mar 6, 2024
7f16bfd
migrate pallet-anchors
lemunozm Mar 7, 2024
54995e2
migrate pallet-rewards
lemunozm Mar 7, 2024
db1b6d3
migrate pallet-liquidity-rewards
lemunozm Mar 7, 2024
5837309
migrate pallet-fees pallet-bridge
lemunozm Mar 7, 2024
6ac786b
migrate pallet-keystore
lemunozm Mar 7, 2024
12f8f4b
migrate restricted-tokens
lemunozm Mar 11, 2024
102ff72
migrate restricted-xtokens
lemunozm Mar 11, 2024
1926ecd
migrate block-rewards
lemunozm Mar 11, 2024
5ef66c1
migrate-interest-accrual
lemunozm Mar 11, 2024
4400a67
migrate oracle-feed
lemunozm Mar 11, 2024
791f0df
migrate oracle-collection
lemunozm Mar 11, 2024
7587053
migrate collator-allowlist
lemunozm Mar 11, 2024
a9fdc19
migrate transfer-allowlist
lemunozm Mar 12, 2024
c8548cc
migrate crowdloan pallets
lemunozm Mar 12, 2024
7f422be
migrate permissions
lemunozm Mar 12, 2024
4c4d855
migrate order-book
lemunozm Mar 13, 2024
f6e06ec
migrate pallet-swaps
lemunozm Mar 13, 2024
cfa2e8d
migrate pallet-token-mux
lemunozm Mar 13, 2024
1eb9608
migrate investments
lemunozm Mar 13, 2024
be8ead6
migrate foreign-investments
lemunozm Mar 13, 2024
c9c245d
migrate loans
lemunozm Mar 13, 2024
b13a54a
migrate pool-fees
lemunozm Mar 13, 2024
c58d93f
migrate liquidity-pools-gateway
lemunozm Mar 13, 2024
fe1c1c5
migrate axelar-gateway-precompile
lemunozm Mar 13, 2024
bcd02df
migrate liquidity-pools-gateway-routers & patch moonbeam deps
lemunozm Mar 14, 2024
02cc0e5
use precompile-utils from moonbeam from now
lemunozm Mar 14, 2024
624939c
simplify mock initialization
lemunozm Mar 14, 2024
23cba2a
simplify some mocks
lemunozm Mar 14, 2024
f275140
migrate ethereum-transaction
lemunozm Mar 14, 2024
de60ec2
simplify minor stuff
lemunozm Mar 14, 2024
3914c12
disable runtimes by now
lemunozm Mar 14, 2024
70508ba
migrate pool-system
lemunozm Mar 15, 2024
94c1e6f
migrate pool-registry
lemunozm Mar 15, 2024
ae12bce
migrate liquidity-pools
lemunozm Mar 15, 2024
4319b37
polish patch section
lemunozm Mar 18, 2024
acd8e2b
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 18, 2024
975060d
dirty fix for unaccesible Pending storage
lemunozm Mar 18, 2024
b5f03f4
minor dependency update
lemunozm Mar 18, 2024
78a99a0
minor extend comment
lemunozm Mar 18, 2024
6b4e805
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 18, 2024
45d1aa8
migrate runtime-common
lemunozm Mar 19, 2024
ddbe13f
minor fixes
lemunozm Mar 19, 2024
ce5d67e
Revert "dirty fix for unaccesible Pending storage"
lemunozm Mar 19, 2024
101478c
pointing to the updated pallet-ethereum
lemunozm Mar 19, 2024
065f757
fix pool-system compilation with benchmarks
lemunozm Mar 20, 2024
0c4a9c7
fix serde dependencies
lemunozm Mar 20, 2024
97901b8
required changes for runtime to work
lemunozm Mar 21, 2024
f61e302
development runtime failing because of serde
lemunozm Mar 21, 2024
06c28df
patch all required dependencies to make moonbeam works
lemunozm Mar 22, 2024
ff797a6
fix xcm types
lemunozm Mar 22, 2024
884893a
add serde to no_std
lemunozm Mar 22, 2024
7088ef3
minor
lemunozm Mar 22, 2024
70a0ef2
migrate altair & centrifuge
lemunozm Mar 25, 2024
43d2b2b
minor fixes
lemunozm Mar 25, 2024
d9c8aa6
support runtime-benchmarking in runtimes
lemunozm Mar 25, 2024
0463dc9
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Mar 27, 2024
907a6e9
Polkadot v1.1.0: Node required changes (#1789)
lemunozm Apr 2, 2024
fb20056
Polkadot v1.1.0 Integration Tests (#1776)
lemunozm Apr 2, 2024
dea0546
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 2, 2024
2a1b7bc
fixed issues compiling with rust 1.78
lemunozm Apr 3, 2024
d779208
fix clippy
lemunozm Apr 3, 2024
14f705a
taplo
lemunozm Apr 3, 2024
3fae0a8
reading value from deposit_creating
lemunozm Apr 3, 2024
39b3677
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 3, 2024
772ea63
remove locked from taplo-cli
lemunozm Apr 4, 2024
085ef74
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 4, 2024
d6b006d
update scripts
lemunozm Apr 4, 2024
d144594
fix docs
lemunozm Apr 4, 2024
64b6a84
fix integration tests
lemunozm Apr 4, 2024
bafbf71
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 4, 2024
7414cc0
add collator-selection migration
lemunozm Apr 4, 2024
2cfdd69
makes try-runtime idempotent checks work
lemunozm Apr 4, 2024
14cb6c5
revert fixed point serialization, remove unused Location code
lemunozm Apr 5, 2024
6ab12f1
comment TODOs and deprecated until 1.3.0
lemunozm Apr 5, 2024
37afbc2
fix fixed_point serialization for std
lemunozm Apr 5, 2024
9deeab9
correct features for dev dependency
lemunozm Apr 5, 2024
b1b9e65
apply Cosmin NITs
lemunozm Apr 5, 2024
94a6297
remove comments regarding v1.3.0
lemunozm Apr 8, 2024
d4024be
revert benchmarking HostFunction
lemunozm Apr 11, 2024
d4d58e1
Polkadot v1.1.0: Account converter changes (#1806)
lemunozm Apr 11, 2024
83dc357
Merge remote-tracking branch 'origin/main' into polkadot-v1.1.0
lemunozm Apr 12, 2024
399228a
fix: polkadot v1.1.0 client (#1808)
wischli Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,826 changes: 1,714 additions & 5,112 deletions Cargo.lock

Large diffs are not rendered by default.

798 changes: 223 additions & 575 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions libs/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cfg-traits = { workspace = true }
cfg-types = { workspace = true }

orml-traits = { workspace = true }
xcm = { workspace = true }
staging-xcm = { workspace = true }
mustermeiszer marked this conversation as resolved.
Show resolved Hide resolved

mock-builder = { workspace = true }

Expand All @@ -46,7 +46,7 @@ std = [
"sp-io/std",
"sp-runtime/std",
"orml-traits/std",
"xcm/std",
"staging-xcm/std",
"mock-builder/std",
]
runtime-benchmarks = [
Expand Down
42 changes: 23 additions & 19 deletions libs/mocks/src/asset_registry.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
wischli marked this conversation as resolved.
Show resolved Hide resolved
use frame_support::pallet_prelude::*;
use mock_builder::{execute_call, register_call};
use orml_traits::asset_registry::{AssetMetadata, Inspect, Mutate};
use xcm::{v3::prelude::MultiLocation, VersionedMultiLocation};
use sp_std::fmt::Debug;
use staging_xcm::{v3::prelude::MultiLocation, VersionedMultiLocation};

#[pallet::config]
pub trait Config: frame_system::Config {
type AssetId;
type Balance;
type Balance: Clone + Debug + Eq + PartialEq;
type CustomMetadata: Parameter + Member + TypeInfo;
type StringLimit: Get<u32>;
}

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_asset_id(f: impl Fn(&MultiLocation) -> Option<T::AssetId> + 'static) {
register_call!(f);
}

pub fn mock_metadata(
f: impl Fn(&T::AssetId) -> Option<AssetMetadata<T::Balance, T::CustomMetadata>> + 'static,
f: impl Fn(
&T::AssetId,
) -> Option<AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>>
+ 'static,
) {
register_call!(f);
}

pub fn mock_metadata_by_location(
f: impl Fn(&MultiLocation) -> Option<AssetMetadata<T::Balance, T::CustomMetadata>> + 'static,
f: impl Fn(
&MultiLocation,
) -> Option<AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>>
+ 'static,
) {
register_call!(f);
}
Expand All @@ -49,7 +52,7 @@ pub mod pallet {
pub fn mock_register_asset(
f: impl Fn(
Option<T::AssetId>,
AssetMetadata<T::Balance, T::CustomMetadata>,
AssetMetadata<T::Balance, T::CustomMetadata, T::StringLimit>,
) -> DispatchResult
+ 'static,
) {
Expand All @@ -60,8 +63,8 @@ pub mod pallet {
f: impl Fn(
T::AssetId,
Option<u32>,
Option<Vec<u8>>,
Option<Vec<u8>>,
Option<BoundedVec<u8, T::StringLimit>>,
Option<BoundedVec<u8, T::StringLimit>>,
Option<T::Balance>,
Option<Option<VersionedMultiLocation>>,
Option<T::CustomMetadata>,
Expand All @@ -76,20 +79,21 @@ pub mod pallet {
type AssetId = T::AssetId;
type Balance = T::Balance;
type CustomMetadata = T::CustomMetadata;
type StringLimit = T::StringLimit;

fn asset_id(a: &MultiLocation) -> Option<Self::AssetId> {
execute_call!(a)
}

fn metadata(
a: &Self::AssetId,
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata>> {
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
execute_call!(a)
}

fn metadata_by_location(
a: &MultiLocation,
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata>> {
) -> Option<AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>> {
execute_call!(a)
}

Expand All @@ -101,16 +105,16 @@ pub mod pallet {
impl<T: Config> Mutate for Pallet<T> {
fn register_asset(
a: Option<Self::AssetId>,
b: AssetMetadata<Self::Balance, Self::CustomMetadata>,
b: AssetMetadata<Self::Balance, Self::CustomMetadata, Self::StringLimit>,
) -> DispatchResult {
execute_call!((a, b))
}

fn update_asset(
a: Self::AssetId,
b: Option<u32>,
c: Option<Vec<u8>>,
d: Option<Vec<u8>>,
c: Option<BoundedVec<u8, Self::StringLimit>>,
d: Option<BoundedVec<u8, Self::StringLimit>>,
e: Option<Self::Balance>,
g: Option<Option<VersionedMultiLocation>>,
h: Option<Self::CustomMetadata>,
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/change_guard.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::changes::ChangeGuard;
use frame_support::pallet_prelude::*;
Expand All @@ -15,12 +15,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_note(
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/currency_conversion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::IdentityCurrencyConversion;
use frame_support::pallet_prelude::*;
Expand All @@ -14,12 +14,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_stable_to_stable(
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::data::{DataCollection, DataRegistry};
use frame_support::pallet_prelude::*;
Expand All @@ -17,12 +17,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_get(
Expand Down
13 changes: 4 additions & 9 deletions libs/mocks/src/fees.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::fees::{Fee, FeeKey, Fees};
use cfg_traits::fees::{Fee, Fees};
use frame_support::{pallet_prelude::*, traits::tokens::Balance};
use mock_builder::{execute_call, register_call};

#[pallet::config]
pub trait Config: frame_system::Config {
type Balance: Balance;
type FeeKey: FeeKey;
type FeeKey;
}

#[pallet::pallet]
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_fee_value(f: impl Fn(T::FeeKey) -> T::Balance + 'static) {
Expand Down
9 changes: 2 additions & 7 deletions libs/mocks/src/investment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::investments::{Investment, InvestmentCollector};
use frame_support::pallet_prelude::*;
Expand All @@ -16,12 +16,7 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_update_investment(
Expand Down
94 changes: 42 additions & 52 deletions libs/mocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,61 +55,51 @@ pub mod reexport {
#[macro_export]
macro_rules! make_runtime_for_mock {
($runtime_name:ident, $mock_name:ident, $pallet:ident, $externalities:ident) => {
use $crate::reexport::frame_support::traits::{ConstU16, ConstU32, ConstU64, Everything};
use $crate::reexport::sp_core::H256;
use $crate::reexport::sp_runtime::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
};
use $crate::reexport::frame_system;
use $crate::reexport::{
frame_support,
frame_support::traits::{ConstU16, ConstU32, ConstU64, Everything},
frame_system,
sp_core::H256,
sp_io,
sp_runtime::traits::{BlakeTwo256, IdentityLookup},
};

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;
frame_support::construct_runtime!(
pub enum $runtime_name {
System: frame_system,
$mock_name: $pallet,
}
);

$crate::reexport::frame_support::construct_runtime!(
pub enum $runtime_name where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system,
$mock_name: $pallet,
}
);
impl frame_system::Config for Runtime {
type AccountData = ();
type AccountId = u64;
type BaseCallFilter = Everything;
type Block = frame_system::mocking::MockBlock<Runtime>;
type BlockHashCount = ConstU64<250>;
type BlockLength = ();
type BlockWeights = ();
type DbWeight = ();
type Hash = H256;
type Hashing = BlakeTwo256;
type Lookup = IdentityLookup<Self::AccountId>;
type MaxConsumers = ConstU32<16>;
type Nonce = u64;
type OnKilledAccount = ();
type OnNewAccount = ();
type OnSetCode = ();
type PalletInfo = PalletInfo;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
type SS58Prefix = ConstU16<42>;
type SystemWeightInfo = ();
type Version = ();
}

impl frame_system::Config for Runtime {
type AccountData = ();
type AccountId = u64;
type BaseCallFilter = Everything;
type BlockHashCount = ConstU64<250>;
type BlockLength = ();
type BlockNumber = u64;
type BlockWeights = ();
type DbWeight = ();
type Hash = H256;
type Hashing = BlakeTwo256;
type Header = Header;
type Index = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type MaxConsumers = ConstU32<16>;
type OnKilledAccount = ();
type OnNewAccount = ();
type OnSetCode = ();
type PalletInfo = PalletInfo;
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
type SS58Prefix = ConstU16<42>;
type SystemWeightInfo = ();
type Version = ();
}

pub fn $externalities() -> $crate::reexport::sp_io::TestExternalities {
frame_system::GenesisConfig::default()
.build_storage::<Runtime>()
.unwrap()
.into()
}
pub fn $externalities() -> sp_io::TestExternalities {
sp_io::TestExternalities::default()
}
};
}

Expand Down
12 changes: 3 additions & 9 deletions libs/mocks/src/liquidity_pools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ impl Codec for MessageMock {
}
}

#[frame_support::pallet]
#[frame_support::pallet(dev_mode)]
pub mod pallet {
use cfg_traits::liquidity_pools::InboundQueue;
use cfg_types::domain_address::DomainAddress;
use frame_support::pallet_prelude::*;
use mock_builder::{execute_call, register_call};

Expand All @@ -52,15 +51,10 @@ pub mod pallet {
pub struct Pallet<T>(_);

#[pallet::storage]
pub(super) type CallIds<T: Config> = StorageMap<
_,
Blake2_128Concat,
<Blake2_128 as frame_support::StorageHasher>::Output,
mock_builder::CallId,
>;
type CallIds<T: Config> = StorageMap<_, _, String, mock_builder::CallId>;

impl<T: Config> Pallet<T> {
pub fn mock_submit(f: impl Fn(DomainAddress, MessageMock) -> DispatchResult + 'static) {
pub fn mock_submit(f: impl Fn(T::DomainAddress, MessageMock) -> DispatchResult + 'static) {
register_call!(move |(sender, msg)| f(sender, msg));
}
}
Expand Down
Loading
Loading