diff --git a/Cargo.lock b/Cargo.lock index 7335dca4396..f1b76555be1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -415,7 +415,7 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "basilisk" -version = "8.1.3" +version = "8.1.4" dependencies = [ "basilisk-runtime", "clap", @@ -495,7 +495,7 @@ dependencies = [ [[package]] name = "basilisk-runtime" -version = "90.0.0" +version = "91.0.0" dependencies = [ "common-runtime", "cumulus-pallet-aura-ext", @@ -516,8 +516,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "hydradx-adapters", - "hydradx-traits 0.9.1", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-benchmarking", "orml-tokens", "orml-traits", @@ -544,7 +543,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a)", + "pallet-relaychain-info", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -1204,12 +1203,12 @@ dependencies = [ [[package]] name = "common-runtime" -version = "2.3.5" +version = "2.3.6" dependencies = [ "cumulus-pallet-xcmp-queue", "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-tokens", "orml-traits", "orml-vesting", @@ -3453,10 +3452,10 @@ dependencies = [ [[package]] name = "hydradx-adapters" version = "0.2.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", - "hydradx-traits 2.0.0", + "hydradx-traits", "log", "pallet-transaction-multi-payment", "parity-scale-codec", @@ -3467,24 +3466,10 @@ dependencies = [ "xcm-executor", ] -[[package]] -name = "hydradx-traits" -version = "0.9.1" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic", - "sp-std", -] - [[package]] name = "hydradx-traits" version = "2.0.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5546,13 +5531,13 @@ dependencies = [ [[package]] name = "pallet-asset-registry" -version = "1.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=fcebd285141ce9ed15136f6102fa6396605d96af#fcebd285141ce9ed15136f6102fa6396605d96af" +version = "2.1.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits 0.9.1", + "hydradx-traits", "orml-traits", "parity-scale-codec", "primitive-types 0.12.1", @@ -5787,8 +5772,8 @@ dependencies = [ [[package]] name = "pallet-currencies" -version = "1.0.1" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +version = "1.1.0" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", "frame-system", @@ -5820,13 +5805,13 @@ dependencies = [ [[package]] name = "pallet-duster" -version = "3.1.11" +version = "3.1.12" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", - "hydradx-traits 2.0.0", + "hydradx-traits", "lazy_static", "orml-tokens", "orml-traits", @@ -5990,14 +5975,14 @@ dependencies = [ [[package]] name = "pallet-lbp" -version = "4.6.6" +version = "4.6.7" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", "hydra-dx-math 4.9.0", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-tokens", "orml-traits", "parity-scale-codec", @@ -6016,13 +6001,12 @@ dependencies = [ [[package]] name = "pallet-liquidity-mining" version = "3.0.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", "frame-system", "hydra-dx-math 5.1.4", - "hydradx-traits 0.9.1", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-traits", "parity-scale-codec", "scale-info", @@ -6033,7 +6017,7 @@ dependencies = [ [[package]] name = "pallet-marketplace" -version = "5.0.8" +version = "5.0.9" dependencies = [ "frame-benchmarking", "frame-support", @@ -6122,12 +6106,12 @@ dependencies = [ [[package]] name = "pallet-nft" version = "7.1.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-utilities", "pallet-uniques", "parity-scale-codec", @@ -6244,12 +6228,12 @@ dependencies = [ [[package]] name = "pallet-price-oracle" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "parity-scale-codec", "scale-info", "serde", @@ -6290,22 +6274,7 @@ dependencies = [ [[package]] name = "pallet-relaychain-info" version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?branch=polkadot-v0.9.29#38d96eb73e5dc3be3425f784ea920ab63f775260" -dependencies = [ - "cumulus-pallet-parachain-system", - "cumulus-primitives-core", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-std", -] - -[[package]] -name = "pallet-relaychain-info" -version = "0.3.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -6320,11 +6289,11 @@ dependencies = [ [[package]] name = "pallet-route-executor" version = "1.0.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-traits", "parity-scale-codec", "scale-info", @@ -6497,11 +6466,11 @@ dependencies = [ [[package]] name = "pallet-transaction-multi-payment" version = "8.0.4" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-traits", "pallet-transaction-payment", "parity-scale-codec", @@ -6515,7 +6484,7 @@ dependencies = [ [[package]] name = "pallet-transaction-pause" version = "0.1.2" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-benchmarking", "frame-support", @@ -6668,15 +6637,14 @@ dependencies = [ [[package]] name = "pallet-xyk" -version = "6.1.5" +version = "6.2.1" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", "hydra-dx-math 4.9.0", - "hydradx-traits 0.9.1", - "hydradx-traits 2.0.0", + "hydradx-traits", "log", "orml-tokens", "orml-traits", @@ -6698,11 +6666,11 @@ dependencies = [ [[package]] name = "pallet-xyk-liquidity-mining" -version = "1.1.2" +version = "1.1.3" dependencies = [ "frame-support", "frame-system", - "hydradx-traits 2.0.0", + "hydradx-traits", "lazy_static", "log", "orml-currencies", @@ -6724,13 +6692,13 @@ dependencies = [ [[package]] name = "pallet-xyk-liquidity-mining-benchmarking" -version = "1.0.7" +version = "1.0.8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-currencies", "orml-tokens", "orml-traits", @@ -6767,7 +6735,7 @@ dependencies = [ [[package]] name = "parachain-runtime-mock" -version = "0.1.7" +version = "0.2.0" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", @@ -6787,7 +6755,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "hex-literal", "hydradx-adapters", - "hydradx-traits 2.0.0", + "hydradx-traits", "kusama-runtime", "orml-tokens", "orml-traits", @@ -6809,7 +6777,7 @@ dependencies = [ "pallet-marketplace", "pallet-nft", "pallet-price-oracle", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?branch=polkadot-v0.9.29)", + "pallet-relaychain-info", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -8363,7 +8331,7 @@ dependencies = [ [[package]] name = "primitives" -version = "6.4.2" +version = "6.4.3" dependencies = [ "frame-support", "frame-system", @@ -9033,7 +9001,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "0.8.8" +version = "0.9.0" dependencies = [ "basilisk-runtime", "cumulus-pallet-aura-ext", @@ -9053,7 +9021,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", - "hydradx-traits 2.0.0", + "hydradx-traits", "kusama-runtime", "orml-tokens", "orml-traits", @@ -9076,7 +9044,7 @@ dependencies = [ "pallet-marketplace", "pallet-nft", "pallet-price-oracle", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a)", + "pallet-relaychain-info", "pallet-route-executor", "pallet-scheduler", "pallet-session", @@ -11740,7 +11708,7 @@ dependencies = [ [[package]] name = "test-utils" version = "1.1.0" -source = "git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a#654b06312c800c4fbdd052e5b3a83ca15efed63a" +source = "git+https://github.com/galacticcouncil/warehouse?rev=ea6e89e2348ca349337bc4269a5637f4e9c3c9b1#ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" dependencies = [ "frame-system", "pretty_assertions", @@ -11748,7 +11716,7 @@ dependencies = [ [[package]] name = "testing-basilisk-runtime" -version = "90.0.0" +version = "91.0.0" dependencies = [ "common-runtime", "cumulus-pallet-aura-ext", @@ -11769,7 +11737,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "hydradx-adapters", - "hydradx-traits 2.0.0", + "hydradx-traits", "orml-tokens", "orml-traits", "orml-unknown-tokens", @@ -11795,7 +11763,7 @@ dependencies = [ "pallet-nft", "pallet-preimage", "pallet-proxy", - "pallet-relaychain-info 0.3.2 (git+https://github.com/galacticcouncil/warehouse?rev=654b06312c800c4fbdd052e5b3a83ca15efed63a)", + "pallet-relaychain-info", "pallet-route-executor", "pallet-scheduler", "pallet-session", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 1674210e221..1b2c30c6086 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "0.8.8" +version = "0.9.0" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a" } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" } 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 6d78666bace..df832bd11e2 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.7" +version = "0.2.0" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} -pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-price-oracle = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } pallet-xyk = { path = "../../pallets/xyk",default-features = false} pallet-duster= { path = "../../pallets/duster",default-features = false} @@ -110,7 +110,7 @@ kusama-runtime = { git = "https://github.com/paritytech/polkadot", branch = "rel [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", branch = "polkadot-v0.9.29" } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1" } 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/src/lib.rs b/integration-tests/parachain-runtime-mock/src/lib.rs index 96c01d875e6..0159baab0c0 100644 --- a/integration-tests/parachain-runtime-mock/src/lib.rs +++ b/integration-tests/parachain-runtime-mock/src/lib.rs @@ -85,7 +85,7 @@ parameter_types! { pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::parachain_id().into()))); pub const BaseXcmWeight: XcmWeight = 100_000_000; pub const MaxAssetsForTransfer: usize = 2; - + pub const SequentialIdOffset: u32 = 1_000_000; } parameter_type_with_key! { pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { @@ -276,6 +276,7 @@ impl pallet_asset_registry::Config for ParachainRuntime { type Balance = Balance; type AssetNativeLocation = AssetLocation; type StringLimit = RegistryStringLimit; + type SequentialIdStartAt = SequentialIdOffset; type NativeAssetId = ParachainNativeCurrencyId; type WeightInfo = (); } diff --git a/integration-tests/src/kusama_test_net.rs b/integration-tests/src/kusama_test_net.rs index 98158f8e388..8372b6d4110 100644 --- a/integration-tests/src/kusama_test_net.rs +++ b/integration-tests/src/kusama_test_net.rs @@ -185,11 +185,11 @@ pub fn basilisk_ext() -> sp_io::TestExternalities { .unwrap(); pallet_asset_registry::GenesisConfig:: { - asset_names: vec![ - (b"KSM".to_vec(), 1_000_000u128), - (b"aUSD".to_vec(), 1_000u128), - (b"MOVR".to_vec(), 1_000u128), - (b"NEW_BOOTSRAPPED_TOKEN".to_vec(), 1_000u128), + registered_assets: vec![ + (b"KSM".to_vec(), 1_000_000u128, Some(1)), + (b"aUSD".to_vec(), 1_000u128, Some(2)), + (b"MOVR".to_vec(), 1_000u128, Some(3)), + (b"NEW_BOOTSRAPPED_TOKEN".to_vec(), 1_000u128, Some(4)), ], native_asset_name: b"BSX".to_vec(), native_existential_deposit: existential_deposit, @@ -268,7 +268,7 @@ pub fn other_parachain_ext() -> sp_io::TestExternalities { .unwrap(); pallet_asset_registry::GenesisConfig:: { - asset_names: vec![(b"AUSD".to_vec(), 1_000_000u128)], + registered_assets: vec![(b"AUSD".to_vec(), 1_000_000u128, Some(1))], native_asset_name: b"BSX".to_vec(), native_existential_deposit: existential_deposit, } diff --git a/integration-tests/src/nft.rs b/integration-tests/src/nft.rs index 532d37f2aaa..5a592bd6780 100644 --- a/integration-tests/src/nft.rs +++ b/integration-tests/src/nft.rs @@ -15,7 +15,7 @@ use xcm_emulator::TestExt; const ALLOW: bool = true; const NOT_ALLOW: bool = false; const RESERVED_COLLECTION_ID: CollectionId = 0; -const RESTRICTED_COLLECTION_TYPE: CollectionType = CollectionType::HydraHeads; +const RESTRICTED_COLLECTION_TYPE: CollectionType = CollectionType::LiquidityMining; fn create_nft_collection(account_id: AccountId, collection_id: CollectionId, collection_type: CollectionType) { Basilisk::execute_with(|| { @@ -42,9 +42,6 @@ fn mint_nft(account_id: AccountId, collection_id: CollectionId, item_id: ItemId) #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, NOT_ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_collection_creation(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -54,9 +51,6 @@ fn test_nft_permission_for_collection_creation(collection_type: CollectionType, #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, NOT_ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_minting(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -66,9 +60,6 @@ fn test_nft_permission_for_minting(collection_type: CollectionType, is_allowed: #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_transfer(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -78,9 +69,6 @@ fn test_nft_permission_for_transfer(collection_type: CollectionType, is_allowed: #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, NOT_ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_burning(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -90,9 +78,6 @@ fn test_nft_permission_for_burning(collection_type: CollectionType, is_allowed: #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, NOT_ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_collection_destroying(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -102,9 +87,6 @@ fn test_nft_permission_for_collection_destroying(collection_type: CollectionType #[test_case(CollectionType::Marketplace, ALLOW ; "marketplace collection")] #[test_case(CollectionType::LiquidityMining, NOT_ALLOW ; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable, NOT_ALLOW ; "redeemable collection")] -#[test_case(CollectionType::Auction, NOT_ALLOW ; "auction collection")] -#[test_case(CollectionType::HydraHeads, NOT_ALLOW ; "hydra heads collection")] fn test_nft_permission_for_deposit(collection_type: CollectionType, is_allowed: bool) { assert_eq!( is_allowed, @@ -116,9 +98,6 @@ fn test_nft_permission_for_deposit(collection_type: CollectionType, is_allowed: #[test_case(CollectionType::Marketplace; "marketplace collection")] #[test_case(CollectionType::LiquidityMining; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable; "redeemable collection")] -#[test_case(CollectionType::Auction; "auction collection")] -#[test_case(CollectionType::HydraHeads; "hydra heads collection")] fn deposit_for_create_typed_collection_should_be_zero(collection_type: CollectionType) { // Arrange TestNet::reset(); @@ -226,9 +205,6 @@ fn transfer_should_ignore_permissions() { #[test_case(CollectionType::Marketplace; "marketplace collection")] #[test_case(CollectionType::LiquidityMining; "liquidity mining collection")] -#[test_case(CollectionType::Redeemable; "redeemable collection")] -#[test_case(CollectionType::Auction; "auction collection")] -#[test_case(CollectionType::HydraHeads; "hydra heads collection")] fn create_typed_collection_should_ignore_permissions_and_reserved_ids(collection_type: CollectionType) { // Arrange TestNet::reset(); diff --git a/integration-tests/src/xyk.rs b/integration-tests/src/xyk.rs index 99bd99fbc44..df45c656df7 100644 --- a/integration-tests/src/xyk.rs +++ b/integration-tests/src/xyk.rs @@ -103,3 +103,27 @@ fn pool_should_be_created_when_it_was_destroyed_previously() { )); }); } + +#[test] +fn share_asset_id_should_be_offset() { + TestNet::reset(); + + Basilisk::execute_with(|| { + //arrange + assert_ok!(XYK::create_pool( + Origin::signed(ALICE.into()), + KSM, + 100 * UNITS, + AUSD, + 200 * UNITS, + )); + + let share_token = XYK::get_share_token(AssetPair { + asset_in: KSM, + asset_out: AUSD, + }); + let offset = ::SequentialIdStartAt::get(); + //assert + assert!(share_token >= offset); + }); +} diff --git a/node/Cargo.toml b/node/Cargo.toml index e3e387487b2..0816b1fb676 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk" -version = "8.1.3" +version = "8.1.4" description = "Basilisk node" authors = ["GalacticCouncil"] edition = "2021" diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 77092cbefce..5c7f0bdadf8 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -224,7 +224,10 @@ pub fn testnet_parachain_config() -> Result { //technical committee vec![hex!["30035c21ba9eda780130f2029a80c3e962f56588bc04c36be95a225cb536fb55"].into()], vec![], - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![hex!["30035c21ba9eda780130f2029a80c3e962f56588bc04c36be95a225cb536fb55"].into()], ) @@ -308,7 +311,10 @@ pub fn parachain_development_config() -> Result { get_account_id_from_seed::("Eve"), ], get_vesting_config_for_test(), - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![get_account_id_from_seed::("Alice")], ) @@ -602,7 +608,10 @@ pub fn local_parachain_config() -> Result { get_account_id_from_seed::("Eve"), ], get_vesting_config_for_test(), - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![get_account_id_from_seed::("Alice")], ) @@ -676,7 +685,7 @@ fn parachain_genesis( // of this. aura: Default::default(), asset_registry: AssetRegistryConfig { - asset_names: vec![], + registered_assets: vec![], native_asset_name: TOKEN_SYMBOL.as_bytes().to_vec(), native_existential_deposit: NATIVE_EXISTENTIAL_DEPOSIT, }, @@ -733,8 +742,8 @@ fn testnet_parachain_genesis( council_members: Vec, tech_committee_members: Vec, vesting_list: Vec<(AccountId, BlockNumber, BlockNumber, u32, Balance)>, - registered_assets: Vec<(Vec, Balance)>, // (Asset name, Existential deposit) - accepted_assets: Vec<(AssetId, Price)>, // (Asset id, Fallback price) - asset which fee can be paid with + registered_assets: Vec<(Vec, Balance, Option)>, // (Asset name, Existential deposit, Chosen asset id) + accepted_assets: Vec<(AssetId, Price)>, // (Asset id, Fallback price) - asset which fee can be paid with elections: Vec, ) -> GenesisConfig { GenesisConfig { @@ -773,7 +782,7 @@ fn testnet_parachain_genesis( // of this. aura: Default::default(), asset_registry: AssetRegistryConfig { - asset_names: registered_assets.clone(), + registered_assets: registered_assets.clone(), native_asset_name: TOKEN_SYMBOL.as_bytes().to_vec(), native_existential_deposit: NATIVE_EXISTENTIAL_DEPOSIT, }, diff --git a/node/src/testing_chain_spec.rs b/node/src/testing_chain_spec.rs index e419c9fb116..5696cc5de80 100644 --- a/node/src/testing_chain_spec.rs +++ b/node/src/testing_chain_spec.rs @@ -130,7 +130,10 @@ pub fn parachain_development_config() -> Result { get_account_id_from_seed::("Eve"), ], get_vesting_config_for_test(), - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![get_account_id_from_seed::("Alice")], ) @@ -208,7 +211,10 @@ pub fn local_parachain_config() -> Result { get_account_id_from_seed::("Eve"), ], get_vesting_config_for_test(), - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![get_account_id_from_seed::("Alice")], ) @@ -272,7 +278,10 @@ pub fn k8s_testnet_parachain_config() -> Result { vec![hex!["a62f1daf8e490a1c0514c7d9f3a700999100f2aeb1d67a2ca68b241d3d6b3547"].into()], vec![], get_vesting_config_for_test(), - vec![(b"KSM".to_vec(), 1_000u128), (b"KUSD".to_vec(), 1_000u128)], + vec![ + (b"KSM".to_vec(), 1_000u128, Some(1u32)), + (b"KUSD".to_vec(), 1_000u128, Some(2u32)), + ], vec![(1, Price::from_float(0.0000212)), (2, Price::from_float(0.000806))], vec![hex!["a62f1daf8e490a1c0514c7d9f3a700999100f2aeb1d67a2ca68b241d3d6b3547"].into()], ) @@ -382,8 +391,8 @@ fn testnet_parachain_genesis( council_members: Vec, tech_committee_members: Vec, vesting_list: Vec<(AccountId, BlockNumber, BlockNumber, u32, Balance)>, - registered_assets: Vec<(Vec, Balance)>, // (Asset name, Existential deposit) - accepted_assets: Vec<(AssetId, Price)>, // (Asset id, Fallback price) - asset which fee can be paid with + registered_assets: Vec<(Vec, Balance, Option)>, // (Asset name, Existential deposit, Chosen asset id) + accepted_assets: Vec<(AssetId, Price)>, // (Asset id, Fallback price) - asset which fee can be paid with elections: Vec, ) -> GenesisConfig { GenesisConfig { @@ -426,7 +435,7 @@ fn testnet_parachain_genesis( // of this. aura: Default::default(), asset_registry: AssetRegistryConfig { - asset_names: registered_assets.clone(), + registered_assets: registered_assets.clone(), native_asset_name: TOKEN_SYMBOL.as_bytes().to_vec(), native_existential_deposit: NATIVE_EXISTENTIAL_DEPOSIT, }, diff --git a/pallets/duster/Cargo.toml b/pallets/duster/Cargo.toml index 459a1e12e43..9f3b502c3c9 100644 --- a/pallets/duster/Cargo.toml +++ b/pallets/duster/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-duster" -version = "3.1.11" +version = "3.1.12" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 c3acf0c6cd6..dcd86596574 100644 --- a/pallets/lbp/Cargo.toml +++ b/pallets/lbp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-lbp" -version = "4.6.6" +version = "4.6.7" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} +test-utils = {git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} [features] default = ["std"] diff --git a/pallets/marketplace/Cargo.toml b/pallets/marketplace/Cargo.toml index cd2b94ee88b..ca2c43b1b0f 100644 --- a/pallets/marketplace/Cargo.toml +++ b/pallets/marketplace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-marketplace" -version = "5.0.8" +version = "5.0.9" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 d430dc03f41..d7827ae8cf2 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.1.2" +version = "1.1.3" description = "Liquidity mining" authors = ["GalacticCouncil"] edition = "2021" @@ -20,13 +20,14 @@ log = { version = "0.4.17", 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 } -# HydraDX dependencies -pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } - +# Local dependencies primitives = { path = "../../primitives", default-features = false } +# Warehouse dependencies +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } + # Substrate dependencies sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } diff --git a/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml b/pallets/xyk-liquidity-mining/benchmarking/Cargo.toml index 74d9a8f69f8..1d1d055c6d7 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.7" +version = "1.0.8" 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="654b06312c800c4fbdd052e5b3a83ca15efed63a", 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="654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-liquidity-mining = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev="ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 cec7daeadff..6c892d26b17 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs +++ b/pallets/xyk-liquidity-mining/benchmarking/src/lib.rs @@ -56,7 +56,7 @@ const ASSET_PAIR: AssetPair = AssetPair { const INITIAL_BALANCE: Balance = 100_000_000; const ONE: Balance = 1_000_000_000_000; -pub trait Config: pallet_xyk_liquidity_mining::Config + pallet_xyk::Config {} +pub trait Config: pallet_xyk_liquidity_mining::Config + pallet_xyk::Config + pallet_asset_registry::Config {} pub struct Pallet(XYKLiquidityMining); @@ -71,6 +71,36 @@ fn create_funded_account(name: &'static str, index: u32) -> T::Accoun ::MultiCurrency::deposit(DOT, &caller, INITIAL_BALANCE * ONE).unwrap(); + let next_available_asset_id = pallet_asset_registry::Pallet::::next_asset_id().unwrap(); + ::MultiCurrency::deposit( + next_available_asset_id.try_into().ok().unwrap(), + &caller, + INITIAL_BALANCE * ONE, + ) + .unwrap(); + + ::MultiCurrency::deposit( + TryInto::::try_into(next_available_asset_id) + .ok() + .unwrap() + .checked_add(1) + .unwrap(), + &caller, + INITIAL_BALANCE * ONE, + ) + .unwrap(); + + ::MultiCurrency::deposit( + TryInto::::try_into(next_available_asset_id) + .ok() + .unwrap() + .checked_add(2) + .unwrap(), + &caller, + INITIAL_BALANCE * ONE, + ) + .unwrap(); + caller } diff --git a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs index 0393a2218b2..10223de1624 100644 --- a/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs +++ b/pallets/xyk-liquidity-mining/benchmarking/src/mock.rs @@ -54,8 +54,9 @@ pub const DAVE: AccountId = 4; pub const INITIAL_BALANCE: u128 = 1_000_000_000_000; -pub const BSX: AssetId = 1000; -pub const KSM: AssetId = 4000; +pub const BSX: AssetId = 0; +pub const KSM: AssetId = 1; +pub const DOT: AssetId = 2; pub const LIQ_MINING_NFT_COLLECTION: primitives::CollectionId = 1; @@ -88,6 +89,7 @@ parameter_types! { pub const BSXAssetId: AssetId = BSX; pub ExchangeFeeRate: (u32, u32) = (2, 1_000); pub RegistryStringLimit: u32 = 100; + pub const SequentialIdOffset: u32 = 1_000_000; } impl BlockNumberProvider for MockBlockNumberProvider { @@ -289,6 +291,7 @@ impl pallet_asset_registry::Config for Test { type Balance = Balance; type AssetNativeLocation = u8; type StringLimit = RegistryStringLimit; + type SequentialIdStartAt = SequentialIdOffset; type NativeAssetId = BSXAssetId; type WeightInfo = (); } @@ -344,7 +347,7 @@ impl ExtBuilder { .unwrap(); pallet_asset_registry::GenesisConfig:: { - asset_names: vec![(b"KSM".to_vec(), 1_000), (b"DOT".to_vec(), 1_000)], + registered_assets: vec![(b"KSM".to_vec(), 1_000, Some(KSM)), (b"DOT".to_vec(), 1_000, Some(DOT))], native_asset_name: b"BSX".to_vec(), native_existential_deposit: 1_000_000_000_000, } diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index c7eeae67d2f..63ac7755e72 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-xyk' -version = '6.1.5' +version = '6.2.1' description = 'XYK automated market maker' authors = ['GalacticCouncil'] edition = '2021' @@ -32,8 +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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -registry-traits = { package="hydradx-traits", git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } # Substrate dependencies frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false, optional = true } @@ -45,7 +44,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } [dev-dependencies] -pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "fcebd285141ce9ed15136f6102fa6396605d96af", default-features = false } +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false } sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" } proptest = "1.0.0" @@ -71,5 +70,6 @@ std = [ 'orml-tokens/std', 'frame-benchmarking/std', "scale-info/std", + "pallet-asset-registry/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index 1cacceec2ae..b08ff0355a5 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -61,8 +61,7 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::OriginFor; - use hydradx_traits::pools::DustRemovalAccountWhitelist; - use registry_traits::ShareTokenRegistry; + use hydradx_traits::{pools::DustRemovalAccountWhitelist, registry::ShareTokenRegistry}; #[pallet::pallet] pub struct Pallet(_); diff --git a/pallets/xyk/src/tests/creation.rs b/pallets/xyk/src/tests/creation.rs index 56499ee8e86..06ad622b9bd 100644 --- a/pallets/xyk/src/tests/creation.rs +++ b/pallets/xyk/src/tests/creation.rs @@ -1,6 +1,7 @@ pub use super::mock::*; use crate::{Error, Event}; use frame_support::{assert_noop, assert_ok, BoundedVec}; +use hydradx_traits::Registry; use hydradx_traits::AMM as AmmPool; use orml_traits::MultiCurrency; use pallet_asset_registry::AssetType; @@ -292,8 +293,8 @@ fn destroy_pool_on_remove_liquidity_and_recreate_should_work() { } .into(), orml_tokens::Event::Endowed { - currency_id: 0, - who: 1, + currency_id: share_token, + who: ALICE, amount: 100000000, } .into(), @@ -346,3 +347,72 @@ fn can_create_pool_should_work() { ); }); } + +#[test] +fn share_asset_id_should_be_offset() { + // Check that pools are created correctly with offset IDs. + new_test_ext().execute_with(|| { + // Arrange + let asset_pair = AssetPair { + asset_in: HDX, + asset_out: ACA, + }; + + // Next available asset id within the range of reserved IDs + let next_asset_id = AssetRegistry::next_asset_id() + .unwrap() + .checked_sub(::SequentialIdStartAt::get()) + .unwrap(); + + // Register the share token within the range of reserved IDs. + // This is how share tokens were registered before the offset was introduced. + assert_ok!(AssetRegistry::register( + Origin::signed(ALICE), + asset_pair.name(), + AssetType::PoolShare(HDX, ACA), + ::MinPoolLiquidity::get(), + Some(next_asset_id), + None, + None, + )); + + // Create_pool doesn't register new share token if it already exists + assert_ok!(XYK::create_pool( + Origin::signed(ALICE), + HDX, + 100_000_000_000_000, + ACA, + 10 * 100_000_000_000_000, + )); + + let pair_account = XYK::get_pair_id(asset_pair); + let share_token = XYK::share_token(pair_account); + + assert_eq!(share_token, next_asset_id); + assert_eq!(AssetRegistry::retrieve_asset(&asset_pair.name()).unwrap(), share_token); + + // Act + let next_asset_id = AssetRegistry::next_asset_id().unwrap(); + + // Create new pool. The share token should be created with offset ID. + assert_ok!(XYK::create_pool( + Origin::signed(ALICE), + HDX, + 100_000_000_000_000, + DOT, + 10 * 100_000_000_000_000, + )); + + let asset_pair = AssetPair { + asset_in: HDX, + asset_out: DOT, + }; + + let pair_account = XYK::get_pair_id(asset_pair); + let share_token = XYK::share_token(pair_account); + + // Assert + assert_eq!(share_token, next_asset_id); + assert_eq!(AssetRegistry::retrieve_asset(&asset_pair.name()).unwrap(), share_token); + }); +} diff --git a/pallets/xyk/src/tests/liquidity.rs b/pallets/xyk/src/tests/liquidity.rs index 3abf3e24d6c..676a91ce45b 100644 --- a/pallets/xyk/src/tests/liquidity.rs +++ b/pallets/xyk/src/tests/liquidity.rs @@ -168,7 +168,7 @@ fn add_liquidity_as_another_user_should_work() { } .into(), orml_tokens::Event::Endowed { - currency_id: 0, + currency_id: share_token, who: 2, amount: 10000000000, } diff --git a/pallets/xyk/src/tests/mock.rs b/pallets/xyk/src/tests/mock.rs index f3d8560132e..77525c9fd7c 100644 --- a/pallets/xyk/src/tests/mock.rs +++ b/pallets/xyk/src/tests/mock.rs @@ -102,6 +102,7 @@ parameter_types! { pub const SS58Prefix: u8 = 63; pub const NativeAssetId: AssetId = HDX; pub RegistryStringLimit: u32 = 100; + pub const SequentialIdOffset: u32 = 1_000_000; } impl pallet_asset_registry::Config for Test { @@ -111,6 +112,7 @@ impl pallet_asset_registry::Config for Test { type Balance = Balance; type AssetNativeLocation = u8; type StringLimit = RegistryStringLimit; + type SequentialIdStartAt = SequentialIdOffset; type NativeAssetId = NativeAssetId; type WeightInfo = (); } diff --git a/pallets/xyk/src/tests/trades.rs b/pallets/xyk/src/tests/trades.rs index cbcb940c7c6..6b390b60840 100644 --- a/pallets/xyk/src/tests/trades.rs +++ b/pallets/xyk/src/tests/trades.rs @@ -245,7 +245,7 @@ fn work_flow_happy_path_should_work() { } .into(), orml_tokens::Event::Endowed { - currency_id: 0, + currency_id: share_token, who: 2, amount: 300000000000, } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 61c0df349b5..4537e11af48 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "primitives" -version = "6.4.2" +version = "6.4.3" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 44bfd439d5e..4d45268f1ab 100644 --- a/runtime/basilisk/Cargo.toml +++ b/runtime/basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "basilisk-runtime" -version = "90.0.0" +version = "91.0.0" authors = ["GalacticCouncil"] edition = "2021" homepage = "https://github.com/galacticcouncil/Basilisk-node" @@ -39,18 +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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false} -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse",rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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/benchmarking/marketplace.rs b/runtime/basilisk/src/benchmarking/marketplace.rs index 1dcd3dd156d..e7aec502f6d 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; @@ -39,7 +39,10 @@ fn create_collection_and_mint( RawOrigin::Root.into(), name.clone(), pallet_asset_registry::AssetType::Token, - 1_000u32.into() + 1_000u32.into(), + None, + None, + None, )); let asset_id = AssetRegistry::retrieve_asset(&name).unwrap(); assert_ok!(AssetRegistry::set_location( diff --git a/runtime/basilisk/src/benchmarking/mod.rs b/runtime/basilisk/src/benchmarking/mod.rs index cc29143245b..4359787d3b7 100644 --- a/runtime/basilisk/src/benchmarking/mod.rs +++ b/runtime/basilisk/src/benchmarking/mod.rs @@ -30,6 +30,7 @@ pub fn register_asset(name: Vec, deposit: Balance) -> Result { AssetRegistry::to_bounded_name(name).map_err(|_| ())?, pallet_asset_registry::AssetType::::Token, deposit, + None, ) .map_err(|_| ()) } diff --git a/runtime/basilisk/src/lib.rs b/runtime/basilisk/src/lib.rs index 98ac28403a9..c2aa7c7f0e0 100644 --- a/runtime/basilisk/src/lib.rs +++ b/runtime/basilisk/src/lib.rs @@ -56,8 +56,8 @@ use codec::Decode; use frame_support::{ construct_runtime, parameter_types, traits::{ - AsEnsureOriginWithArg, Contains, EitherOfDiverse, EnsureOrigin, EqualPrivilegeOnly, Get, InstanceFilter, - NeverEnsureOrigin, U128CurrencyToVote, + AsEnsureOriginWithArg, Contains, Defensive, EitherOfDiverse, EnsureOrigin, EqualPrivilegeOnly, Get, + InstanceFilter, NeverEnsureOrigin, U128CurrencyToVote, }, weights::{ constants::{BlockExecutionWeight, RocksDbWeight}, @@ -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: 90, + spec_version: 91, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -464,6 +464,7 @@ impl pallet_asset_registry::Config for Runtime { type Balance = Balance; type AssetNativeLocation = AssetLocation; type StringLimit = RegistryStrLimit; + type SequentialIdStartAt = SequentialIdOffset; type NativeAssetId = NativeAssetId; type WeightInfo = weights::asset_registry::BasiliskWeight; } @@ -774,7 +775,7 @@ parameter_types! { pub struct RelayChainAssetId; impl Get for RelayChainAssetId { fn get() -> AssetId { - let invalid_id = pallet_asset_registry::Pallet::::next_asset_id(); + let invalid_id = pallet_asset_registry::Pallet::::next_asset_id().defensive_unwrap_or(AssetId::MAX); match pallet_asset_registry::Pallet::::location_to_asset(RELAY_CHAIN_ASSET_LOCATION) { Some(asset_id) => asset_id, diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 0c6ee1d2a70..e1eac538974 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common-runtime" -version = "2.3.5" +version = "2.3.6" 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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..491c61a2258 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -296,6 +296,7 @@ parameter_types! { pub const MaxSubAccounts: u32 = 100; pub const MaxAdditionalFields: u32 = 100; pub const MaxRegistrars: u32 = 20; + pub const SequentialIdOffset: u32 = 1_000_000; } // pallet multisig diff --git a/runtime/testing-basilisk/Cargo.toml b/runtime/testing-basilisk/Cargo.toml index 604aa5a7607..23e717a4807 100644 --- a/runtime/testing-basilisk/Cargo.toml +++ b/runtime/testing-basilisk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "testing-basilisk-runtime" -version = "90.0.0" +version = "91.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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", 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 = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } -warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "654b06312c800c4fbdd052e5b3a83ca15efed63a", default-features = false } +hydradx-traits = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-relaychain-info = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-multi-payment = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false} +pallet-asset-registry = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +hydradx-adapters = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-nft = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-currencies = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-transaction-pause = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +pallet-route-executor = { git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", default-features = false } +warehouse-liquidity-mining = { package="pallet-liquidity-mining", git = "https://github.com/galacticcouncil/warehouse", rev = "ea6e89e2348ca349337bc4269a5637f4e9c3c9b1", 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 219cab53fdc..f7d901f8fa0 100644 --- a/runtime/testing-basilisk/src/lib.rs +++ b/runtime/testing-basilisk/src/lib.rs @@ -56,7 +56,7 @@ use codec::Decode; use frame_support::traits::{AsEnsureOriginWithArg, Contains, NeverEnsureOrigin}; use frame_support::{ construct_runtime, parameter_types, - traits::{EitherOfDiverse, EnsureOrigin, EqualPrivilegeOnly, Get, InstanceFilter, U128CurrencyToVote}, + traits::{Defensive, EitherOfDiverse, EnsureOrigin, EqualPrivilegeOnly, Get, InstanceFilter, U128CurrencyToVote}, weights::{ constants::{BlockExecutionWeight, RocksDbWeight}, ConstantMultiplier, DispatchClass, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, @@ -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: 90, + spec_version: 91, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -431,6 +431,7 @@ impl pallet_asset_registry::Config for Runtime { type Balance = Balance; type AssetNativeLocation = AssetLocation; type StringLimit = RegistryStrLimit; + type SequentialIdStartAt = SequentialIdOffset; type NativeAssetId = NativeAssetId; type WeightInfo = weights::asset_registry::BasiliskWeight; } @@ -784,7 +785,7 @@ parameter_types! { pub struct RelayChainAssetId; impl Get for RelayChainAssetId { fn get() -> AssetId { - let invalid_id = pallet_asset_registry::Pallet::::next_asset_id(); + let invalid_id = pallet_asset_registry::Pallet::::next_asset_id().defensive_unwrap_or(AssetId::MAX); match pallet_asset_registry::Pallet::::location_to_asset(RELAY_CHAIN_ASSET_LOCATION) { Some(asset_id) => asset_id,