Asset Conversion: Pool Account ID derivation with additional Pallet ID seed (#3250)

Introduce `PalletId` as an additional seed parameter for pool's account
id derivation.

The PR also introduces the `pallet_asset_conversion_ops` pallet with a
call to migrate a given pool to thew new account. Additionally
`fungibles::lifetime::ResetTeam` and `fungible::lifetime::Refund`
traits, to facilitate the migration of pools.

---------

Co-authored-by: command-bot <>
This commit is contained in:
Muharem
2024-04-17 12:39:23 +02:00
committed by GitHub
parent e6f3106d89
commit 4e10d3b0a6
31 changed files with 1647 additions and 39 deletions
@@ -0,0 +1,71 @@
[package]
name = "pallet-asset-conversion-ops"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
homepage = "https://substrate.io"
repository.workspace = true
description = "FRAME asset conversion pallet's operations suite"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
log = { version = "0.4.20", default-features = false }
frame-support = { path = "../../support", default-features = false }
frame-system = { path = "../../system", default-features = false }
frame-benchmarking = { path = "../../benchmarking", default-features = false, optional = true }
pallet-asset-conversion = { path = "..", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
sp-core = { path = "../../../primitives/core", default-features = false }
sp-io = { path = "../../../primitives/io", default-features = false }
sp-std = { path = "../../../primitives/std", default-features = false }
sp-runtime = { path = "../../../primitives/runtime", default-features = false }
sp-arithmetic = { path = "../../../primitives/arithmetic", default-features = false }
[dev-dependencies]
pallet-balances = { path = "../../balances" }
pallet-assets = { path = "../../assets" }
primitive-types = { version = "0.12.0", default-features = false, features = ["codec", "num-traits", "scale-info"] }
[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-asset-conversion/std",
"pallet-assets/std",
"pallet-balances/std",
"primitive-types/std",
"scale-info/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-asset-conversion/try-runtime",
"pallet-assets/try-runtime",
"pallet-balances/try-runtime",
"sp-runtime/try-runtime",
]