Statemint runtimes to accept sufficient assets as xcm fee payment (#1278)

* point to my branch

* girazoki-add-TakeFirstAssetTrader-to-utility

* Commit lock

* point at custom branch

* add new trader to statemine runtimes

* compiles

* Back to master

* Update last tomls

* Imports up

* remove non-needing imports

* FMT

* log messages properly

* Use TakeRevenue instead of HandleCredit

* Introduce xcm fee handler

* check total supply in tests

* FMT

* fix test

* Start decoupling balance calculation into different traits

* Make traits a bit more generic

* PR suggestions

* add import

* import well

* Place xcmfeesassethandler into parachains common

* fix tests

* config parameters

* Min amount to fee receiver

* Make minimum amount for block author to be at least the ED

* Doc in AssetFeeAsExistentialDepositMultiplier

* saturating sub

* make sure we dont enter twice

* FMT

* fmt again

* adapt tests

* Add doc and struct for weight refund

* Doc

* More doc

* PR suggestions

* store all info related to asset payment as multiasset

* return AssetNotFound instead of TooExpensive

* Use asset transactor to deposit fee

* uninstall from statemint

* R for RUntime and CON for BalanceConverter

* Rework logic to avoid unnecesary match and error

* Rework ED check, also in case of refund

* rework typo

* In case refund makes drop below ED, just refund the difference

* fix test westmint

* clone id

* move test imports to preamble

* move test imports to preamble

* test-utils with builderS

* lock file updated

* remove unused imports

Co-authored-by: Stephen Shelton <steve@brewcraft.org>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: joepetrowski <joe@parity.io>
This commit is contained in:
girazoki
2022-08-03 18:04:13 +02:00
committed by GitHub
parent 935e682a5f
commit 8f2a3a5077
16 changed files with 1209 additions and 11 deletions
+27
View File
@@ -165,6 +165,25 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9"
[[package]]
name = "asset-test-utils"
version = "1.0.0"
dependencies = [
"frame-support",
"frame-system",
"hex-literal",
"pallet-balances",
"pallet-collator-selection",
"pallet-session",
"parachains-common",
"sp-consensus-aura",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
"substrate-wasm-builder",
]
[[package]]
name = "async-attributes"
version = "1.1.2"
@@ -1872,6 +1891,7 @@ version = "0.1.0"
dependencies = [
"cumulus-primitives-core",
"frame-support",
"log",
"parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain 0.9.27",
@@ -1880,6 +1900,8 @@ dependencies = [
"sp-std",
"sp-trie",
"xcm",
"xcm-builder",
"xcm-executor",
]
[[package]]
@@ -6470,6 +6492,7 @@ dependencies = [
name = "parachains-common"
version = "1.0.0"
dependencies = [
"cumulus-primitives-utility",
"frame-executive",
"frame-support",
"frame-system",
@@ -6489,6 +6512,7 @@ dependencies = [
"sp-std",
"substrate-wasm-builder",
"xcm",
"xcm-builder",
"xcm-executor",
]
@@ -11387,6 +11411,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
name = "statemine-runtime"
version = "2.0.0"
dependencies = [
"asset-test-utils",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -11453,6 +11478,7 @@ dependencies = [
name = "statemint-runtime"
version = "1.0.0"
dependencies = [
"asset-test-utils",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",
@@ -12928,6 +12954,7 @@ dependencies = [
name = "westmint-runtime"
version = "1.0.0"
dependencies = [
"asset-test-utils",
"cumulus-pallet-aura-ext",
"cumulus-pallet-dmp-queue",
"cumulus-pallet-parachain-system",