From cdc269b6a293c93b8266d4d52d1a282b429bcfde Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Thu, 12 Dec 2024 12:25:06 +0100 Subject: [PATCH 1/8] add xcm topic id wrappers to router and barrier --- runtime/hydradx/src/xcm.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index 271daa1d86..e0f7704979 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -29,7 +29,7 @@ use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FixedWeightBounds, HashedDescription, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic }; use xcm_executor::{Config, XcmExecutor}; @@ -59,7 +59,7 @@ impl TryFrom for AssetLocation { pub type LocalOriginToLocation = SignedToAccountId32; -pub type Barrier = ( +pub type Barrier = TrailingSetTopicAsId<( TakeWeightCredit, // Expected responses are OK. AllowKnownQueryResponses, @@ -73,7 +73,7 @@ pub type Barrier = ( UniversalLocation, ConstU32<8>, >, -); +)>; parameter_types! { pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; @@ -398,12 +398,12 @@ impl Convert for AccountIdToMultiLocation { /// The means for routing XCM messages which are not for local execution into the right message /// queues. -pub type XcmRouter = ( +pub type XcmRouter = WithUniqueTopic<( // Two routers - use UMP to communicate with the relay chain: cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM From bfee2e60acc6670d5151d395c50ab159f1d396bf Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Thu, 2 Jan 2025 17:57:36 +0100 Subject: [PATCH 2/8] fix tests --- integration-tests/src/cross_chain_transfer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/src/cross_chain_transfer.rs b/integration-tests/src/cross_chain_transfer.rs index 4a168f6962..4bc0012d25 100644 --- a/integration-tests/src/cross_chain_transfer.rs +++ b/integration-tests/src/cross_chain_transfer.rs @@ -110,7 +110,7 @@ fn rococo_should_receive_asset_when_sent_from_hydra() { Rococo::execute_with(|| { assert_eq!( hydradx_runtime::Balances::free_balance(AccountId::from(BOB)), - 2_999_989_698_923 // 3 * HDX - fee + 2_999_989_606_492 // 3 * HDX - fee ); }); } From 3ca36cbc33ea5b5c2d75d6fec441fff4f8be1799 Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Fri, 3 Jan 2025 18:11:05 +0100 Subject: [PATCH 3/8] fix formatting and bump versions --- integration-tests/Cargo.toml | 2 +- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/xcm.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index aebb4d1f77..003cefd65a 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.26.0" +version = "1.26.1" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 98c887f7f3..676e225e70 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "277.0.0" +version = "277.0.1" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index f0c37d9c2f..b5bdee2bc9 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -32,7 +32,8 @@ use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FixedWeightBounds, HashedDescription, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, WithComputedOrigin, + WithUniqueTopic, }; use xcm_executor::{Config, XcmExecutor}; From 6232e7b63cb72f379d756a717ad338f74d0e7fa6 Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Thu, 9 Jan 2025 15:23:54 +0100 Subject: [PATCH 4/8] bump versions after merge from master --- integration-tests/Cargo.toml | 2 +- runtime/hydradx/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 0486ef9877..0e62b47ed8 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.27.0" +version = "1.27.1" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 91b0ade81f..6d4113d078 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "278.0.0" +version = "278.0.1" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" From 1e335fd67b4bcec208dcb32dffaf524feef09b0a Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Fri, 10 Jan 2025 11:24:26 +0100 Subject: [PATCH 5/8] update Cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8627bb70a..9dce75cfe9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "278.0.0" +version = "278.0.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -12244,7 +12244,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.27.0" +version = "1.27.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", From ee76db22934c1da0da04610ed85df3330ca5487d Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Mon, 13 Jan 2025 11:17:00 +0100 Subject: [PATCH 6/8] bump version --- runtime/hydradx/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 627ee0a8fc..80e33560ed 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "279.0.0" +version = "279.0.1" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" From e788772d438811630d4e6939e8c0b5b63bc1ab4f Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Tue, 14 Jan 2025 09:00:18 +0100 Subject: [PATCH 7/8] bump versions --- integration-tests/Cargo.toml | 2 +- runtime/hydradx/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 6616b8ae92..b85f350b12 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.29.0" +version = "1.29.1" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index a337b772ec..137f1e3326 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "280.0.0" +version = "280.0.1" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" From 9fbfac0b2e74aa32f3911a44775e4d37a00bbac8 Mon Sep 17 00:00:00 2001 From: Xueying Wang Date: Tue, 14 Jan 2025 18:48:29 +0100 Subject: [PATCH 8/8] update Cargo.lock --- Cargo.lock | 4 ++-- pallets/omnipool/proptest-regressions/tests/invariants.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6727e57a9a..bb51f82597 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4919,7 +4919,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "281.0.0" +version = "281.0.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -12281,7 +12281,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.30.0" +version = "1.30.1" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/pallets/omnipool/proptest-regressions/tests/invariants.txt b/pallets/omnipool/proptest-regressions/tests/invariants.txt index 4335bc4ced..43ee8bbe4a 100644 --- a/pallets/omnipool/proptest-regressions/tests/invariants.txt +++ b/pallets/omnipool/proptest-regressions/tests/invariants.txt @@ -8,4 +8,4 @@ cc 2d65c1f11dd2874cf4869c6bc28ed925478e57ed73a617b1d5dc1a8fe7d7ae59 # shrinks to cc 5b0408b0d514dc33832f2a374aa9e3c479d0c84e58f4b88077c24387c4c8ef70 # shrinks to amount = 1000, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000597801771, price: FixedU128(1.458237645282841600) }, asset_fee = 0.28%, protocol_fee = 0.11%, buy_amount = 3276492019627632 cc 47648d8c0c8f9c6b40fe9eefa80179540c1d386175531a36c3a825777402ce83 # shrinks to amount = 1000, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000000467280, price: FixedU128(0.943083786844469504) }, asset_fee = 0.17%, protocol_fee = 0.025%, buy_amount = 3545063556811621, min_withdraw_fee = 100%, (price_adjustment, denom, direction) = (4, 10000, false) cc f1f5ebb8a88a3db4df5dcf4170496ef8dffffbb61bb6991226a597f95ae22ca5 # shrinks to amount = 1000, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000068367115, price: FixedU128(0.481724750982654144) }, asset_fee = 0.29%, protocol_fee = 0.03%, buy_amount = 986312481009315 -cc 2591d2b97991eebcad60c25b3d7ef318ad8651bf0e1f6f064eccee110d645305 # shrinks to amount = 1000, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000001763682, price: FixedU128(0.513377270830019968) } \ No newline at end of file +cc 2591d2b97991eebcad60c25b3d7ef318ad8651bf0e1f6f064eccee110d645305 # shrinks to amount = 1000, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000001763682, price: FixedU128(0.513377270830019968) }cc eb4c006bd20eddbd2526dc66a4ed1026239b2d96f60cf6e179e8d76c43bb3a46 # shrinks to amount = 2010613910957024, stable_price = FixedU128(0.100000000000000000), stable_reserve = 100000000000000000, native_reserve = 100000000000000000, token_1 = PoolToken { asset_id: 100, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_2 = PoolToken { asset_id: 200, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_3 = PoolToken { asset_id: 300, amount: 100000000000000000, price: FixedU128(0.100000000000000000) }, token_4 = PoolToken { asset_id: 400, amount: 100000000003365343, price: FixedU128(1.349563030768295424) }, asset_fee = 0.009%, protocol_fee = 2.6%