From 190b784d679f4ac3edbb78c77e4f18a1faf50591 Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Wed, 4 Jan 2023 17:39:54 +0100 Subject: [PATCH 1/6] use latest warehouse --- Cargo.lock | 103 +++++++++------ integration-tests/Cargo.toml | 16 +-- .../parachain-runtime-mock/Cargo.toml | 16 +-- integration-tests/src/nft.rs | 50 ++----- pallets/duster/Cargo.toml | 6 +- pallets/lbp/Cargo.toml | 6 +- pallets/marketplace/Cargo.toml | 4 +- pallets/xyk-liquidity-mining/Cargo.toml | 8 +- .../benchmarking/Cargo.toml | 8 +- .../benchmarking/src/lib.rs | 4 +- .../benchmarking/src/mock.rs | 4 +- pallets/xyk-liquidity-mining/src/lib.rs | 47 +++---- .../xyk-liquidity-mining/src/tests/mock.rs | 123 ++++++++++-------- .../src/tests/withdraw_shares.rs | 85 ++++++++++++ pallets/xyk/Cargo.toml | 5 +- pallets/xyk/src/lib.rs | 2 +- primitives/Cargo.toml | 4 +- primitives/src/lib.rs | 7 +- runtime/basilisk/Cargo.toml | 20 +-- runtime/basilisk/src/lib.rs | 3 +- runtime/common/Cargo.toml | 14 +- runtime/common/src/lib.rs | 9 ++ runtime/testing-basilisk/Cargo.toml | 20 +-- runtime/testing-basilisk/src/lib.rs | 3 +- rust-toolchain | 2 +- 25 files changed, 334 insertions(+), 235 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37ec7953f97..25e27ce1c59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -516,7 +516,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "hydradx-adapters", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-benchmarking", "orml-tokens", "orml-traits", @@ -543,7 +543,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -1208,7 +1208,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-tokens", "orml-traits", "orml-vesting", @@ -3436,13 +3436,26 @@ dependencies = [ "sp-std", ] +[[package]] +name = "hydra-dx-math" +version = "5.0.0" +source = "git+https://github.com/galacticcouncil/HydraDX-math?rev=1b678b779fc9291aea4673b7865651ab091d44b3#1b678b779fc9291aea4673b7865651ab091d44b3" +dependencies = [ + "fixed", + "num-traits", + "parity-scale-codec", + "primitive-types 0.12.1", + "sp-arithmetic", + "sp-std", +] + [[package]] name = "hydradx-adapters" version = "0.2.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-support", - "hydradx-traits", + "hydradx-traits 1.0.0", "log", "pallet-transaction-multi-payment", "parity-scale-codec", @@ -3467,6 +3480,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "hydradx-traits" +version = "1.0.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-std", +] + [[package]] name = "hyper" version = "0.14.23" @@ -5524,7 +5551,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 0.9.1", "orml-traits", "parity-scale-codec", "primitive-types 0.12.1", @@ -5760,7 +5787,7 @@ dependencies = [ [[package]] name = "pallet-currencies" version = "1.0.1" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-support", "frame-system", @@ -5798,7 +5825,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", - "hydradx-traits", + "hydradx-traits 1.0.0", "lazy_static", "orml-tokens", "orml-traits", @@ -5968,8 +5995,8 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", - "hydra-dx-math", - "hydradx-traits", + "hydra-dx-math 4.9.0", + "hydradx-traits 1.0.0", "orml-tokens", "orml-traits", "parity-scale-codec", @@ -5987,13 +6014,14 @@ dependencies = [ [[package]] name = "pallet-liquidity-mining" -version = "1.2.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +version = "2.0.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-support", "frame-system", - "hydra-dx-math", - "hydradx-traits", + "hydra-dx-math 5.0.0", + "hydradx-traits 0.9.1", + "hydradx-traits 1.0.0", "orml-traits", "parity-scale-codec", "scale-info", @@ -6092,13 +6120,13 @@ dependencies = [ [[package]] name = "pallet-nft" -version = "6.0.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +version = "7.0.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-utilities", "pallet-uniques", "parity-scale-codec", @@ -6215,12 +6243,12 @@ dependencies = [ [[package]] name = "pallet-price-oracle" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "parity-scale-codec", "scale-info", "serde", @@ -6276,7 +6304,7 @@ dependencies = [ [[package]] name = "pallet-relaychain-info" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -6291,11 +6319,11 @@ dependencies = [ [[package]] name = "pallet-route-executor" version = "1.0.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-traits", "parity-scale-codec", "scale-info", @@ -6467,12 +6495,12 @@ dependencies = [ [[package]] name = "pallet-transaction-multi-payment" -version = "8.0.3" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +version = "8.0.4" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-traits", "pallet-transaction-payment", "parity-scale-codec", @@ -6486,7 +6514,7 @@ dependencies = [ [[package]] name = "pallet-transaction-pause" version = "0.1.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-benchmarking", "frame-support", @@ -6645,8 +6673,9 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", - "hydra-dx-math", - "hydradx-traits", + "hydra-dx-math 4.9.0", + "hydradx-traits 0.9.1", + "hydradx-traits 1.0.0", "log", "orml-tokens", "orml-traits", @@ -6672,7 +6701,7 @@ version = "1.0.6" dependencies = [ "frame-support", "frame-system", - "hydradx-traits", + "hydradx-traits 1.0.0", "lazy_static", "log", "orml-currencies", @@ -6700,7 +6729,7 @@ dependencies = [ "frame-support", "frame-system", "frame-system-benchmarking", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-currencies", "orml-tokens", "orml-traits", @@ -6757,7 +6786,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "hex-literal", "hydradx-adapters", - "hydradx-traits", + "hydradx-traits 1.0.0", "kusama-runtime", "orml-tokens", "orml-traits", @@ -9023,7 +9052,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", - "hydradx-traits", + "hydradx-traits 1.0.0", "kusama-runtime", "orml-tokens", "orml-traits", @@ -9045,7 +9074,7 @@ dependencies = [ "pallet-marketplace", "pallet-nft", "pallet-price-oracle", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -11708,8 +11737,8 @@ dependencies = [ [[package]] name = "test-utils" -version = "1.0.1" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +version = "1.1.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" dependencies = [ "frame-system", "pretty_assertions", @@ -11738,7 +11767,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "hydradx-adapters", - "hydradx-traits", + "hydradx-traits 1.0.0", "orml-tokens", "orml-traits", "orml-unknown-tokens", @@ -11764,7 +11793,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", "pallet-route-executor", "pallet-scheduler", "pallet-session", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 74740409f4b..6d2a192ad29 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "0.8.4" +version = "0.8.5" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" @@ -10,13 +10,13 @@ repository = "https://github.com/galacticcouncil/Basilisk-node" [dependencies] # Warehouse dependencies -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-xyk = { path = "../pallets/xyk",default-features = false} pallet-duster= { path = "../pallets/duster",default-features = false} @@ -107,7 +107,7 @@ parachain-runtime-mock = { path = "parachain-runtime-mock", default-features = f [dev-dependencies] xcm-emulator = { git = "https://github.com/shaunxw/xcm-simulator", rev = "0460d04c798028e7bef82c907082e11753ed173b" } hex-literal = "0.3.1" -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af" } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89" } pretty_assertions = "1.2.1" sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } test-case = "2.2.1" diff --git a/integration-tests/parachain-runtime-mock/Cargo.toml b/integration-tests/parachain-runtime-mock/Cargo.toml index 4e3a91aa948..7b9deed65e0 100644 --- a/integration-tests/parachain-runtime-mock/Cargo.toml +++ b/integration-tests/parachain-runtime-mock/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "parachain-runtime-mock" -version = "0.1.4" +version = "0.1.5" description = "A mock runtime for a parachain" authors = ["GalacticCouncil"] edition = "2021" @@ -14,14 +14,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.1", default-features = false, features = ["derive"] } # Warehouse dependencies -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-xyk = { path = "../../pallets/xyk",default-features = false} pallet-duster= { path = "../../pallets/duster",default-features = false} diff --git a/integration-tests/src/nft.rs b/integration-tests/src/nft.rs index e9ae8de8fe0..532d37f2aaa 100644 --- a/integration-tests/src/nft.rs +++ b/integration-tests/src/nft.rs @@ -2,12 +2,12 @@ use crate::kusama_test_net::*; use basilisk_runtime::NFT; +use frame_support::assert_ok; use frame_support::traits::tokens::nonfungibles::*; use frame_support::traits::ReservableCurrency; -use frame_support::{assert_noop, assert_ok}; use hydradx_traits::nft::CreateTypedCollection; -use pallet_nft::CollectionType; use pallet_nft::NftPermission; +use pallet_nft::{BoundedVecOfUnq, CollectionType}; use primitives::{CollectionId, ItemId}; use test_case::test_case; use xcm_emulator::TestExt; @@ -15,7 +15,6 @@ use xcm_emulator::TestExt; const ALLOW: bool = true; const NOT_ALLOW: bool = false; const RESERVED_COLLECTION_ID: CollectionId = 0; -const NON_RESERVED_COLLECTION_ID: CollectionId = 1_000_000; const RESTRICTED_COLLECTION_TYPE: CollectionType = CollectionType::HydraHeads; fn create_nft_collection(account_id: AccountId, collection_id: CollectionId, collection_type: CollectionType) { @@ -24,7 +23,10 @@ fn create_nft_collection(account_id: AccountId, collection_id: CollectionId, col AccountId, CollectionId, CollectionType, - >>::create_typed_collection(account_id, collection_id, collection_type,)); + BoundedVecOfUnq, + >>::create_typed_collection( + account_id, collection_id, collection_type, None + )); }); } @@ -126,10 +128,12 @@ fn deposit_for_create_typed_collection_should_be_zero(collection_type: Collectio AccountId, CollectionId, CollectionType, + BoundedVecOfUnq, >>::create_typed_collection( AccountId::from(ALICE), RESERVED_COLLECTION_ID, collection_type, + None, )); assert_eq!( @@ -139,42 +143,6 @@ fn deposit_for_create_typed_collection_should_be_zero(collection_type: Collectio }); } -#[test] -fn deposit_for_create_collection_should_be_zero() { - // Arrange - TestNet::reset(); - Basilisk::execute_with(|| { - // Act & Assert - assert_ok!(>::create_collection( - &NON_RESERVED_COLLECTION_ID, - &AccountId::from(ALICE), - &AccountId::from(ALICE), - )); - - assert_eq!( - ::Currency::reserved_balance(&AccountId::from(ALICE)), - 0 - ); - }); -} - -#[test] -fn create_collection_should_fail_when_collection_id_is_reserved() { - // Arrange - TestNet::reset(); - Basilisk::execute_with(|| { - // Act & Assert - assert_noop!( - >::create_collection( - &RESERVED_COLLECTION_ID, - &AccountId::from(ALICE), - &AccountId::from(ALICE), - ), - pallet_nft::Error::::IdReserved - ); - }); -} - #[test] fn destroy_collection_should_ignore_permissions() { // Arrange @@ -270,10 +238,12 @@ fn create_typed_collection_should_ignore_permissions_and_reserved_ids(collection AccountId, CollectionId, CollectionType, + BoundedVecOfUnq, >>::create_typed_collection( AccountId::from(ALICE), RESERVED_COLLECTION_ID, collection_type, + None, )); }); } diff --git a/pallets/duster/Cargo.toml b/pallets/duster/Cargo.toml index db6f244640d..1d7a686ad15 100644 --- a/pallets/duster/Cargo.toml +++ b/pallets/duster/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-duster" -version = "3.1.8" +version = "3.1.9" description = "Account duster" authors = ["GalacticCouncil"] edition = "2021" @@ -19,7 +19,7 @@ codec = { default-features = false, features = ["derive"], package = "parity-sca scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { features = ["derive"], optional = true, version = "1.0.136" } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # ORML dependencies orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } @@ -40,7 +40,7 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0 sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } [features] diff --git a/pallets/lbp/Cargo.toml b/pallets/lbp/Cargo.toml index 206f9aef6cb..705adbffab1 100644 --- a/pallets/lbp/Cargo.toml +++ b/pallets/lbp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-lbp" -version = "4.6.3" +version = "4.6.4" description = "HydraDX Liquidity Bootstrapping Pool Pallet" authors = ["GalacticCouncil"] edition = "2021" @@ -22,7 +22,7 @@ serde = { features = ["derive"], optional = true, version = "1.0.136" } # Warehouse dependencies hydra-dx-math = { git = "https://github.com/galacticcouncil/HydraDX-math", rev = "7b95ae58e6a8a24c56da3511cef24d8c394801bf", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } ## Local dependencies primitives = { default-features = false, path = "../../primitives" } @@ -44,7 +44,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -test-utils = {git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} +test-utils = {git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} [features] default = ["std"] diff --git a/pallets/marketplace/Cargo.toml b/pallets/marketplace/Cargo.toml index ab322088f16..01cdbd1ca55 100644 --- a/pallets/marketplace/Cargo.toml +++ b/pallets/marketplace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-marketplace" -version = "5.0.5" +version = "5.0.6" authors = ["GalacticCoucil"] description = "The marketplace for trading NFTs" edition = "2018" @@ -26,7 +26,7 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0 pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependency -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # local dependency primitives = { default-features = false, path = "../../primitives" } diff --git a/pallets/xyk-liquidity-mining/Cargo.toml b/pallets/xyk-liquidity-mining/Cargo.toml index aad83193b50..69f9b2d7b2d 100644 --- a/pallets/xyk-liquidity-mining/Cargo.toml +++ b/pallets/xyk-liquidity-mining/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-xyk-liquidity-mining" -version = "1.0.6" +version = "1.1.0" description = "Liquidity mining" authors = ["GalacticCouncil"] edition = "2021" @@ -21,9 +21,9 @@ log = { version = "0.4.17", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } primitives = { path = "../../primitives", default-features = false } diff --git a/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml b/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml index 700c924a606..ce7e0df1cf0 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml +++ b/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-xyk-liquidity-mining-benchmarking" -version = "1.0.4" +version = "1.0.5" description = "Liquidity Mining Benchmarking Module" authors = ["GalacticCouncil"] edition = "2021" @@ -26,10 +26,10 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs b/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs index b69d0b2d171..cec7daeadff 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs +++ b/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs @@ -113,7 +113,7 @@ fn lm_create_global_farm( BSX, owner, yield_per_period, - 1, + 1_000, One::one(), ) } @@ -156,7 +156,7 @@ benchmarks! { let yield_per_period = Perquintill::from_percent(20); let blocks_per_period = T::BlockNumber::from(1_u32); }: { - XYKLiquidityMining::::create_global_farm(RawOrigin::Root.into(), total_rewards, planned_yielding_periods, blocks_per_period, BSX, BSX, caller.clone(), yield_per_period, 1, One::one())? + XYKLiquidityMining::::create_global_farm(RawOrigin::Root.into(), total_rewards, planned_yielding_periods, blocks_per_period, BSX, BSX, caller.clone(), yield_per_period, 1_000, One::one())? } update_global_farm { diff --git a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs index 3eca12df3a1..2973c006047 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs +++ b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs @@ -128,7 +128,6 @@ impl crate::Config for Test {} parameter_types! { pub const WarehouseLMPalletId: PalletId = PalletId(*b"WhouseLm"); - pub const MinDeposit: Balance = 1; pub const MaxEntriesPerDeposit: u8 = 5; pub const MaxYieldFarmsPerGlobalFarm: u8 = 5; pub const MinPlannedYieldingPeriods: BlockNumber = 100; @@ -222,7 +221,6 @@ parameter_types! { pub const UniquesMetadataDepositBase: Balance = 100 * UNITS; pub const AttributeDepositBase: Balance = 10 * UNITS; pub const DepositPerByte: Balance = UNITS; - pub const UniquesStringLimit: u32 = 60; } impl pallet_uniques::Config for Test { @@ -236,7 +234,7 @@ impl pallet_uniques::Config for Test { type MetadataDepositBase = UniquesMetadataDepositBase; type AttributeDepositBase = AttributeDepositBase; type DepositPerByte = DepositPerByte; - type StringLimit = UniquesStringLimit; + type StringLimit = primitives::UniquesStringLimit; type KeyLimit = KeyLimit; type ValueLimit = ValueLimit; type CreateOrigin = AsEnsureOriginWithArg>; diff --git a/pallets/xyk-liquidity-mining/src/lib.rs b/pallets/xyk-liquidity-mining/src/lib.rs index ee174cf8168..449c80debc5 100644 --- a/pallets/xyk-liquidity-mining/src/lib.rs +++ b/pallets/xyk-liquidity-mining/src/lib.rs @@ -44,7 +44,7 @@ pub mod weights; pub use pallet::*; -use frame_support::traits::tokens::nonfungibles::{Create, Inspect, Mutate}; +use frame_support::traits::tokens::nonfungibles::{Inspect, Mutate}; use frame_support::{ ensure, sp_runtime::traits::{BlockNumberProvider, Zero}, @@ -110,6 +110,7 @@ pub mod pallet { pallet_account, T::NftCollectionId::get(), CollectionType::LiquidityMining, + None, ) .unwrap(); } @@ -141,10 +142,13 @@ pub mod pallet { /// Non fungible handling type NFTHandler: Mutate - + Create + Inspect - + CreateTypedCollection - + ReserveCollectionId; + + CreateTypedCollection< + Self::AccountId, + primitives::CollectionId, + CollectionType, + BoundedVec, + > + ReserveCollectionId; /// Liquidity mining handler for managing liquidity mining functionalities type LiquidityMiningHandler: LiquidityMiningMutate< @@ -355,7 +359,7 @@ pub mod pallet { min_deposit: Balance, price_adjustment: FixedU128, ) -> DispatchResult { - T::CreateOrigin::ensure_origin(origin)?; + ::CreateOrigin::ensure_origin(origin)?; let (id, max_reward_per_period) = T::LiquidityMiningHandler::create_global_farm( total_rewards, @@ -777,13 +781,8 @@ pub mod pallet { ) -> DispatchResult { let owner = Self::ensure_nft_owner(origin, deposit_id)?; - let fail_on_double_claim = true; - let (global_farm_id, reward_currency, claimed, _) = T::LiquidityMiningHandler::claim_rewards( - owner.clone(), - deposit_id, - yield_farm_id, - fail_on_double_claim, - )?; + let (global_farm_id, reward_currency, claimed, _) = + T::LiquidityMiningHandler::claim_rewards(owner.clone(), deposit_id, yield_farm_id)?; ensure!(!claimed.is_zero(), Error::::ZeroClaimedRewards); @@ -834,20 +833,15 @@ pub mod pallet { let global_farm_id = T::LiquidityMiningHandler::get_global_farm_id(deposit_id, yield_farm_id) .ok_or(Error::::DepositDataNotFound)?; - let unclaimable_rewards = if T::LiquidityMiningHandler::is_yield_farm_claimable( + let (withdrawn_amount, claim_data, is_destroyed) = T::LiquidityMiningHandler::withdraw_lp_shares( + owner.clone(), + deposit_id, global_farm_id, yield_farm_id, amm_pool_id.clone(), - ) { - //This should not fail on double claim, we need unclaimable_rewards - let fail_on_double_claim = false; - let (global_farm_id, reward_currency, claimed, unclaimable) = T::LiquidityMiningHandler::claim_rewards( - owner.clone(), - deposit_id, - yield_farm_id, - fail_on_double_claim, - )?; + )?; + if let Some((reward_currency, claimed, _)) = claim_data { if !claimed.is_zero() { Self::deposit_event(Event::RewardClaimed { global_farm_id, @@ -858,14 +852,7 @@ pub mod pallet { deposit_id, }); } - - unclaimable - } else { - 0 - }; - - let (global_farm_id, withdrawn_amount, is_destroyed) = - T::LiquidityMiningHandler::withdraw_lp_shares(deposit_id, yield_farm_id, unclaimable_rewards)?; + } let lp_token = Self::get_lp_token(&amm_pool_id)?; if !withdrawn_amount.is_zero() { diff --git a/pallets/xyk-liquidity-mining/src/tests/mock.rs b/pallets/xyk-liquidity-mining/src/tests/mock.rs index c2ee6dbdd96..c3f1e2cfd51 100644 --- a/pallets/xyk-liquidity-mining/src/tests/mock.rs +++ b/pallets/xyk-liquidity-mining/src/tests/mock.rs @@ -363,15 +363,6 @@ impl> Inspect for DummyNFT { } } -impl + Into + Copy> Create for DummyNFT { - fn create_collection(collection: &Self::CollectionId, who: &AccountId, admin: &AccountId) -> DispatchResult { - NFT_COLLECTION.with(|v| { - v.replace((*collection, (*who).into(), (*admin).into())); - }); - Ok(()) - } -} - impl + Into + Copy> Mutate for DummyNFT { fn mint_into(_collection: &Self::CollectionId, item: &Self::ItemId, who: &AccountId) -> DispatchResult { NFTS.with(|v| { @@ -394,11 +385,19 @@ impl + Into + Copy> Mutate for DummyNFT { } } -impl CreateTypedCollection for DummyNFT { +impl + CreateTypedCollection< + AccountId, + primitives::CollectionId, + CollectionType, + BoundedVec, + > for DummyNFT +{ fn create_typed_collection( owner: AccountId, collection_id: primitives::CollectionId, _collection_type: CollectionType, + _metadata: Option>, ) -> DispatchResult { NFT_COLLECTION.with(|v| { v.replace((collection_id, owner, owner)); @@ -415,7 +414,50 @@ impl ReserveCollectionId for DummyNFT { pub struct DummyLiquidityMining {} -impl DummyLiquidityMining {} +impl DummyLiquidityMining { + fn claim_rewards( + who: AccountId, + deposit_id: u128, + yield_farm_id: u32, + fail_on_double_claim: bool, + ) -> Result<(u32, AssetId, Balance, Balance), DispatchError> { + DEPOSIT_ENTRIES.with(|v| { + let mut p = v.borrow_mut(); + let yield_farm_entry = p.get_mut(&(deposit_id, yield_farm_id)).unwrap(); + + if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() && fail_on_double_claim { + return Err("Dummy Double Claim".into()); + } + + let reward_currency = GLOBAL_FARMS.with(|v| { + v.borrow() + .get(&yield_farm_entry.global_farm_id) + .unwrap() + .reward_currency + }); + + let mut claimed = 20_000_000 * ONE; + let mut unclaimable = 10_000 * ONE; + if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() { + claimed = 0; + unclaimable = 200_000 * ONE; + } + + if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() { + claimed = 0; + } + + yield_farm_entry.last_claimed = MockBlockNumberProvider::get(); + + if who == ZERO_REWARDS_USER { + claimed = 0; + unclaimable = 0; + } + + Ok((yield_farm_entry.global_farm_id, reward_currency, claimed, unclaimable)) + }) + } +} impl hydradx_traits::liquidity_mining::Mutate for DummyLiquidityMining { type Error = DispatchError; @@ -657,50 +699,29 @@ impl hydradx_traits::liquidity_mining::Mutate f who: AccountId, deposit_id: u128, yield_farm_id: u32, - fail_on_doubleclaim: bool, ) -> Result<(u32, AssetId, Self::Balance, Self::Balance), Self::Error> { - DEPOSIT_ENTRIES.with(|v| { - let mut p = v.borrow_mut(); - let yield_farm_entry = p.get_mut(&(deposit_id, yield_farm_id)).unwrap(); - - if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() && fail_on_doubleclaim { - return Err("Dummy Double Claim".into()); - } - - let reward_currency = GLOBAL_FARMS.with(|v| { - v.borrow() - .get(&yield_farm_entry.global_farm_id) - .unwrap() - .reward_currency - }); - - let mut claimed = 20_000_000 * ONE; - let mut unclaimable = 10_000 * ONE; - if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() { - claimed = 0; - unclaimable = 200_000 * ONE; - } + let fail_on_double_claim = true; - if yield_farm_entry.last_claimed == MockBlockNumberProvider::get() { - claimed = 0; - } - - yield_farm_entry.last_claimed = MockBlockNumberProvider::get(); - - if who == ZERO_REWARDS_USER { - claimed = 0; - unclaimable = 0; - } - - Ok((yield_farm_entry.global_farm_id, reward_currency, claimed, unclaimable)) - }) + Self::claim_rewards(who, deposit_id, yield_farm_id, fail_on_double_claim) } fn withdraw_lp_shares( + who: AccountId, deposit_id: u128, + global_farm_id: u32, yield_farm_id: u32, - _unclaimable_rewards: Self::Balance, - ) -> Result<(u32, Self::Balance, bool), Self::Error> { + amm_pool_id: Self::AmmPoolId, + ) -> Result<(Self::Balance, Option<(AssetId, Self::Balance, Self::Balance)>, bool), Self::Error> { + let claim_data = if Self::is_yield_farm_claimable(global_farm_id, yield_farm_id, amm_pool_id) { + let fail_on_double_claim = false; + let (_, reward_currency, claimed_amount, unclaimable_amount) = + Self::claim_rewards(who, deposit_id, yield_farm_id, fail_on_double_claim)?; + + Some((reward_currency, claimed_amount, unclaimable_amount)) + } else { + None + }; + let deposit = DEPOSITS.with(|v| { let mut p = v.borrow_mut(); let mut deposit = p.get_mut(&deposit_id).unwrap(); @@ -710,10 +731,6 @@ impl hydradx_traits::liquidity_mining::Mutate f *deposit }); - let global_farm_id = DEPOSIT_ENTRIES - .with(|v| v.borrow_mut().remove(&(deposit_id, yield_farm_id))) - .unwrap() - .global_farm_id; let withdrawn_amount = deposit.shares_amount; let mut destroyed = false; @@ -722,7 +739,7 @@ impl hydradx_traits::liquidity_mining::Mutate f destroyed = true; } - Ok((global_farm_id, withdrawn_amount, destroyed)) + Ok((withdrawn_amount, claim_data, destroyed)) } fn is_yield_farm_claimable(_global_farm_id: u32, yield_farm_id: u32, _amm_pool_id: Self::AmmPoolId) -> bool { diff --git a/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs b/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs index 87f757380ef..2e7ab31c954 100644 --- a/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs +++ b/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs @@ -387,3 +387,88 @@ fn withdraw_shares_should_fail_when_nft_owner_is_not_found() { ); }); } + +#[test] +fn withdraw_shares_should_when_yield_farm_is_not_claimable() { + ExtBuilder::default() + .with_endowed_accounts(vec![ + (BOB, BSX, 1_000_000 * ONE), + (CHARLIE, BSX_KSM_SHARE_ID, 200 * ONE), + ]) + .with_amm_pool(BSX_KSM_AMM, BSX_KSM_SHARE_ID, BSX_KSM_ASSET_PAIR) + .with_global_farm( + 500_000 * ONE, + 20_000, + 10, + BSX, + BSX, + ALICE, + Perquintill::from_percent(1), + ONE, + One::one(), + ) + .with_yield_farm(ALICE, 1, One::one(), None, BSX_KSM_ASSET_PAIR) + .with_deposit(CHARLIE, 1, 2, BSX_KSM_ASSET_PAIR, 100 * ONE) + .build() + .execute_with(|| { + //Arrange + set_block_number(1_000); + + let charlie_lp_token_balance = Tokens::free_balance(BSX_KSM_SHARE_ID, &CHARLIE); + pretty_assertions::assert_eq!( + Tokens::free_balance(BSX_KSM_SHARE_ID, &LiquidityMining::account_id()), + 100 * ONE + ); + + assert_ok!(LiquidityMining::stop_yield_farm( + Origin::signed(ALICE), + 1, + BSX_KSM_ASSET_PAIR + )); + + //Act + assert_ok!(LiquidityMining::withdraw_shares( + Origin::signed(CHARLIE), + 1, + 2, + BSX_KSM_ASSET_PAIR + )); + + //Assert + pretty_assertions::assert_eq!( + has_event( + crate::Event::SharesWithdrawn { + global_farm_id: 1, + yield_farm_id: 2, + who: CHARLIE, + lp_token: BSX_KSM_SHARE_ID, + amount: 100 * ONE, + deposit_id: 1, + } + .into(), + ), + true + ); + + pretty_assertions::assert_eq!( + has_event( + crate::Event::DepositDestroyed { + who: CHARLIE, + deposit_id: 1, + } + .into(), + ), + true + ); + + //NOTE: deposit was destroyed and LP shares unlocked + pretty_assertions::assert_eq!( + Tokens::free_balance(BSX_KSM_SHARE_ID, &CHARLIE), + charlie_lp_token_balance + 100 * ONE + ); + pretty_assertions::assert_eq!( + Tokens::free_balance(BSX_KSM_SHARE_ID, &LiquidityMining::account_id()), + 0 + ); + }); +} diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index 3a672cf1ecf..13fcea71b6b 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-xyk' -version = '6.1.2' +version = '6.1.3' description = 'XYK automated market maker' authors = ['GalacticCouncil'] edition = '2021' @@ -32,7 +32,8 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li orml-utilities = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +registry-traits = { package="hydradx-traits", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } # Substrate dependencies frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index e4631cfa39e..f7c41c25b5b 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -62,7 +62,7 @@ pub mod pallet { use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::OriginFor; use hydradx_traits::pools::DustRemovalAccountWhitelist; - use hydradx_traits::ShareTokenRegistry; + use registry_traits::ShareTokenRegistry; #[pallet::pallet] pub struct Pallet(_); diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index fa02fb791d4..0a513316436 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "primitives" -version = "6.3.8" +version = "6.4.0" authors = ["GalacticCouncil"] edition = "2021" repository = "https://github.com/galacticcouncil/Basilisk-node" @@ -16,7 +16,7 @@ serde = { features = ["derive"], optional = true, version = "1.0.136" } static_assertions = "1.1.0" # Warehouse dependencies -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # Substrate dependencies frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9ae7c888204..27d562959dc 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -26,7 +26,7 @@ use serde::{Deserialize, Serialize}; use scale_info::TypeInfo; -use frame_support::sp_runtime::FixedU128; +use frame_support::{parameter_types, sp_runtime::FixedU128}; pub mod asset; pub mod constants; @@ -55,6 +55,11 @@ pub type CollectionId = u128; /// NFT Item ID pub type ItemId = u128; +parameter_types! { + /// NFT metadata limit + pub const UniquesStringLimit: u32 = 72; +} + /// Scaled Unsigned of Balance pub type HighPrecisionBalance = U256; pub type LowPrecisionBalance = u128; diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index 9f1067169ca..6614fb58f57 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk-runtime" -version = "87.0.0" +version = "88.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" @@ -39,16 +39,16 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polka pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # collator support pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 6495006fb5f..8d535f2a2f4 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -813,7 +813,6 @@ parameter_types! { pub const UniquesMetadataDepositBase: Balance = ksm::deposit(1,129); pub const AttributeDepositBase: Balance = ksm::deposit(1,0); pub const DepositPerByte: Balance = ksm::deposit(0,1); - pub const UniquesStringLimit: u32 = 72; } impl pallet_uniques::Config for Runtime { @@ -830,7 +829,7 @@ impl pallet_uniques::Config for Runtime { type MetadataDepositBase = UniquesMetadataDepositBase; type AttributeDepositBase = AttributeDepositBase; type DepositPerByte = DepositPerByte; - type StringLimit = UniquesStringLimit; + type StringLimit = primitives::UniquesStringLimit; type KeyLimit = KeyLimit; type ValueLimit = ValueLimit; type WeightInfo = (); diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 8eac3d62c0e..1b37b04b145 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common-runtime" -version = "2.3.2" +version = "2.3.3" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" @@ -26,13 +26,13 @@ pallet-marketplace = { path = '../../pallets/marketplace', default-features = fa pallet-xyk-liquidity-mining = { path = "../../pallets/xyk-liquidity-mining", default-features=false} # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index c6aa17b4869..b3f6d57c02c 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -304,3 +304,12 @@ parameter_types! { pub DepositFactor: Balance = deposit(0, 32); pub const MaxSignatories: u16 = 100; } + +//pallet uniques +parameter_types! { + pub const CollectionDeposit: Balance = 0; + pub const ItemDeposit: Balance = 0; + pub const KeyLimit: u32 = 256; // Max 256 bytes per key + pub const ValueLimit: u32 = 1024; // Max 1024 bytes per value + pub const UniquesStringLimit: u32 = 72; +} diff --git a/runtime/testing-basilisk/Cargo.toml b/runtime/testing-basilisk/Cargo.toml index 374c6ade7e7..7c9ca4f7ac3 100644 --- a/runtime/testing-basilisk/Cargo.toml +++ b/runtime/testing-basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "testing-basilisk-runtime" -version = "87.0.0" +version = "88.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" @@ -39,16 +39,16 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polka pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false} +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } # collator support pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/testing-basilisk/src/lib.rs b/runtime/testing-basilisk/src/lib.rs index 49f35242405..75ea673c544 100644 --- a/runtime/testing-basilisk/src/lib.rs +++ b/runtime/testing-basilisk/src/lib.rs @@ -519,7 +519,6 @@ parameter_types! { pub const UniquesMetadataDepositBase: Balance = 100 * UNITS; pub const AttributeDepositBase: Balance = 10 * UNITS; pub const DepositPerByte: Balance = UNITS; - pub const UniquesStringLimit: u32 = 72; } impl pallet_uniques::Config for Runtime { @@ -535,7 +534,7 @@ impl pallet_uniques::Config for Runtime { type MetadataDepositBase = UniquesMetadataDepositBase; type AttributeDepositBase = AttributeDepositBase; type DepositPerByte = DepositPerByte; - type StringLimit = UniquesStringLimit; + type StringLimit = primitives::UniquesStringLimit; type KeyLimit = KeyLimit; type ValueLimit = ValueLimit; type WeightInfo = (); diff --git a/rust-toolchain b/rust-toolchain index d49789493b3..a4162a57ba8 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2022-07-24" +channel = "nightly-2022-12-04" components = [ "rustfmt", "clippy" ] targets = [ "wasm32-unknown-unknown" ] profile = "minimal" From 894c857def4f56a9719823a1fe98e2443bfaacdb Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Thu, 5 Jan 2023 12:13:04 +0100 Subject: [PATCH 2/6] make clippy happy --- Cargo.lock | 25 ++++++++++--------- node/Cargo.toml | 2 +- node/src/chain_spec.rs | 2 +- node/src/cli.rs | 2 +- node/src/command.rs | 6 ++--- node/src/testing_chain_spec.rs | 2 +- pallets/duster/src/lib.rs | 6 ++--- pallets/xyk/src/lib.rs | 2 +- pallets/xyk/src/tests/invariants.rs | 2 +- runtime/basilisk/Cargo.toml | 2 ++ .../basilisk/src/benchmarking/marketplace.rs | 2 +- runtime/basilisk/src/lib.rs | 2 +- runtime/basilisk/src/tests.rs | 6 ++--- runtime/testing-basilisk/src/lib.rs | 2 +- runtime/testing-basilisk/src/tests.rs | 6 ++--- 15 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df37696de38..51ccbc2e0e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -415,7 +415,7 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "basilisk" -version = "8.1.2" +version = "8.1.3" dependencies = [ "basilisk-runtime", "clap", @@ -495,7 +495,7 @@ dependencies = [ [[package]] name = "basilisk-runtime" -version = "87.0.0" +version = "88.0.0" dependencies = [ "common-runtime", "cumulus-pallet-aura-ext", @@ -516,6 +516,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "hydradx-adapters", + "hydradx-traits 0.9.1", "hydradx-traits 1.0.0", "orml-benchmarking", "orml-tokens", @@ -1203,7 +1204,7 @@ dependencies = [ [[package]] name = "common-runtime" -version = "2.3.2" +version = "2.3.3" dependencies = [ "cumulus-pallet-xcmp-queue", "frame-support", @@ -5819,7 +5820,7 @@ dependencies = [ [[package]] name = "pallet-duster" -version = "3.1.8" +version = "3.1.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5989,7 +5990,7 @@ dependencies = [ [[package]] name = "pallet-lbp" -version = "4.6.3" +version = "4.6.4" dependencies = [ "frame-benchmarking", "frame-support", @@ -6032,7 +6033,7 @@ dependencies = [ [[package]] name = "pallet-marketplace" -version = "5.0.5" +version = "5.0.6" dependencies = [ "frame-benchmarking", "frame-support", @@ -6667,7 +6668,7 @@ dependencies = [ [[package]] name = "pallet-xyk" -version = "6.1.2" +version = "6.1.3" dependencies = [ "frame-benchmarking", "frame-support", @@ -6697,7 +6698,7 @@ dependencies = [ [[package]] name = "pallet-xyk-liquidity-mining" -version = "1.0.6" +version = "1.1.0" dependencies = [ "frame-support", "frame-system", @@ -6723,7 +6724,7 @@ dependencies = [ [[package]] name = "pallet-xyk-liquidity-mining-benchmarking" -version = "1.0.4" +version = "1.0.5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6766,7 +6767,7 @@ dependencies = [ [[package]] name = "parachain-runtime-mock" -version = "0.1.4" +version = "0.1.5" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", @@ -8362,7 +8363,7 @@ dependencies = [ [[package]] name = "primitives" -version = "6.3.8" +version = "6.4.0" dependencies = [ "frame-support", "frame-system", @@ -11747,7 +11748,7 @@ dependencies = [ [[package]] name = "testing-basilisk-runtime" -version = "87.0.0" +version = "88.0.0" dependencies = [ "common-runtime", "cumulus-pallet-aura-ext", diff --git a/node/Cargo.toml b/node/Cargo.toml index 11e3c684d20..e3e387487b2 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk" -version = "8.1.2" +version = "8.1.3" description = "Basilisk node" authors = ["GalacticCouncil"] edition = "2021" diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 81bf197f8ac..77092cbefce 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -69,7 +69,7 @@ pub type ChainSpec = sc_service::GenericChainSpec; /// Generate a crypto pair from seed. pub fn get_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) + TPublic::Pair::from_string(&format!("//{seed}"), None) .expect("static values are valid; qed") .public() } diff --git a/node/src/cli.rs b/node/src/cli.rs index 001af8b718a..d2eec064610 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -10,7 +10,7 @@ pub struct RuntimeInstanceError(String); impl fmt::Display for RuntimeInstanceError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let RuntimeInstanceError(message) = self; - write!(f, "RuntimeInstanceError: {}", message) + write!(f, "RuntimeInstanceError: {message}") } } diff --git a/node/src/command.rs b/node/src/command.rs index dfd1e58630b..a50f84f156a 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -229,7 +229,7 @@ pub fn run() -> sc_cli::Result<()> { let polkadot_config = SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, config.tokio_handle.clone()) - .map_err(|err| format!("Relay chain argument error: {}", err))?; + .map_err(|err| format!("Relay chain argument error: {err}"))?; cmd.run(config, polkadot_config) }) @@ -381,12 +381,12 @@ pub fn run() -> sc_cli::Result<()> { let state_version = Cli::native_runtime_version(&config.chain_spec).state_version(); let block: Block = - generate_genesis_block(&*config.chain_spec, state_version).map_err(|e| format!("{:?}", e))?; + generate_genesis_block(&*config.chain_spec, state_version).map_err(|e| format!("{e:?}"))?; let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode())); let task_executor = config.tokio_handle.clone(); let polkadot_config = SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor) - .map_err(|err| format!("Relay chain argument error: {}", err))?; + .map_err(|err| format!("Relay chain argument error: {err}"))?; let collator_options = cli.run.base.collator_options(); diff --git a/node/src/testing_chain_spec.rs b/node/src/testing_chain_spec.rs index 2c58e14ec38..e419c9fb116 100644 --- a/node/src/testing_chain_spec.rs +++ b/node/src/testing_chain_spec.rs @@ -50,7 +50,7 @@ pub type ChainSpec = sc_service::GenericChainSpec; /// Generate a crypto pair from seed. pub fn get_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) + TPublic::Pair::from_string(&format!("//{seed}"), None) .expect("static values are valid; qed") .public() } diff --git a/pallets/duster/src/lib.rs b/pallets/duster/src/lib.rs index 72bd079331d..7f5be5b52f1 100644 --- a/pallets/duster/src/lib.rs +++ b/pallets/duster/src/lib.rs @@ -148,11 +148,11 @@ pub mod pallet { AccountBlacklist::::insert(account_id, ()); }); - if self.reward_account == None { + if self.reward_account.is_none() { panic!("Reward account is not set in genesis config"); } - if self.dust_account == None { + if self.dust_account.is_none() { panic!("Dust account is not set in genesis config"); } @@ -336,7 +336,7 @@ impl DustRemovalAccountWhitelist for Pallet { } fn remove_account(account: &T::AccountId) -> Result<(), Self::Error> { - AccountBlacklist::::mutate(&account, |maybe_account| -> Result<(), DispatchError> { + AccountBlacklist::::mutate(account, |maybe_account| -> Result<(), DispatchError> { ensure!(!maybe_account.is_none(), Error::::AccountNotBlacklisted); *maybe_account = None; diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index f7c41c25b5b..1cacceec2ae 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -345,7 +345,7 @@ pub mod pallet { T::NonDustableWhitelistHandler::add_account(&pair_account)?; - >::insert(&pair_account, &share_token); + >::insert(&pair_account, share_token); >::insert(&pair_account, (asset_a, asset_b)); Self::deposit_event(Event::PoolCreated { diff --git a/pallets/xyk/src/tests/invariants.rs b/pallets/xyk/src/tests/invariants.rs index b8a36531d19..792850bea0b 100644 --- a/pallets/xyk/src/tests/invariants.rs +++ b/pallets/xyk/src/tests/invariants.rs @@ -43,7 +43,7 @@ fn assert_asset_invariant( let old_s = U256::from(old_state.0) * U256::from(old_state.1); let s2 = old_s.integer_sqrt(); - assert!(new_s >= old_s, "Invariant decreased for {}", desc); + assert!(new_s >= old_s, "Invariant decreased for {desc}"); let s1_u128 = Balance::try_from(s1).unwrap(); let s2_u128 = Balance::try_from(s2).unwrap(); diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index 6614fb58f57..3a38c3c76ee 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -42,6 +42,8 @@ pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "p hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +#NOTE: we are not using latest asset registry for now. +registry-traits = { package="hydradx-traits", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } diff --git a/runtime/basilisk/src/benchmarking/marketplace.rs b/runtime/basilisk/src/benchmarking/marketplace.rs index 9e1aace55c4..1dcd3dd156d 100644 --- a/runtime/basilisk/src/benchmarking/marketplace.rs +++ b/runtime/basilisk/src/benchmarking/marketplace.rs @@ -9,10 +9,10 @@ use frame_support::{ BoundedVec, }; use frame_system::RawOrigin; -use hydradx_traits::registry::Registry; use orml_benchmarking::runtime_benchmarks; use pallet_nft::BoundedVecOfUnq; use primitives::{constants::currency::UNITS, CollectionId, ItemId}; +use registry_traits::registry::Registry; use sp_std::convert::TryInto; const ENDOWMENT: u32 = 1_000_000; diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 8d535f2a2f4..241399a95b6 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -111,7 +111,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("basilisk"), impl_name: create_runtime_str!("basilisk"), authoring_version: 1, - spec_version: 87, + spec_version: 88, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/basilisk/src/tests.rs b/runtime/basilisk/src/tests.rs index f8f42f1b07a..19310daa4e4 100644 --- a/runtime/basilisk/src/tests.rs +++ b/runtime/basilisk/src/tests.rs @@ -89,7 +89,7 @@ fn multiplier_can_grow_from_zero() { // the weight is 1/100th bigger than target. run_with_system_weight(target * 101 / 100, || { let next = SlowAdjustingFeeUpdate::::convert(minimum_multiplier); - assert!(next > minimum_multiplier, "{:?} !>= {:?}", next, minimum_multiplier); + assert!(next > minimum_multiplier, "{next:?} !>= {minimum_multiplier:?}"); }) } @@ -103,9 +103,9 @@ fn multiplier_growth_simulator() { run_with_system_weight(block_weight, || { let next = SlowAdjustingFeeUpdate::::convert(multiplier); // ensure that it is growing as well. - assert!(next > multiplier, "{:?} !>= {:?}", next, multiplier); + assert!(next > multiplier, "{next:?} !>= {multiplier:?}"); multiplier = next; }); } - println!("multiplier = {:?}", multiplier); + println!("multiplier = {multiplier:?}"); } diff --git a/runtime/testing-basilisk/src/lib.rs b/runtime/testing-basilisk/src/lib.rs index 75ea673c544..8a94273a0df 100644 --- a/runtime/testing-basilisk/src/lib.rs +++ b/runtime/testing-basilisk/src/lib.rs @@ -129,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("testing-basilisk"), impl_name: create_runtime_str!("testing-basilisk"), authoring_version: 1, - spec_version: 87, + spec_version: 88, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/testing-basilisk/src/tests.rs b/runtime/testing-basilisk/src/tests.rs index f44e05d86d0..0221e45e45d 100644 --- a/runtime/testing-basilisk/src/tests.rs +++ b/runtime/testing-basilisk/src/tests.rs @@ -89,7 +89,7 @@ fn multiplier_can_grow_from_zero() { // the weight is 1/100th bigger than target. run_with_system_weight(target * 101 / 100, || { let next = SlowAdjustingFeeUpdate::::convert(minimum_multiplier); - assert!(next > minimum_multiplier, "{:?} !>= {:?}", next, minimum_multiplier); + assert!(next > minimum_multiplier, "{next:?} !>= {minimum_multiplier:?}"); }) } @@ -103,9 +103,9 @@ fn multiplier_growth_simulator() { run_with_system_weight(block_weight, || { let next = SlowAdjustingFeeUpdate::::convert(multiplier); // ensure that it is growing as well. - assert!(next > multiplier, "{:?} !>= {:?}", next, multiplier); + assert!(next > multiplier, "{next:?} !>= {multiplier:?}"); multiplier = next; }); } - println!("multiplier = {:?}", multiplier); + println!("multiplier = {multiplier:?}"); } From 1e0fcd5db36b1ef638765a59daece3d63ea7ef1f Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Thu, 5 Jan 2023 14:50:25 +0100 Subject: [PATCH 3/6] use latest warehouse commit --- Cargo.lock | 28 +++++++++---------- integration-tests/Cargo.toml | 14 +++++----- .../parachain-runtime-mock/Cargo.toml | 14 +++++----- pallets/duster/Cargo.toml | 4 +-- pallets/lbp/Cargo.toml | 4 +-- pallets/marketplace/Cargo.toml | 2 +- pallets/xyk-liquidity-mining/Cargo.toml | 6 ++-- .../benchmarking/Cargo.toml | 6 ++-- pallets/xyk/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- runtime/basilisk/Cargo.toml | 18 ++++++------ runtime/common/Cargo.toml | 12 ++++---- runtime/testing-basilisk/Cargo.toml | 18 ++++++------ 13 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51ccbc2e0e5..ee3fb53023c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -544,7 +544,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b)", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -3453,7 +3453,7 @@ dependencies = [ [[package]] name = "hydradx-adapters" version = "0.2.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "hydradx-traits 1.0.0", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "hydradx-traits" version = "1.0.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5788,7 +5788,7 @@ dependencies = [ [[package]] name = "pallet-currencies" version = "1.0.1" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "frame-system", @@ -6016,7 +6016,7 @@ dependencies = [ [[package]] name = "pallet-liquidity-mining" version = "2.0.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "frame-system", @@ -6122,7 +6122,7 @@ dependencies = [ [[package]] name = "pallet-nft" version = "7.0.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6244,7 +6244,7 @@ dependencies = [ [[package]] name = "pallet-price-oracle" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6305,7 +6305,7 @@ dependencies = [ [[package]] name = "pallet-relaychain-info" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -6320,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-route-executor" version = "1.0.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "frame-system", @@ -6497,7 +6497,7 @@ dependencies = [ [[package]] name = "pallet-transaction-multi-payment" version = "8.0.4" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-support", "frame-system", @@ -6515,7 +6515,7 @@ dependencies = [ [[package]] name = "pallet-transaction-pause" version = "0.1.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-benchmarking", "frame-support", @@ -9076,7 +9076,7 @@ dependencies = [ "pallet-marketplace", "pallet-nft", "pallet-price-oracle", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b)", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -11740,7 +11740,7 @@ dependencies = [ [[package]] name = "test-utils" version = "1.1.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89#a138b20d1e8d65b949d30c526fa1f98be4d66a89" +source = "git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b#d5b8001d90f974f165cf1bfcea0775cfe4340f6b" dependencies = [ "frame-system", "pretty_assertions", @@ -11795,7 +11795,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=a138b20d1e8d65b949d30c526fa1f98be4d66a89)", + "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=d5b8001d90f974f165cf1bfcea0775cfe4340f6b)", "pallet-route-executor", "pallet-scheduler", "pallet-session", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index fb4b81d0a2f..4f3eb84cbc7 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -10,13 +10,13 @@ repository = "https://github.com/galacticcouncil/Basilisk-node" [dependencies] # Warehouse dependencies -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } pallet-xyk = { path = "../pallets/xyk",default-features = false} pallet-duster= { path = "../pallets/duster",default-features = false} @@ -108,7 +108,7 @@ parachain-runtime-mock = { path = "parachain-runtime-mock", default-features = f [dev-dependencies] xcm-emulator = { git = "https://github.com/shaunxw/xcm-simulator", rev = "0460d04c798028e7bef82c907082e11753ed173b" } hex-literal = "0.3.1" -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89" } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b" } pretty_assertions = "1.2.1" sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } test-case = "2.2.1" diff --git a/integration-tests/parachain-runtime-mock/Cargo.toml b/integration-tests/parachain-runtime-mock/Cargo.toml index 7b9deed65e0..3d25aa1d245 100644 --- a/integration-tests/parachain-runtime-mock/Cargo.toml +++ b/integration-tests/parachain-runtime-mock/Cargo.toml @@ -14,14 +14,14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = scale-info = { version = "2.1", default-features = false, features = ["derive"] } # Warehouse dependencies -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } pallet-xyk = { path = "../../pallets/xyk",default-features = false} pallet-duster= { path = "../../pallets/duster",default-features = false} diff --git a/pallets/duster/Cargo.toml b/pallets/duster/Cargo.toml index 1d7a686ad15..6f349507529 100644 --- a/pallets/duster/Cargo.toml +++ b/pallets/duster/Cargo.toml @@ -19,7 +19,7 @@ codec = { default-features = false, features = ["derive"], package = "parity-sca scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { features = ["derive"], optional = true, version = "1.0.136" } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # ORML dependencies orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } @@ -40,7 +40,7 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0 sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } [features] diff --git a/pallets/lbp/Cargo.toml b/pallets/lbp/Cargo.toml index 705adbffab1..a5290e3d963 100644 --- a/pallets/lbp/Cargo.toml +++ b/pallets/lbp/Cargo.toml @@ -22,7 +22,7 @@ serde = { features = ["derive"], optional = true, version = "1.0.136" } # Warehouse dependencies hydra-dx-math = { git = "https://github.com/galacticcouncil/HydraDX-math", rev = "7b95ae58e6a8a24c56da3511cef24d8c394801bf", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } ## Local dependencies primitives = { default-features = false, path = "../../primitives" } @@ -44,7 +44,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } -test-utils = {git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +test-utils = {git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} [features] default = ["std"] diff --git a/pallets/marketplace/Cargo.toml b/pallets/marketplace/Cargo.toml index 01cdbd1ca55..1bbb142c778 100644 --- a/pallets/marketplace/Cargo.toml +++ b/pallets/marketplace/Cargo.toml @@ -26,7 +26,7 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0 pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependency -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # local dependency primitives = { default-features = false, path = "../../primitives" } diff --git a/pallets/xyk-liquidity-mining/Cargo.toml b/pallets/xyk-liquidity-mining/Cargo.toml index 69f9b2d7b2d..91a566c8ca5 100644 --- a/pallets/xyk-liquidity-mining/Cargo.toml +++ b/pallets/xyk-liquidity-mining/Cargo.toml @@ -21,9 +21,9 @@ log = { version = "0.4.17", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } primitives = { path = "../../primitives", default-features = false } diff --git a/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml b/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml index ce7e0df1cf0..409c8608447 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml +++ b/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml @@ -26,10 +26,10 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev="fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index 13fcea71b6b..89995a7d8e2 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -32,7 +32,7 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li orml-utilities = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.29", default-features = false } # HydraDX dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } registry-traits = { package="hydradx-traits", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } # Substrate dependencies diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 0a513316436..7a148ae0fa4 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -16,7 +16,7 @@ serde = { features = ["derive"], optional = true, version = "1.0.136" } static_assertions = "1.1.0" # Warehouse dependencies -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # Substrate dependencies frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/basilisk/Cargo.toml b/runtime/basilisk/Cargo.toml index 3a38c3c76ee..32ef3f972ba 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -39,18 +39,18 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polka pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } #NOTE: we are not using latest asset registry for now. registry-traits = { package="hydradx-traits", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # collator support pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 1b37b04b145..07ecd1a49fe 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -26,13 +26,13 @@ pallet-marketplace = { path = '../../pallets/marketplace', default-features = fa pallet-xyk-liquidity-mining = { path = "../../pallets/xyk-liquidity-mining", default-features=false} # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/runtime/testing-basilisk/Cargo.toml b/runtime/testing-basilisk/Cargo.toml index 7c9ca4f7ac3..43bdcf889a2 100644 --- a/runtime/testing-basilisk/Cargo.toml +++ b/runtime/testing-basilisk/Cargo.toml @@ -39,16 +39,16 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "polka pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } # Warehouse dependencies -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false} +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false} pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "a138b20d1e8d65b949d30c526fa1f98be4d66a89", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "d5b8001d90f974f165cf1bfcea0775cfe4340f6b", default-features = false } # collator support pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.29", default-features = false } From c021d8632ddd230889354385929e07f4551ede2b Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Mon, 9 Jan 2023 10:35:05 +0100 Subject: [PATCH 4/6] bump version --- Cargo.lock | 2 +- integration-tests/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee3fb53023c..31d5be300be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9033,7 +9033,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "0.8.5" +version = "0.8.6" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 4f3eb84cbc7..ae636807323 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "0.8.5" +version = "0.8.6" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" From 69e9ef47e3006aca97ab4af89f82cf4b65245ae1 Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Tue, 10 Jan 2023 09:32:01 +0100 Subject: [PATCH 5/6] fix PR comments --- .../xyk-liquidity-mining/src/tests/withdraw_shares.rs | 2 +- runtime/basilisk/src/benchmarking/route_executor.rs | 1 + runtime/common/src/lib.rs | 9 --------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs b/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs index 2e7ab31c954..7d24db69819 100644 --- a/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs +++ b/pallets/xyk-liquidity-mining/src/tests/withdraw_shares.rs @@ -389,7 +389,7 @@ fn withdraw_shares_should_fail_when_nft_owner_is_not_found() { } #[test] -fn withdraw_shares_should_when_yield_farm_is_not_claimable() { +fn withdraw_shares_should_work_when_yield_farm_is_not_claimable() { ExtBuilder::default() .with_endowed_accounts(vec![ (BOB, BSX, 1_000_000 * ONE), diff --git a/runtime/basilisk/src/benchmarking/route_executor.rs b/runtime/basilisk/src/benchmarking/route_executor.rs index facaacf91b4..13a82df2545 100644 --- a/runtime/basilisk/src/benchmarking/route_executor.rs +++ b/runtime/basilisk/src/benchmarking/route_executor.rs @@ -37,6 +37,7 @@ pub const UNITS: Balance = 100_000_000_000; const MAX_NUMBER_OF_TRADES: u32 = 5; pub fn register_asset_with_name(name_as_bye_string: &[u8]) -> Result { + #![allow(clippy::result_large_err)] register_asset(name_as_bye_string.to_vec(), 0u128).map_err(|_| BenchmarkError::Stop("Failed to register asset")) } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index b3f6d57c02c..c6aa17b4869 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -304,12 +304,3 @@ parameter_types! { pub DepositFactor: Balance = deposit(0, 32); pub const MaxSignatories: u16 = 100; } - -//pallet uniques -parameter_types! { - pub const CollectionDeposit: Balance = 0; - pub const ItemDeposit: Balance = 0; - pub const KeyLimit: u32 = 256; // Max 256 bytes per key - pub const ValueLimit: u32 = 1024; // Max 1024 bytes per value - pub const UniquesStringLimit: u32 = 72; -} From e6f35b2175e213f921f611908fec7ff21562a491 Mon Sep 17 00:00:00 2001 From: martinfridrich Date: Tue, 10 Jan 2023 12:04:37 +0100 Subject: [PATCH 6/6] removed BlockNumberProvider from xyk-liquidity-mining pallet + PR comments --- pallets/xyk-liquidity-mining/benchmarking/src/mock.rs | 1 - pallets/xyk-liquidity-mining/src/lib.rs | 9 +-------- pallets/xyk-liquidity-mining/src/tests/mock.rs | 1 - runtime/basilisk/src/benchmarking/route_executor.rs | 3 ++- runtime/basilisk/src/lib.rs | 1 - runtime/testing-basilisk/src/lib.rs | 1 - 6 files changed, 3 insertions(+), 13 deletions(-) diff --git a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs index 2973c006047..0393a2218b2 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs +++ b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs @@ -159,7 +159,6 @@ impl pallet_xyk_liquidity_mining::Config for Test { type MultiCurrency = Currency; type CreateOrigin = EnsureRoot; type PalletId = LMPalletId; - type BlockNumberProvider = MockBlockNumberProvider; type NftCollectionId = NftCollection; type AMM = XYK; type WeightInfo = (); diff --git a/pallets/xyk-liquidity-mining/src/lib.rs b/pallets/xyk-liquidity-mining/src/lib.rs index 449c80debc5..39b7ee5fdf6 100644 --- a/pallets/xyk-liquidity-mining/src/lib.rs +++ b/pallets/xyk-liquidity-mining/src/lib.rs @@ -45,11 +45,7 @@ pub mod weights; pub use pallet::*; use frame_support::traits::tokens::nonfungibles::{Inspect, Mutate}; -use frame_support::{ - ensure, - sp_runtime::traits::{BlockNumberProvider, Zero}, - PalletId, -}; +use frame_support::{ensure, sp_runtime::traits::Zero, PalletId}; use hydradx_traits::liquidity_mining::{GlobalFarmId, Mutate as LiquidityMiningMutate, YieldFarmId}; use pallet_liquidity_mining::{FarmMultiplier, LoyaltyCurve}; @@ -133,9 +129,6 @@ pub mod pallet { /// Pallet id. type PalletId: Get; - /// The block number provider - type BlockNumberProvider: BlockNumberProvider; - /// NFT collection id for liq. mining deposit nfts. Has to be within the range of reserved NFT class IDs. #[pallet::constant] type NftCollectionId: Get; diff --git a/pallets/xyk-liquidity-mining/src/tests/mock.rs b/pallets/xyk-liquidity-mining/src/tests/mock.rs index c3f1e2cfd51..66d571d87f5 100644 --- a/pallets/xyk-liquidity-mining/src/tests/mock.rs +++ b/pallets/xyk-liquidity-mining/src/tests/mock.rs @@ -337,7 +337,6 @@ impl Config for Test { type CreateOrigin = frame_system::EnsureRoot; type WeightInfo = (); type PalletId = LMPalletId; - type BlockNumberProvider = MockBlockNumberProvider; type AMM = DummyAMM; type NftCollectionId = NftCollectionId; type NFTHandler = DummyNFT; diff --git a/runtime/basilisk/src/benchmarking/route_executor.rs b/runtime/basilisk/src/benchmarking/route_executor.rs index 13a82df2545..9f4e985370f 100644 --- a/runtime/basilisk/src/benchmarking/route_executor.rs +++ b/runtime/basilisk/src/benchmarking/route_executor.rs @@ -14,6 +14,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#![allow(clippy::result_large_err)] + use crate::{AccountId, AssetId, Balance, Currencies, Runtime}; use super::*; @@ -37,7 +39,6 @@ pub const UNITS: Balance = 100_000_000_000; const MAX_NUMBER_OF_TRADES: u32 = 5; pub fn register_asset_with_name(name_as_bye_string: &[u8]) -> Result { - #![allow(clippy::result_large_err)] register_asset(name_as_bye_string.to_vec(), 0u128).map_err(|_| BenchmarkError::Stop("Failed to register asset")) } diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 241399a95b6..d798fcae263 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -847,7 +847,6 @@ impl pallet_xyk_liquidity_mining::Config for Runtime { type MultiCurrency = Currencies; type CreateOrigin = UnanimousTechCommitteeOrRoot; type PalletId = LMPalletId; - type BlockNumberProvider = RelayChainBlockNumberProvider; type NftCollectionId = LiquidityMiningNftCollectionId; type AMM = XYK; type WeightInfo = weights::xyk_liquidity_mining::BasiliskWeight; diff --git a/runtime/testing-basilisk/src/lib.rs b/runtime/testing-basilisk/src/lib.rs index 8a94273a0df..73bb524d24a 100644 --- a/runtime/testing-basilisk/src/lib.rs +++ b/runtime/testing-basilisk/src/lib.rs @@ -811,7 +811,6 @@ impl pallet_xyk_liquidity_mining::Config for Runtime { type MultiCurrency = Currencies; type CreateOrigin = UnanimousTechCommitteeOrRoot; type PalletId = LMPalletId; - type BlockNumberProvider = cumulus_pallet_parachain_system::RelaychainBlockNumberProvider; type NftCollectionId = LiquidityMiningNftCollectionId; type AMM = XYK; type WeightInfo = pallet_xyk_liquidity_mining::weights::BasiliskWeight;